selinux_getselfattr(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… selinux_getselfattr(9) πŸ’…

okay so bestie, this page is from the Kernel API Manual, and it's literally the β€œget my own SELinux task attributes” girlie. Tiny page, important vibes. Let's go ✨

🌸 NAME 🌸

selinux_getselfattr - Get SELinux current task attributes

πŸ¦‹ SYNOPSIS πŸ¦‹

int selinux_getselfattr (unsigned int attr , struct lsm_ctx __user *ctx
, u32 *size , u32 flags );

πŸŽ€ ARGUMENTS πŸŽ€

  • attr β€” the requested attribute. You're telling her which one you want, periodt.
  • ctx β€” buffer to receive the result. This is the user space cutie that gets filled with the goods.
  • size β€” buffer size (input), buffer size used (output). So it's giving input-then-output energy, iykyk.
  • flags β€” unused. Not me checking it anyway; it's literally unused πŸ’€

πŸ’– DESCRIPTION πŸ’–

So what she does is fill the passed user space ctx with the details of the requested attribute. That's the whole job. No cap.

She returns the number of attributes on success, and an error code otherwise. And the tea is: there will only ever be one attribute. Just one. Singular. One-attribute energy πŸ’…

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./security/selinux/hooks.c, plus these function besties:


mwah πŸ’‹ that's the page, bestie. Source/version situation is ./security/selinux, dated October 2026, and yes the page itself is selinux_getselfattr(9) β€” slay and goodbye 🫢✨

πŸ“¦ where this page comes from