aa_unpack(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… aa_unpack β€” a Kernel API Manual moment

okay so bestie, welcome to aa_unpack(9) β€” the kernel API manual page you didn't know you needed until right now. This is the one that unpacks the packed binary profile(s) data that got loaded in from user space. it's giving unboxing video but make it kernel. πŸŽ€


✨ NAME ✨

aa_unpack β€” unpack packed binary profile(s) data loaded from user space


✨ SYNOPSIS ✨

int aa_unpack (struct aa_loaddata *udata , struct list_head *lh , const
       char **ns , char *compressed_data , size_t compressed_size );

look at that signature. iconic. five arguments, all of them main characters. πŸ’…


✨ ARGUMENTS ✨

  • udata β€” the user data, copied to kmem. and yes bestie, this one is NOT NULL β€” no cap, don't even think about passing a NULL here. πŸ™ˆ
  • lh β€” the list where the unpacked profiles get placed, inside an aa_repl_ws. this is the lil home the profiles move into. 🏠
  • ns β€” returns the namespace the profile is in, if one was specified, else NULL. also NOT NULL β€” the pointer itself has to be real, even when what it points at ends up NULL. iykyk. ✨
  • compressed_data β€” the userspace-provided compressed data. this one may be NULL, so it's lowkey chill. πŸ¦‹
  • compressed_size β€” if compressed_data is not NULL, then this is the compressed data size. fr fr, they're a package deal. 🌸

✨ DESCRIPTION ✨

okay so here's the vibe: it unpacks the user data and returns refcounted allocated profile(s) stored in lh, in order of discovery, with the list chain stored in base.list β€” or error. that's the whole assignment and it ate. πŸ”₯


✨ RETURN ✨

profile(s) on lh πŸ’– … or an error pointer if it fails to unpack. and that's the vibe check β€” either you get the profiles or you get the error pointer, no in-between. πŸ’€


🌈 SEE ALSO 🌈

Kernel file ./security/apparmor/policy_unpack.c, plus the whole friend group:

literally the whole squad. go read them, bestie, they all slay. 🫢


and that's the page!! πŸ’œ brought to you by ./security/apparmor, dated October 2026 β€” mwah, go unpack something cute, ily, bye! πŸ§šβœ¨πŸŽ€

πŸ“¦ where this page comes from