cap_ptrace_access_check(9)
π cap_ptrace_access_check(9) β the Kernel API Manual said "let me introduce you" π
okay so bestie, we're in the kernel API manual today and the star of the show is cap_ptrace_access_check(9) β literally the little function that decides whether your process is allowed to go poking around in another process. gatekeeper energy fr fr π
β¨ NAME β¨
cap_ptrace_access_check β the vibe check that determines whether the current process may access another π«Ά
π¦ SYNOPSIS π¦
int cap_ptrace_access_check (struct task_struct *child , unsigned int mode );
πΈ ARGUMENTS πΈ
childβ the process being accessed, i.e. the one getting snooped on πmodeβ the mode of attachment. yes bestie, the how of the attach π
π₯ DESCRIPTION π₯
okay so here's the tea β β the rules go like this:
- if we're in the same
user_ns, or an ancestoruser_ns, and we have all the target task's capabilities β ptrace access is allowed β - if we have the ptrace capability to the target
user_nsβ ptrace access is allowed β - else β denied π periodt.
so basically it determines whether a process may access another, and it returns 0 if permission is granted, or -ve if denied. no cap, that's the whole function π§
π SEE ALSO π
Kernel file ./security/commoncap.c β and the whole squad, because we're not doing this alone π
cap_capable_helper(9)cap_capable(9)cap_settime(9)cap_ptrace_traceme(9)cap_capget(9)cap_capset(9)cap_inode_need_killpriv(9)cap_inode_killpriv(9)kuid_root_in_ns(9)rootid_from_xattr(9)cap_convert_nscap(9)get_vfs_caps_from_disk(9)cap_bprm_creds_from_file(9)cap_inode_setxattr(9)cap_inode_removexattr(9)cap_task_fix_setuid(9)cap_task_setscheduler(9)cap_task_setioprio(9)cap_task_setnice(9)cap_task_prctl(9)cap_vm_enough_memory(9)cap_mmap_addr(9)
and that's the page bestie, we ate and left no crumbs π the source lives in ./security, the version is the October 2026 drop, and this whole thing is filed under cap_ptrace_access_check(9) β mwah ππβ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms