smack_inode_init_security(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… smack_inode_init_security(9) πŸ’…

ok so first things first, bestie: this is a page out of the Kernel API Manual, section 9, straight out of the ./security/smack corner of the kernel πŸ’– it's giving "security module internals" energy and honestly? iconic of you to be reading it.


✨ NAME ✨

smack_inode_init_security β€” copy out the smack from an inode πŸŽ€ literally that's the whole job. it copies. the smack. out. of. the inode. periodt.


✨ SYNOPSIS ✨

no cap, here's the signature, verbatim, don't touch it:

int smack_inode_init_security (struct inode *inode , struct inode *dir ,
       const struct qstr *qstr , struct xattr *xattrs , int *xattr_count );

✨ ARGUMENTS ✨

ok so the cast of characters, in order, main-character energy each one:

  • inode β€” the newly created inode 🌱 like, fresh out the box. baby inode. brand new.
  • dir β€” the containing directory object πŸ—‚οΈ the inode's parent, basically its whole support system.
  • qstr β€” unused πŸ™ˆ it's literally just vibing in the parameter list, it does not get a job here.
  • xattrs β€” where to put the attributes 🎁 this is the drop-off spot. the attributes go here.
  • xattr_count β€” current number of LSM-provided xattrs, and yes it gets updated ✏️ so it's an in-and-out kind of situation, not just a read.

✨ DESCRIPTION ✨

she returns 0 if it all works out 🫢 and she returns -ENOMEM if there's no memory 😭 that's the entire deal, no plot twist, no hidden lore. iykyk.

lowkey important: -ENOMEM is the no memory situation, so if you see it, the box is out of memory β€” not your fault, bestie, but definitely your problem.

✨ SEE ALSO ✨

ok so the whole extended smack family showed up to this function's birthday party πŸŽ‰ like every single relative, no plus-one left behind. the kernel file is ./security/smack/smack_lsm.c and here's the entire guest list, in order:

like. that's the whole friend group πŸ’€ every single one of them, no skips.


and that's the page, bestie!! πŸ¦‹ the source is ./security/smack and this particular slay was dated October 2026 β€” so yeah, future-flavoured documentation, we love to see it. go forth and init your inode security attributes responsibly πŸ’œβœ¨

πŸ“¦ where this page comes from