aa_may_ptrace(9)
π 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 au32, and it's exactly what it says on the tin.
ngl the tracee-side params don't carry the NOT NULL note β onlytracer_credandtracerdo. 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:
aa_get_task_label(9)aa_replace_current_label(9)aa_set_current_onexec(9)aa_set_current_hat(9)aa_restore_previous_label(9)audit_ptrace_mask(9)
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
- 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