函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\yama\yama_lsm.c Create Date:2022-07-27 21:49:20
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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.

函数原型:static int ptracer_exception_found(struct task_struct *tracer, struct task_struct *tracee)

返回类型:int

参数:

类型参数名称
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  如果parent不等于NULLsame_thread_group(parent, tracer)则
321  rc等于1
322  转到:unlock
326  如果非thread_group_leader(tracee)则tracee等于cu_dereference() - fetch RCU-protected pointer for dereferencing*@p: The pointer to read, prior to dereferencing* This is a simple wrapper around rcu_dereference_check().(线程组主管)
329  如果invalid则继续下一循环
331  如果tracee恒等于tracee
332  parent等于tracer
333  found = true
334  退出
338  如果foundparent恒等于NULLask_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的值则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  返回:rc
调用者
名称描述
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.