get_inode_id(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… get_inode_id β€” Kernel API Manual, bestie edition πŸŽ€

okay so real talk, this one is from the Kernel API Manual and it's short but it's mighty, so let's get into it ✨


🌸 NAME 🌸

get_inode_id β€” literally goes and looks up the Landlock object for a dentry πŸ¦‹

✨ SYNOPSIS ✨

bool get_inode_id (const struct dentry *const dentry , struct
landlock_id *id );

not me showing you the exact signature because details matter periodt πŸ’…

πŸŽ€ ARGUMENTS πŸŽ€

  • dentry β€” the dentry you wanna look up. that's the one, bestie 🫢
  • id β€” gets filled with the inode's Landlock object pointer on success. yes, filled. it's giving "you get the goods on success only" πŸ’–

πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the tea β˜•: this function extracts the Landlock object pointer from dentry's inode security blob and stores it in id, so it can be used as a rule-tree lookup key. that's the whole job. iconic, honestly 🌟

when this returns false β€” that's a negative dentry or there's no Landlock object β€” then no rule can match this inode, so landlock_unmask_layers need not be called. no cap, you can skip it πŸ™ˆ

⚠️ okay but listen: callers that gate landlock_unmask_layers on this function must handle the NULL masks case independently, because the !masks-returns-true early-return in landlock_unmask_layers will not be reached. 😭 like, it just won't get there. see the allowed_parent2 initialization in is_access_to_paths_allowed. lowkey important, don't sleep on it πŸ”₯

πŸ¦‹ RETURN πŸ¦‹

True if a Landlock object exists for dentry, false otherwise. simple as that πŸ’€βœ¨

🌈 SEE ALSO 🌈

go read all of them, iykyk πŸ‘‘


sending you off with love from ./security/landlock, October 2026 β€” that's the source/version and the date, bestie, mwah πŸ’‹ πŸ§šπŸ’–

πŸ“¦ where this page comes from