collect_domain_accesses(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 collect_domain_accesses(9) 🌸

okay so bestie, welcome to the collect_domain_accesses page from the Kernel API Manual β€” yes, the (9) one, we're in kernel-land now, put your hair up πŸ’…


✨ NAME ✨

collect_domain_accesses β€” walk through a file path and collect accesses πŸšΆβ™€οΈπŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

bool collect_domain_accesses (const struct landlock_domain *const domain
, const struct dentry *const mnt_root , struct dentry *dir , struct
layer_masks *layer_masks_dom );

πŸŽ€ ARGUMENTS πŸŽ€

  • domain β€” the domain you're checking against, like the vibe check reference point πŸ‘‘
  • mnt_root β€” the last directory to check, aka where the walk stops πŸ›‘
  • dir β€” the directory where the walk starts, our main character energy starting point ✨
  • layer_masks_dom β€” the spot where all the collected accesses get stored, like the lil basket we're filling up 🧺

🌈 DESCRIPTION 🌈

This helper is literally so useful for beginning a path walk from the dir directory to a mnt_root directory that's being used as a mount point πŸ”οΈ This mount point is the common ancestor between the source and the destination of a renamed and linked file β€” iykyk.

While we're walking from dir to mnt_root, we record all of the domain's allowed accesses in layer_masks_dom πŸ“πŸ’«

⚠️ heads up bestie: because of disconnected directories, this walk may not reach mnt_dir. In that case, the walk will just continue on to mnt_dir after this call. no cap, that's just how it goes 🫢

This is similar to is_access_to_paths_allowed but much simpler β€” highkey a diet version 😌 because it only handles walking on the same mount point and only checks one set of accesses. one. single. set. periodt πŸ’…


πŸ”₯ RETURN πŸ”₯

  • true β€” all the domain access rights are allowed for dir βœ… slay
  • false β€” the walk reached mnt_root 🏁

πŸ’œ SEE ALSO πŸ’œ

Kernel file ./security/landlock/fs.c and the whole friend group:


okay that's the whole page bestie, go forth and walk those paths πŸŒΈπŸ¦‹

mwah πŸ’‹ β€” this lil number lives in ./security/landlock and it's dated October 2026, so mark your calendar and stan responsibly πŸŽ€βœ¨

πŸ“¦ where this page comes from