cap_ptrace_access_check(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 ancestor user_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 πŸ’œ


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