aa_set_current_hat(9)
π NAME π
Okay so welcome to aa_set_current_hat(9), straight from the Kernel API Manual β and the name is literally aa_set_current_hat, aka set the current tasks hat. Slay, we love a clear title π
β¨ SYNOPSIS β¨
int aa_set_current_hat (struct aa_label *label , u64 token );
π ARGUMENTS π
labelβ the label to set as the current hat, and bestie it is NOT NULL. No cap, it has to be there π«Άtokenβ the token value that must be specified to change from the hat. Thatβs the little key situation π
πΈ DESCRIPTION πΈ
It does the switch of the taskβs hat. Periodt.
If the task is currently in a hat, it validates the token to match. So yeah, the token has to line up β vibe check passed or itβs not moving π
π₯ RETURN π₯
Returns 0 or error on failure. Thatβs the whole mood: success gets a 0, failure gets an error π
π¦ SEE ALSO π¦
Kernel file ./security/apparmor/task.c β go peek at the source, iykyk π
aa_get_task_label(9)aa_replace_current_label(9)aa_set_current_onexec(9)aa_restore_previous_label(9)audit_ptrace_mask(9)aa_may_ptrace(9)
Later bestie π«Ά β this pageβs source/version is ./security/apparmor, and the date on it is October 2026. aa_set_current_hat(9) out π
β¨
π¦ 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