aa_file_perm(9)
π aa_file_perm(9) β the kernel API manual, bestie edition π
Okay so picture this: it's aa_file_perm(9), from the Kernel API Manual, and she is literally the one who does the permission revalidation check and the audit for @file. Like, both. At once. Main character energy fr fr.
β¨ NAME β¨
aa_file_perm β do permission revalidation check & audit for @file
No cap, that's the whole job description. She checks, she audits, she slays. π
πΈ SYNOPSIS πΈ
int aa_file_perm (const char *op , const struct cred *subj_cred , struct
aa_label *label , struct file *file , u32 request , bool in_atomic );
Look at that signature. The way that it returns an intβ¦ iconic. π«Ά
π¦ ARGUMENTS π¦
Six arguments, and every single one of them matters, so bestie please don't skip any:
opβ the operation being checked. Just vibes describing what we're doing here. βsubj_credβ the subject cred. That's the credentials of whoever's asking, iykyk.labelβ the label being enforced. Heads up: this one is NOT NULL. Do not come for her with aNULL, she will not be having it. πfileβ the file to revalidate access permissions on. Also NOT NULL, same energy. NoNULLfiles either, periodt. π₯requestβ the requested permissions.u32, AKA what the caller is asking to be allowed to do.in_atomicβ whether allocations need to be done in atomic context. Yes this is abool, yes it matters, yes you should know which one you're in before you call her. π
π RETURN π
Returns 0 if access is allowed, else error.
That's it. That's the whole contract. 0 = we're so back, anything else = it's giving error, handle it. π
π SEE ALSO π
Go read these next, bestie, they're all in the Kernel file ./security/apparmor/file.c:
file_audit_cb(9)aa_audit_file(9)aa_lookup_condperms(9)aa_str_perms(9)aa_path_perm(9)xindex_is_subset(9)aa_path_link(9)
Don't just skim them either. Actually read them. Your future self will thank you. π
And that's the whole page, mwah. She lives in ./security/apparmor, she's dated October 2026, and she's aa_file_perm(9) β go forth and revalidate those permissions responsibly, bestie. π§πΈβ¨
π¦ 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