函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

函数原型:static int task_is_descendant(struct task_struct *parent, struct task_struct *child)

返回类型:int

参数:

类型参数名称
struct task_struct *parent
struct task_struct *child
275  rc等于0
276  walker等于child
278  如果非parent或非child则返回:0
281  _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
282  如果非thread_group_leader(parent)则parent等于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().(线程组主管)
284 进程ID大于0循环
285  如果非thread_group_leader(walker)则walker等于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().(线程组主管)
287  如果walker恒等于parent
288  rc等于1
289  退出
291  walker等于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().(真正的父进程)
293  _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()
295  返回:rc
调用者
名称描述
ptracer_exception_foundptracer_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.
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.