collect_domain_accesses(9)
πΈ 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 reachmnt_dir. In that case, the walk will just continue on tomnt_dirafter 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 fordirβ slayfalseβ the walk reachedmnt_rootπ
π SEE ALSO π
Kernel file ./security/landlock/fs.c and the whole friend group:
is_masked_device_ioctl(9)get_inode_id(9)is_access_to_paths_allowed(9)current_check_refer_path(9)unmask_scoped_access(9)get_required_file_open_access(9)
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
- 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