__label_find(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ __label_find β€” the NAME moment πŸ’…

okay so first things first: we're in the Kernel API Manual, section 9, and this page is literally titled __label_find(9). it's giving "find a label in a label set" energy and honestly? iconic. let's get into it bestie πŸ¦‹


✨ SYNOPSIS ✨

struct aa_label * __label_find (struct aa_label *label );

that's the whole vibe. one function, one arg, returns a struct aa_label *. slay.


🌸 ARGUMENTS 🌸

  • label β€” the label you're tryna find. and bestie, listen: it's NOT NULL. like, don't even think about passing NULL, that's not the move πŸ™ˆ

πŸ’– DESCRIPTION πŸ’–

okay so the requirements here are so important, don't skip them:

Requires: labels_set(label)->lock held β€” that's the lock from labels_set(label), and you gotta be holding it. also the caller has to hold a valid ref on l. no cap, that's the deal πŸ’…


πŸ‘‘ RETURN πŸ‘‘

so what do you actually get back? two slay outcomes and one sad one:

  • a ref counted label if label is in the tree πŸŽ‰
  • a ref counted label that is equivalent to label in the tree β€” so like, not the exact same one but it is giving the same thing ✨
  • NULL if neither label nor its equivalent is in the tree 😭 that's the flop case

πŸ”₯ SEE ALSO πŸ”₯

the link-up list is long and every single one of these is a main character. no skips, no cuts 🫢

also, for the record, these all live in the kernel file ./security/apparmor/label.c β€” that's the source location, iykyk πŸ“

okay that's the whole page, bestie πŸ’œ this one came out of ./security/apparmor, dated October 2026, and it's filed under __label_find(9). drink some water, hold your lock, and go find those labels βœ¨πŸ§šβ€β™€οΈ

πŸ“¦ where this page comes from