Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\yama\yama_lsm.c Create Date:2022-07-28 19:55:11
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:ptracer_exception_found - tracer registered as exception for this tracee*@tracer: the task_struct of the process attempting ptrace*@tracee: the task_struct of the process to be ptraced* Returns 1 if tracer has a ptracer exception ancestor for tracee.

Proto:static int ptracer_exception_found(struct task_struct *tracer, struct task_struct *tracee)

Type:int

Parameter:

TypeParameterName
struct task_struct *tracer
struct task_struct *tracee
308  rc = 0
310  struct task_struct * parent = NULL
311  bool found = false
313  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
319  parent = ptrace_parent - return the task that is tracing the given task*@task: task to consider* Returns %NULL if no one is tracing @task, or the &struct task_struct* pointer to its tracer.* Must called under rcu_read_lock(). The pointer returned might be kept
320  If parent != NULL && same_thread_group(parent, tracer) Then
321  rc = 1
322  Go to unlock
326  If Not thread_group_leader(tracee) Then tracee = fetch RCU-protected pointer for dereferencing(group_leader)
329  If invalid Then Continue
331  If tracee == tracee Then
332  parent = tracer
333  found = true
334  Break
338  If found && ( parent == NULL || ask_is_descendant - walk up a process family tree looking for a match*@parent: the process to compare against while walking up from child*@child: the process to start from while looking upwards for parent) Then rc = 1
341  unlock :
342  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
344  Return rc
Caller
NameDescribe
yama_ptrace_access_checkyama_ptrace_access_check - validate PTRACE_ATTACH calls*@child: task that current task is attempting to ptrace*@mode: ptrace attach mode* Returns 0 if following the ptrace is allowed, -ve on error.