Skip to content

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

Description

@ghazariann

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions