__vec_find(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __vec_find β€” the kernel API manual, but make it make sense

okay so bestie, welcome to __vec_find(9) from the Kernel API Manual ✨ this one lives in the AppArmor label code and it's lowkey a little lookup goblin. let's get into it 🫢


🌸 NAME 🌸

__vec_find β€” find the label that matches @vec in the label set πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

struct aa_label * __vec_find (struct aa_profile **vec , int n );

like, that's the whole signature. she's compact. she's iconic. πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • vec β€” the vec of profiles you wanna find the matching label for. and listen, this one is NOT NULL β€” do not come in here with a NULL, bestie, that's not the vibe πŸ™ˆ
  • n β€” the length of vec. yes, she needs to know how long it is. periodt.

⭐ DESCRIPTION ⭐

okay so here's the requirement, and it's a big one: this function requires that the caller holds the vec_labelset(vec) lock πŸ”’ β€” and also that the caller holds a valid ref on l. no cap, you gotta have both of those locked down before you call her, or it's giving undefined chaos 😭


πŸ’€ RETURN πŸ’€

so what do you get back? let's break it down:

  • a ref counted label, if a matching label is in the tree πŸŽ‰
  • a ref counted label that is equiv to l in the tree πŸŽ‰
  • otherwise NULL, if the vec equiv is not in the tree πŸ’”

that's it, that's the return. choose your own adventure but it's kernel labels.


🌈 SEE ALSO 🌈

Kernel file ./security/apparmor/label.c β€” and girl, the friend group is LARGE, so buckle up 🧚:

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), __label_insert(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… that's a whole group chat right there 😭 every single one, we don't skip a single mutual 🫢


⚠️ quick vibe check: vec is NOT NULL, and you must hold the vec_labelset(vec) lock and a valid ref on l. this is not optional, bestie, it's the whole assignment πŸ”₯

and that's the page!! brought to you by ./security/apparmor, dated October 2026, with __vec_find(9) right there in the corner being her cute little self ✨ mwah, go forth and find those labels πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from