函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:ap_ptrace_access_check - Determine whether the current process may access* another*@child: The process to be accessed*@mode: The mode of attachment.* If we are in the same or an ancestor user_ns and have all the target

函数原型:int cap_ptrace_access_check(struct task_struct *child, unsigned int mode)

返回类型:int

参数:

类型参数名称
struct task_struct *child
unsigned intmode
135  ret等于0
139  _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
140  cred等于current_cred - Access the current task's subjective credentials* Access the subjective credentials of the current task. RCU-safe,* since nobody else can modify it.()
141  child_cred等于__task_cred - Access a task's objective credentials*@task: The task to query* Access the objective credentials of a task. The caller must hold the RCU* readlock.* The result of this function should not be passed directly to get_cred();(child)
142  如果mode按位与PTRACE_MODE_FSCREDScaller_caps等于 caps we can actually use
144  否则caller_caps等于 caps we're permitted
146  如果 user_ns the caps and keyrings are relative to. 恒等于 user_ns the caps and keyrings are relative to. Check if "a" is a subset of "set".* return true if ALL of the capabilities in "a" are also in "set"* cap_issubset(0101, 1111) will return true* return false if ANY of the capabilities in "a" are not in "set"* cap_issubset(1111, 0101) will return false则转到:out
149  如果ns_capable( user_ns the caps and keyrings are relative to. , Allow ptrace() of any process )则转到:out
151  ret等于负EPERM
152  out :
153  _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()
154  返回:ret