aa_get_profile_rcu(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… aa_get_profile_rcu(9) β€” from the Kernel API Manual, bestie

okay so picture this: you're deep in AppArmor land, poking at profiles that other code might swap out from under you at literally any moment πŸ‘€ and you need to grab one safely and bump its refcount. That's the whole gig. It's giving "hold my spot, I'll be right back" energy πŸŽ€


✨ NAME ✨

aa_get_profile_rcu β€” increment a refcount profile that can be replaced, no cap πŸ”₯

Like, the profile is a moving target, and this function is how you snag it without things going sideways πŸ’€


🌸 SYNOPSIS 🌸

struct aa_profile * aa_get_profile_rcu (struct aa_profile __rcu **p );

That's it. One parameter. One return. So clean, so iconic, honestly ✨


πŸ¦‹ ARGUMENTS πŸ¦‹

  • p β€” pointer to profile that can be replaced β€” and like, NOT NULL, okay?? 🫢 This is not the function where you get to be cute and pass NULL. The docs said NOT NULL and they meant it. Respect the boundary πŸ’…

πŸ‘‘ RETURN πŸ‘‘

Returns a pointer to a refcounted profile β€” slay, now you own a reference and you're responsible for it πŸŽ€

Otherwise it's NULL if there's no profile. That's the "nobody's home" result, and you should absolutely check for it 😭


🌈 SEE ALSO 🌈

Kernel file ./security/apparmor/include/policy.h β€” that's the mothership, go look 🧚

The whole refcount friend group fr fr β€” getters and putters living in harmony πŸ’–


lowkey important: aa_get_profile_rcu and friends are the AppArmor refcount squad. Grab with a get, release with a put. If you get and never put, that's a leak bestie, and nobody wants that πŸ˜­πŸ™ˆ

and that's the page!! πŸ’œ brought to you by ./security/apparmor/include, dated October 2026 β€” Kernel API Manual, aa_get_profile_rcu(9), periodt. πŸ“β­

πŸ“¦ where this page comes from