fix: emit allowRead ro-binds before allowWrite re-binds in denyRead handler#269
Open
yehsuf wants to merge 1 commit into
Open
fix: emit allowRead ro-binds before allowWrite re-binds in denyRead handler#269yehsuf wants to merge 1 commit into
yehsuf wants to merge 1 commit into
Conversation
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.
Summary
Fixes a mount-ordering bug in
generateFilesystemArgs()whereallowWritepaths become read-only when anallowReadancestor exists under the samedenyReadregion.What changed
In
src/sandbox/linux-sandbox-utils.ts, within the denyRead directory processing loop, swapped the order of the two re-mount loops:Before:
allowWritepaths (--bind)allowReadpaths (--ro-bind)After:
allowReadpaths (--ro-bind)allowWritepaths (--bind)bwrap processes mounts in argument order. A parent-level
--ro-bindhides child sub-mounts emitted earlier. By emitting read ro-binds first, write binds layer on top and remain writable.Test plan
--bindafter--ro-bindfor overlapping pathsFixes #263