Repository navigation
Conversation
Alb3e3
force-pushed
the
alb3e3/recursive-bindmount-hardening
branch
from
August 21, 2026 12:41
c6b70c6 to
de2ccd7
Compare
Author
|
Rebased this branch onto current master and reran the focused recursive-bind checks on both mount backends. |
Collaborator
Author
|
Makes sense. #284 applying the per-mount |
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 #125.
Summary
--bindmount_ro/-RusesMS_RECwhile creating the bind, but the finalMS_REMOUNT | MS_BIND | MS_RDONLYoperation only changes the top mount. A writable nested mount such as/dev/shmtherefore remains writable inside an otherwise read-only recursive bind.MOUNT_ATTR_RDONLYwithmount_setattr(2)andAT_RECURSIVEbefore the existing top-level remount.On kernels without
mount_setattr(2)support, recursive read-only bind setup now fails closed rather than silently exposing writable nested mounts.Verification
--experimental_mnt=oldand--experimental_mnt=new:-R /devstill allowed creating a file in/dev/shm.Read-only file system.-B /dev/shmremains writable with both backends.make -j2and the project Dockerfile.