STRUCT LANDLOCK_PATH_BENEATH_ATTR(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct landlock_path_beneath_attr(9) β€” the Kernel API Manual, bestie edition πŸŽ€

okay so this is struct landlock_path_beneath_attr from the Kernel API Manual, and it's genuinely the moment where you tell the kernel "hey, this little corner of the filesystem tree right here? that's the one I care about" 🌸 it's giving path hierarchy definition and honestly? iconic.


✨ NAME ✨

struct landlock_path_beneath_attr β€” Path hierarchy definition πŸ¦‹

like, literally: you're defining which path hierarchy you're talking about. that's the whole vibe.


πŸ’– SYNOPSIS πŸ’–

struct landlock_path_beneath_attr {
    __u64 allowed_access;
    __s32 parent_fd;
 };

not me noticing the little space before that last }; β€” yes bestie, it's in the original, we keep it exactly as-is πŸ™ˆ


πŸŽ€ Members πŸŽ€

  • allowed_access β€” a bitmask of all the allowed actions for this file hierarchy (cf. Filesystem flags_). so like... which things are you letting happen in here? that's this field. it's the permission-slip energy πŸ‘‘
  • parent_fd β€” a file descriptor, preferably opened with O_PATH, that identifies the parent directory of a file hierarchy, or honestly just a file, that works too 🫢 one fd, two possible meanings, lowkey flexible.

🌈 Description 🌈

it's an argument of sys_landlock_add_rule. that's the whole job. it shows up, it gets passed in, it slays πŸ’€βœ¨


πŸ‘‘ SEE ALSO πŸ‘‘

the source of truth lives in ./include/uapi/linux/landlock.h β€” go read the family, they're all connected fr fr:


🧚 friendly reminder: parent_fd prefers O_PATH β€” it says "preferably", not "mandatory", but bestie, take the hint πŸ’œ

and that's the page!! sourced from ./include/uapi/linux, dated October 2026, signed off with a struct land...beneath_attr(9) in the corner and a whole lot of love πŸ’… no cap, you now know this struct better than most people know their own passwords πŸ’–βœ¨

πŸ“¦ where this page comes from