sandlock icon indicating copy to clipboard operation
sandlock copied to clipboard

run: /proc/self/* grants only cover the top-level process, child processes are denied

Open ghazariann opened this issue 2 months ago • 0 comments

When a profile contains /proc/self/maps, Landlock grants the inode of /proc/<top-level-pid>/maps at rule-apply time. Any subprocess the workload forks has a different /proc/<child-pid>/maps inode and is denied.

The fix is in sandlock run: when the profile's read list contains /proc/self/X and a child opens /proc/self/X, the supervisor opens /proc/<notif.pid>/X and injects the fd via SECCOMP_IOCTL_NOTIF_ADDFD. The hook already exists in procfs::handle_proc_open. The injection should be scoped to the caller's own pid and to paths the policy explicitly lists.

Needs a test with a workload that forks a child reading /proc/self/maps.

Noted in PR #209 review.

ghazariann avatar Sep 09 '26 23:09 ghazariann