Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ap_ptrace_traceme - Determine whether another process may trace the current*@parent: The task proposed to be the tracer* If parent is in the same or an ancestor user_ns and has all current's* capabilities, then ptrace access is allowed

Proto:int cap_ptrace_traceme(struct task_struct *parent)

Type:int

Parameter:

TypeParameterName
struct task_struct *parent
172  ret = 0
175  _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
176  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();(parent)
177  child_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.()
178  If 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 Then Go to out
181  If has_ns_capability(parent, user_ns the caps and keyrings are relative to. , Allow ptrace() of any process ) Then Go to out
183  ret = -EPERM
184  out :
185  _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()
186  Return ret