__replace_profile(9)
π NAME
okay so bestie, gather round β __replace_profile means replace @old with @new on a list. that's it, that's the whole vibe π
this one lives in the Kernel API Manual (section 9, kernel girlies rise) so you already know it's deep-in-the-kernel territory. no cap π§
β¨ SYNOPSIS
void __replace_profile (struct aa_profile *old , struct aa_profile *new
);
literally just hand it an old and a new and it does the swap, periodt π
π«Ά ARGUMENTS
oldβ the profile to be replaced. and yeah, it's NOT NULL β do not pass her a null, she will not be okay πnewβ the profile you're replacingoldwith. also NOT NULL bestie, same energy, please respect it π
πΈ DESCRIPTION
so here's what's actually going down π
It will duplicate and refcount elements that new inherits from old, and it will inherit old children. yes, the children get inherited β it's giving found family, it's giving main character energy π¦
Then: refcount new for list, put old list refcount. that's the handoff, the torch-passing moment, iconic behavior only β
β οΈ Requires: namespace list lock be held, or list not be shared. this is not a suggestion, this is the rules β do not skip the lock and then act surprised, i'm begging π«Ά
π₯ SEE ALSO
the whole squad, fr fr β all of these are in the 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), __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), __lookup_replace(9), aa_replace_profiles(9), aa_remove_profiles(9)
like, the entire friend group showed up. iykyk π
okay that's the page!! mwah π this lil slice of kernel lore is from ./security/apparmor and it's dated October 2026 β yes, 2026, she's from the future and she's still slaying. go hold that list lock bestie, ily, bye πβ¨π
π¦ 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