__label_insert(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __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 replace is 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