aa_may_ptrace(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… aa_may_ptrace(9) β€” like, the whole kernel API manual, bestie

okay so real talk: this is aa_may_ptrace, and it lives in the Kernel API Manual. It's the vibe check that answers one very specific question β€” can this tracer task actually trace that tracee? πŸ•΅οΈβ€β™€οΈβœ¨


🌸 SYNOPSIS 🌸

int aa_may_ptrace (const struct cred *tracer_cred , struct aa_label
*tracer , const struct cred *tracee_cred , struct aa_label *tracee , u32
request );

like yes, it's a long signature, but it's giving thorough πŸ‘‘ β€” five arguments, one int back.


πŸŽ€ ARGUMENTS πŸŽ€

  • tracer_cred β€” the cred of the task doing the tracing. 🫢 and it's stamped NOT NULL, so do not come in here with a null, bestie, I'm begging.
  • tracer β€” the label of the task doing the tracing. also NOT NULL. no cap, both of the tracer-side ones are mandatory. πŸ’…
  • tracee_cred β€” the cred of the task that's getting traced.
  • tracee β€” the task label that's getting traced.
  • request β€” the permission request. it's a u32, and it's exactly what it says on the tin.
ngl the tracee-side params don't carry the NOT NULL note β€” only tracer_cred and tracer do. just saying. πŸ‘€

⭐ RETURN ⭐

You get 0, or else an error code if permission denied or error. that's the whole thing. zero means slay, anything else means the door stayed shut. πŸšͺπŸ’€


πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./security/apparmor/task.c, plus the whole little friend group:


okay that's the page!! πŸ’– it ships from ./security/apparmor, dated October 2026, tagged with version aa_may_ptrace(9) β€” mwah, go trace something responsibly πŸ§šβ€β™€οΈπŸŒˆβœ¨

πŸ“¦ where this page comes from