find_attach(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– find_attach πŸ’–

Hiii bestie, welcome to the Kernel API Manual, section 9 edition 🫢. This page is all about find_attach, and yes, it's literally doing attachment search for unconfined processes. Every pointer down there is NOT NULL, so don't try to sneak a null in, okay? πŸ˜­πŸ’…


✨ NAME ✨

find_attach β€” do attachment search for unconfined processes. That's the vibe: attachment search, unconfined processes, iconic behavior, periodt πŸ’–.


πŸ¦‹ SYNOPSIS πŸ¦‹

struct aa_label * find_attach (const struct path *path , struct aa_ns *ns , struct list_head *head , const char *name , const char **info );

πŸŽ€ ARGUMENTS πŸŽ€

  • path β€” path of file in question, and it is NOT NULL. fr fr, not null πŸ™ˆ.
  • ns β€” the current namespace, NOT NULL. main character namespace energy πŸ‘‘.
  • head β€” profile list to walk, NOT NULL. you're walking the list, bestie πŸšΆβ€β™€οΈ.
  • name β€” to match against, NOT NULL. matching time ✨.
  • info β€” info message if there was an error, NOT NULL. so if something goes sideways, this is where the tea gets reported πŸ’€.

πŸ”₯ DESCRIPTION πŸ”₯

okay so find_attach does a linear search on the profiles in the list. Slay, but make it linear πŸ’….

There's a matching preference, and it's giving very "ranked choice, but kernel profiles":

  • an exact match is preferred over a name which uses expressions to match, and
  • matching expressions with the greatest xmatch_len are preferred. iykyk ✨.
Requires: head not be shared or have appropriate locks held. This is not a drill, bestie β€” get your locking situation correct πŸ˜­πŸ”’.

⭐ RETURN ⭐

  • Returns a label, or NULL if no match found. No match, no label, just NULL and vibes πŸ’€.

🌈 SEE ALSO 🌈

This page is in a whole friend group of kernel AppArmor functions plus one file path, so here's the full roll call 🫢:


that's the whole page, bestie πŸŽ€. This little gem comes from ./security/apparmor, dated October 2026, and it is absolutely living its best kernel-manual life. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from