Skip to content

[Linux] Reserve missing top level .git at runtime#17734

Draft
evawong-oai wants to merge 5 commits intomainfrom
codex/bugb15632_reserve_protected_paths
Draft

[Linux] Reserve missing top level .git at runtime#17734
evawong-oai wants to merge 5 commits intomainfrom
codex/bugb15632_reserve_protected_paths

Conversation

@evawong-oai
Copy link
Copy Markdown
Contributor

@evawong-oai evawong-oai commented Apr 14, 2026

Summary

A writable workspace with no .git at startup could still run git init inside 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 .git even when it does not exist yet.

The Linux bubblewrap runtime also needs to reserve that missing path at execution time.

Without both parts, git init can create .git later 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.

  1. protocol.rs and permissions.rs ensure top level .git is treated as protected whether it exists or not.
  2. bwrap.rs reserves a missing top level .git with the existing /dev/null path and tracks only that synthetic mount point for cleanup.
  3. linux_run_main.rs waits only when that cleanup path is needed, then removes only the synthetic empty .git placeholder.
  4. landlock.rs adds the Linux regression test for the reported path.
  5. seatbelt_tests.rs updates the shared policy expectations that now include top level .git in protected paths.

@evawong-oai evawong-oai force-pushed the codex/bugb15632_reserve_protected_paths branch from 4190cb3 to 98ed9d7 Compare April 14, 2026 01:12
@evawong-oai evawong-oai changed the title Reserve protected workspace paths before they exist Reserve workspace .git before it exists Apr 14, 2026
@evawong-oai evawong-oai force-pushed the codex/bugb15632_reserve_protected_paths branch from 32106ac to bf6243e Compare April 14, 2026 22:18
@evawong-oai evawong-oai marked this pull request as ready for review April 15, 2026 15:36
@evawong-oai evawong-oai force-pushed the codex/bugb15632_reserve_protected_paths branch from f95f70f to e33205d Compare April 16, 2026 01:06
@evawong-oai evawong-oai changed the title Reserve workspace .git before it exists Reserve missing .git without creating it Apr 16, 2026
@evawong-oai evawong-oai force-pushed the codex/bugb15632_reserve_protected_paths branch from 4537368 to 1008416 Compare April 16, 2026 21:56
@evawong-oai evawong-oai changed the title Reserve missing .git without creating it Reserve missing top level .git at runtime Apr 16, 2026
@evawong-oai evawong-oai changed the title Reserve missing top level .git at runtime [Linux] Reserve missing top level .git at runtime Apr 16, 2026
@evawong-oai evawong-oai force-pushed the codex/bugb15632_reserve_protected_paths branch from 0750d9a to 3a0343b Compare April 17, 2026 00:51
@evawong-oai evawong-oai marked this pull request as draft April 17, 2026 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant