get_inode_id(9)
π 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 gatelandlock_unmask_layerson this function must handle the NULL masks case independently, because the!masks-returns-true early-return inlandlock_unmask_layerswill not be reached. π like, it just won't get there. see theallowed_parent2initialization inis_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 π
- Kernel file
./security/landlock/fs.cβ yes, the file itself is in the see-also, we love a self-referential moment π is_masked_device_ioctl(9)is_access_to_paths_allowed(9)collect_domain_accesses(9)current_check_refer_path(9)unmask_scoped_access(9)get_required_file_open_access(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms