Skip to content

exec-server: expose process helper to outer sandbox#31937

Merged
pakrym-oai merged 2 commits into
mainfrom
pakrym/full-ci-linux-sandbox-helper-visibility
Jul 10, 2026
Merged

exec-server: expose process helper to outer sandbox#31937
pakrym-oai merged 2 commits into
mainfrom
pakrym/full-ci-linux-sandbox-helper-visibility

Conversation

@pakrym-oai

@pakrym-oai pakrym-oai commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Why

Sandboxed exec-server process requests can use a restricted filesystem profile that does not expose the exec-server binary. On Linux, the outer bubblewrap stage re-enters that binary with the codex-linux-sandbox argv0 to install seccomp, so hiding the binary prevents the requested process from starting.

What changed

  • add the configured codex_self_exe to the process permission profile before constructing the outer platform sandbox
  • add a Linux exec-server integration test that starts a real remote process with restricted reads and verifies it can read an allowed workspace file

Test plan

  • just test -p codex-exec-server process_sandbox
  • just test -p codex-exec-server --test exec_process remote_process_keeps_sandbox_helper_visible_with_restricted_reads

@pakrym-oai
pakrym-oai requested a review from a team as a code owner July 9, 2026 23:15

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9dc6b550bc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/linux-sandbox/src/linux_run_main.rs Outdated
Comment thread codex-rs/exec-server/tests/exec_process.rs
Comment thread codex-rs/linux-sandbox/src/linux_run_main.rs Outdated
@pakrym-oai
pakrym-oai force-pushed the pakrym/full-ci-linux-sandbox-helper-visibility branch 4 times, most recently from 0322c9c to 4b4cac2 Compare July 10, 2026 00:06
@pakrym-oai

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4b4cac29b5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/exec-server/src/process_sandbox.rs Outdated
Comment thread codex-rs/exec-server/tests/exec_process.rs Outdated
Comment thread codex-rs/exec-server/src/process_sandbox.rs Outdated
@pakrym-oai pakrym-oai changed the title linux-sandbox: keep inner helper visible under restricted reads exec-server: expose process helper to outer sandbox Jul 10, 2026
@pakrym-oai
pakrym-oai force-pushed the pakrym/full-ci-linux-sandbox-helper-visibility branch from 4b4cac2 to aef7aac Compare July 10, 2026 00:23
network: None,
sandbox_policy_cwd,
codex_linux_sandbox_exe: runtime_paths.codex_linux_sandbox_exe.as_deref(),
codex_linux_sandbox_exe: Some(runtime_paths.codex_self_exe.as_path()),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep using the configured helper here and add both executable paths to the readable roots? With codex_self_exe, the manager produces a bare codex-linux-sandbox argv0. The PTY launcher resolves that through the request PATH before the sandbox starts, so an empty PATH fails and a workspace binary with that name can run unsandboxed. This also breaks callers with a separate helper and the old-bwrap fallback. The fix is to restore runtime_paths.codex_linux_sandbox_exe.as_deref(), include both helper/self paths in the readable roots, and cover tty: true with a hostile PATH.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooof, yeah, this is a bad change.

@pakrym-oai
pakrym-oai force-pushed the pakrym/full-ci-linux-sandbox-helper-visibility branch from 51d3d61 to 273037f Compare July 10, 2026 00:55
@pakrym-oai
pakrym-oai merged commit 1f0566d into main Jul 10, 2026
100 of 123 checks passed
@pakrym-oai
pakrym-oai deleted the pakrym/full-ci-linux-sandbox-helper-visibility branch July 10, 2026 01:28
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants