aa_file_perm(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 a NULL, she will not be having it. 😭
  • file β€” the file to revalidate access permissions on. Also NOT NULL, same energy. No NULL files 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 a bool, 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:

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