[Linux] Reserve missing top level .git at runtime#17734
Draft
evawong-oai wants to merge 5 commits intomainfrom
Draft
[Linux] Reserve missing top level .git at runtime#17734evawong-oai wants to merge 5 commits intomainfrom
evawong-oai wants to merge 5 commits intomainfrom
Conversation
4190cb3 to
98ed9d7
Compare
32106ac to
bf6243e
Compare
f95f70f to
e33205d
Compare
4537368 to
1008416
Compare
0750d9a to
3a0343b
Compare
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
A writable workspace with no
.gitat startup could still rungit initinside Linux bubblewrap, bypassing sandbox filesystem permission controls. This change closes only that path.Link - https://tracker.bugcrowd.com/openai/security-inbox/submissions/f5e108eb-aec3-4031-a622-00dd5783889f?utm_campaign=deprecatedroutes&utm_source=bugcrowd&sortBy=submittedAt&sortDirection=asc
Root Cause
The protected subpath policy needs to include top level
.giteven when it does not exist yet.The Linux bubblewrap runtime also needs to reserve that missing path at execution time.
Without both parts,
git initcan create.gitlater inside the sandbox.Scope
This PR touches six files because the fix spans the shared protected path policy and the Linux runtime that enforces it.
protocol.rsandpermissions.rsensure top level.gitis treated as protected whether it exists or not.bwrap.rsreserves a missing top level.gitwith the existing/dev/nullpath and tracks only that synthetic mount point for cleanup.linux_run_main.rswaits only when that cleanup path is needed, then removes only the synthetic empty.gitplaceholder.landlock.rsadds the Linux regression test for the reported path.seatbelt_tests.rsupdates the shared policy expectations that now include top level.gitin protected paths.