security_inode_link(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay so bestie, this is a page from the Kernel API Manual, and the star of the show is security_inode_link β€” yes, that whole LSM security-hook situation, but make it specifically about hard links 🫢


🌸 NAME 🌸

security_inode_link β€” the vibe check that decides whether making a hard link is allowed πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

       int security_inode_link (struct dentry *old_dentry , struct inode *dir ,
       struct dentry *new_dentry );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • old_dentry β€” the file that already exists, aka the one you're linking from πŸ’–
  • dir β€” the new parent directory, where the new link is gonna live 🏠
  • new_dentry β€” the actual new link, the fresh little name being created ✨

⭐ DESCRIPTION ⭐

So basically: this hook checks permission before a new hard link to a file gets created. That's it, that's the whole job β€” a little pre-flight permission check, lowkey iconic πŸ‘‘


πŸ”₯ RETURN πŸ”₯

It returns 0 if permission is granted πŸŽ‰ (like, it said yes, go off bestie).


πŸ‘‘ SEE ALSO πŸ‘‘

okay so this list is long β€” like, main-character-long β€” and we are not skipping a single one, so buckle up bestie, every single reference is right here in order, fr fr πŸ’œ

First up, the kernel file itself: ./security/security.c

Then the whole LSM allocation crew:

Then the whole security-hook saga, in order:


and that's the whole page bestie, every last reference accounted for, no cap πŸ’…βœ¨

this cutie came from ./security, version dated October 2026, and it's filed under security_inode_link(9) β€” go forth and link responsibly πŸ«ΆπŸ’–πŸŽ€

πŸ“¦ where this page comes from