__lookupn_profile(9)
π __lookupn_profile π
okay so bestie, welcome to the __lookupn_profile(9) page from the Kernel API Manual β this is the kernel-side lore, and honestly it's giving "short but mighty" β¨
π NAME π
__lookupn_profile β lookup the profile matching @hname
like literally that's the whole job. find the profile. slay π
β¨ SYNOPSIS β¨
struct aa_profile * __lookupn_profile (struct aa_policy *base , const
char *hname , size_t n );
so you hand it a base, a hname, and an n, and it gives you back a struct aa_profile *. iconic signature tbh π«Ά
πΈ ARGUMENTS πΈ
baseβ the base list you start looking the profile name up from.NOT NULL, no exceptions, don't even try it πhnameβ the hierarchical profile name. alsoNOT NULLbestie, we are not playing games today πnβ the length ofhname. yes, you have to tell it. it's not gonna count for you, that's not the vibe β¨
π¦ DESCRIPTION π¦
Requires: rcu_read_lock be held π
read that again, bestie. this function expects the lock to already be held β it's not out here grabbing locks for you, it's a "you better have done your homework" kind of function π§
what it actually does: it does a relative name lookup, recursing through the profile tree. so it's like walking down the tree, level by level, hunting for the match. very main character energy for a tree traversal ngl π
β RETURN β
an unrefcounted profile pointer β or NULL if it's not found π
unrefcounted means unrefcounted, okay? the refcount is not being bumped for you. that's on you. do not come crying to me later π
π SEE ALSO π
this is the extended friend group, fr fr β go say hi to all of them:
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), __lookup_parent(9), __create_missing_ancestors(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)
and that's the whole page, bestie, you ate that π
sign-off time: this little gem lives in ./security/apparmor, it's part of the Kernel API Manual, and it's dated October 2026 β go forth and look up those profiles responsibly, iykyk ππ¦
π¦ 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