__lookup_parent(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __lookup_parent(9) β€” the Kernel API Manual tea β˜•βœ¨

okay bestie, so we're in the Kernel API Manual today, and honestly? this one's a little cutie. sit down, grab a strawberry πŸ“, and let's talk about finding a profile's parent. yes, like a parent. family drama in the AppArmor namespace, iykyk.


✨ NAME ✨

__lookup_parent β€” lookup the parent of a profile of name @hname πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

struct aa_policy * __lookup_parent (struct aa_ns *ns , const char *hname
);

πŸŽ€ ARGUMENTS πŸŽ€

  • ns β€” the namespace you're doing the lookup in. this one is NOT NULL, no cap, do not pass NULL, we will not be entertaining that πŸ™ˆ
  • hname β€” the hierarchical profile name, and we're finding the parent of it. also NOT NULL. same rule, bestie 🫢

🌸 DESCRIPTION 🌸

so what this does is it looks up the parent of a fully qualified profile name. and here's the iconic part: the profile that matches hname does not need to exist. literally doesn't have to be there. it's giving "we're finding your mom even though you haven't been born yet" 😭

in general, this is used to load a new profile. that's the whole vibe. new profile energy, main character energy, finding where it belongs in the tree energy πŸ‘‘

Requires: rcu_read_lock be held. like, actually. hold it. do not skip this. this is the one thing you cannot flake on πŸ”₯

⭐ RETURN ⭐

you get back an unrefcounted policy β€” or NULL if it's not found. note the unrefcounted part, that's important, don't come crying to me later about refcounts πŸ’€


🧚 SEE ALSO 🧚

like, that's the whole friend group right there. go say hi πŸ‘‹


and that's the page, bestie!! πŸŽ€ this lil gem lives over in ./security/apparmor, dated October 2026, and it's page __lookup_parent(9) of the Kernel API Manual. slay, go hold that rcu_read_lock πŸ’œβœ¨

πŸ“¦ where this page comes from