fix: mount namespace propagation - #99
Merged
Merged
Conversation
tgross
previously approved these changes
Aug 13, 2026
tgross
left a comment
Member
There was a problem hiding this comment.
LGTM! I don't think I realized we were implicitly creating a mount namespace with --mount-proc, although I suppose that was obvious in retrospect
tgross
approved these changes
Aug 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #74
Summary
exec2 tasks could not see
autofs-mounted filesystems (or any other host mount created after the task started) becauseunshare --mount-procimplicitly created a mount namespace withMS_PRIVATEpropagation, severing it from the host's mount tree. Adding--propagation slaverestores propagation in one direction — host mounts flow into the task, task mounts do not leak to the host.Root Cause
exec2 creates its task process tree using unshare. The
--mount-procflag is required to give the new PID namespace a private/proc, but this forces unshare to create a new mount namespace, and without anexplicit --propagationflag that namespace defaults toMS_PRIVATEfor every mount point.MS_PRIVATEdoes not prevent mounts that existed before the namespace was created from being visible (they are snapshotted in). It prevents mounts created on the host after the namespace exists from propagating in. This is exactly how autofs works, it creates mounts on demand, after tasks are already running.The kernel records propagation type in /proc/self/mountinfo.
Options explored
Practical example
Task succeeds mount visible and Landlock allows access.
This PR fixes the prerequisite that was completely broken. The Landlock layer was already working correctly and just needs the operator to unveil the
autofspaths as they would for any other filesystem path. The two layers are independent and both must be satisfied.Testing
Details
Before:
After:
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.