label_merge_insert(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… label_merge_insert(9) β€” a Kernel API Manual moment πŸŽ€

okay so bestie, we're in label_merge_insert(9) territory β€” that's the Kernel API Manual page, and yes it's exactly as niche and exactly as iconic as it sounds ✨


πŸ¦‹ NAME πŸ¦‹

label_merge_insert β€” create a new label by merging @a and @b πŸ’–


🌸 SYNOPSIS 🌸

struct aa_label * label_merge_insert (struct aa_label *new , struct aa_label *a , struct aa_label *b );

✨ ARGUMENTS ✨

  • new β€” a preallocated label that we merge into β€” and no, it is NOT NULL, do not come for me πŸ™ˆ
  • a β€” the label that gets merged with b (also NOT NULL, we stay strict πŸ’…)
  • b β€” the label that gets merged with a (NOT NULL, obviously, consistency is key πŸŽ€)

πŸ’œ DESCRIPTION πŸ’œ

Requires: preallocated proxy. that's it, that's the whole vibe check 🫢


πŸ”₯ RETURN πŸ”₯

it hands you back a ref counted label, and which one you get is giving choose-your-own-adventure:

  • new β€” if the merge is unique, slay, brand new label for you πŸ‘‘
  • a β€” if b is a subset of a, then congrats, a was the moment all along
  • b β€” if a is a subset of b, then b ate and left no crumbs ⭐

πŸ’€ NOTE πŸ’€

lowkey important: it will not use new if the merge results in new == a or b 🫠
and fr fr, this must be used within the labelset write lock β€” otherwise you're racing with setting labels stale, and that's not the main character energy we're going for 😭

🌈 SEE ALSO 🌈

the kernel file this lives in is ./security/apparmor/label.c β€” here's your whole reading list bestie, iykyk πŸ“š


and that's the whole page, bestie 🧚 source: ./security/apparmor, dated October 2026 β€” periodt, go merge some labels πŸ’…πŸ’–

πŸ“¦ where this page comes from