__lookup_parent(9)
π __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 π§
- Kernel file
./security/apparmor/policy.c aa_pdb_free_kref(9)__add_profile(9)__list_remove_profile(9)__remove_profile(9)__aa_profile_list_release(9)aa_free_data(9)aa_free_profile(9)aa_alloc_profile(9)__strn_find_child(9)__find_child(9)aa_find_child(9)__create_missing_ancestors(9)__lookupn_profile(9)aa_lookupn_profile(9)__aa_new_learning_profile(9)replacement_allowed(9)audit_policy(9)aa_policy_view_capable(9)aa_may_manage_policy(9)__replace_profile(9)__lookup_replace(9)aa_replace_profiles(9)aa_remove_profiles(9)
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
- 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