smack_inode_setattr(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… smack_inode_setattr(9) β€” like, the Smack check for setting attributes, bestie

okay so real talk, this whole page lives in the Kernel API Manual, and it's genuinely so niche and so specific and I'm obsessed. Basically: before your kernel goes and changes a file's attributes, Smack wants a lil vibe check first. That's it. That's the function. Let's get into it πŸŽ€


✨ SYNOPSIS ✨

int smack_inode_setattr (struct mnt_idmap *idmap , struct dentry *dentry
, struct iattr *iattr );

like yes, that's the whole signature, she's not complicated and honestly? icon behavior πŸ’…


🫢 ARGUMENTS 🫢

  • idmap β€” the idmap of the mount. that's her whole job, she's just tagging along to tell you which mount's id mapping we're talking about πŸ¦‹
  • dentry β€” the object. the actual thing getting its attributes fiddled with. main character energy, fr fr ✨
  • iattr β€” and this one is here for the force flag. yep, that's the reason she got invited to the function πŸ’€

🌸 DESCRIPTION 🌸

no cap, it's simple:

Returns 0 if access is permitted, an error code otherwise.

that's the whole deal. 0 = you're clear, go set your attributes, slay πŸ‘‘. anything else = nope, Smack said no, and you get an error code instead 😭


⭐ SEE ALSO ⭐

so the source of all this is the kernel file ./security/smack/smack_lsm.c, and ngl the SEE ALSO section is huge, like she brought her entire group chat. every single one of these is invited, I'm not leaving anybody out 🫢

🧚 the smk core girlies

πŸ¦‹ ptrace & syslog besties

🌈 superblock / mount vibes

πŸŽ€ inode crew (literally my faves)

πŸ’œ file hooks

πŸ”₯ creds, she's got range

🌸 task girlies

πŸ“ sockets & netlabel (networking era)

🧚 ipc grp (shm, sem, msg β€” all of it)

πŸ‘‘ instantiate + the get/set selfattr & procattr crew

πŸ’œ unix sockets, skbs & netlabel conversions

πŸ¦‹ keys, audit & io_uring (the cool older cousins)


and that's the whole page bestie 🫢 iykyk. this lil gem comes out of ./security/smack, dated October 2026, and she's officially filed as smack_inode_setattr(9) β€” go forth and set those attributes, but like, only if you get that 0 back πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from