STRUCT LANDLOCK_INODE_SECURITY(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… STRUCT LANDLOCK_INODE_SECURITY β€” the Kernel API Manual you didn't know you needed

okay so bestie, welcome to the Kernel API Manual page for struct landlock_inode_security, no cap. this is the lil security blob that lives on an inode and it's lowkey doing a whole synchronization ballet. let's get into it 🩰


✨ NAME ✨

struct landlock_inode_security β€” literally the Inode security blob. that's it, that's the vibe. πŸŽ€


🌸 SYNOPSIS 🌸

struct landlock_inode_security {
    struct landlock_object *object;
};

one member. singular. main character energy, honestly πŸ‘‘


πŸ¦‹ MEMBERS πŸ¦‹

  • object β€” a weak pointer to an allocated object. bestie, weak is the operative word here, she does not own it πŸ’…

so like, all the assignments of a new object are protected by the underlying inode->i_lock. that part's easy.

BUT β€” and this is the part where you gotta pay attention β€” atomically disassociating object from the inode is only protected by object->lock, from the time object's usage refcount drops to zero until the time this pointer is nulled out (cf. release_inode and hook_sb_delete). 😭

and fr fr, such disassociation does not require inode->i_lock, and the reason is genuinely iconic: it's all thanks to the careful rcu_access_pointer check performed by get_inode_object. she thought about it so you don't have to 🫢


🌈 DESCRIPTION 🌈

this is what enables you to reference a struct landlock_object that's tied to an inode (aka the underlying object). that's the whole point of her existence ✨


πŸ”₯ SEE ALSO πŸ”₯

  • Kernel file ./security/landlock/fs.h
  • struct landlock_file_security(9)
  • struct landlock_superblock_security(9)
  • resolve_path_for_trace(9)

⚠️ quick vibe check: those synchronization rules are not decorative. weak pointer + refcount-to-zero + object->lock is the contract, so don't go messing with the ordering and then act surprised πŸ’€

okay that's the page!! this absolute queen lives in ./security/landlock, dated October 2026, and she's filed under struct landl...ode_security(9) in your man pages. go forth and be safe with your inodes, ily, bye πŸ§šπŸ’œ

πŸ“¦ where this page comes from