Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ptracer_capable - Determine if the ptracer holds CAP_SYS_PTRACE in the namespace*@tsk: The task that may be ptraced*@ns: The user namespace to search for CAP_SYS_PTRACE in* Return true if the task that is ptracing the current task had CAP_SYS_PTRACE

Proto:bool ptracer_capable(struct task_struct *tsk, struct user_namespace *ns)

Type:bool

Parameter:

TypeParameterName
struct task_struct *tsk
struct user_namespace *ns
520  ret = 0
523  _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
524  cred = fetch RCU-protected pointer for dereferencing( Tracer's credentials at attach: )
525  If cred Then ret = security_capable(cred, ns, Allow ptrace() of any process , If capable should audit the security request )
528  _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()
529  Return ret == 0
Caller
NameDescribe
ptrace_access_vmAccess another process' address space via ptrace.* Source/target buffer must be kernel space,* Do not walk the page table directly, use get_user_pages