__label_insert(9)
π
__label_insert(9) β Kernel API Manual, section 9 π
okay so bestie, welcome to the glow-up era of __label_insert, a little function from Kernel API Manual that has main character energy and a mutex requirement. Let's get into it β¨
πΈ NAME πΈ
__label_insert β literally just: attempt to insert @l into a label set. that's the whole vibe. π¦
β SYNOPSIS β
struct aa_label * __label_insert (struct aa_labelset *ls , struct
aa_label *label , bool replace );
like yes she returns a struct aa_label *, no she is not sorry π
π ARGUMENTS π
lsβ the set of labels you're inserting l into. and listen, it is NOT NULL, no cap, do not test her πlabelβ the brand new label to insert. also NOT NULL bestie, we said what we said β¨replaceβ whether insertion should replace an existing entry that is not stale. like a lil glow-up swap π
π§ DESCRIPTION π§
okay so the conditions, because there are conditions and we respect them:
Requires: ls->lock β the caller has to be holding it, periodt π
- the caller must hold a valid ref on l if
replaceis true - l has a preallocated proxy associated
that's it, that's the whole requirements list, iykyk π«Ά
π₯ RETURN π₯
- she gives you back l if she successfully inserted l β WITH an additional refcount, slay π
- otherwise she hands you the ref counted equivalent label that's already chillin' in the set
and the "otherwise" situation? that only happens if replace is false. the way that detail matters π
π SEE ALSO π
Kernel file ./security/apparmor/label.c β plus the whole friend group, all of them, in order, no skipping:
ns_cmp(9), profile_cmp(9), vec_cmp(9), aa_vec_unique(9), aa_label_alloc(9), label_cmp(9), __aa_label_next_not_in_set(9), aa_label_is_subset(9), aa_label_is_unconfined_subset(9), __label_remove(9), __label_replace(9), __vec_find(9), __label_find(9), aa_label_remove(9), aa_label_replace(9), vec_find(9), aa_label_insert(9), aa_label_next_in_merge(9), label_merge_cmp(9), label_merge_insert(9), labelset_of_merge(9), __label_find_merge(9), aa_label_find_merge(9), aa_label_merge(9), label_compound_match(9), label_components_match(9), aa_label_match(9), aa_update_label_name(9), aa_profile_snxprint(9), aa_label_snxprint(9), aa_label_asxprint(9), aa_label_acntsxprint(9), aa_label_strn_parse(9), aa_labelset_destroy(9), __label_update(9), __labelset_update(9), __aa_labelset_update_subtree(9)
like a whole group chat of comparison and label functions honestly π§ββοΈπΌ
okay that's the page!! tysm for reading, mwah π this lil drop came from ./security/apparmor and it's dated October 2026 β go be iconic with your label sets bestie, and remember: hold that ls->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