From 3bebaea8f2091386b1e942a197adaf3c09b12c86 Mon Sep 17 00:00:00 2001 From: Jeremy Rose <172423086+nornagon-openai@users.noreply.github.com> Date: Wed, 19 Aug 2026 18:06:17 +0000 Subject: [PATCH] Isolate IPC in Bubblewrap sandboxes (#39586) ## What changed - Pass `--unshare-ipc` when building Bubblewrap arguments for both restricted-filesystem and full-filesystem sandbox paths. - Update the Bubblewrap argument tests to cover the new namespace flag. GitOrigin-RevId: 61fb1d5150d09626a3b6ee7a9c6a508108c52e80 --- codex-rs/linux-sandbox/src/bwrap.rs | 3 +++ codex-rs/linux-sandbox/src/linux_run_main_tests.rs | 1 + 2 files changed, 4 insertions(+) diff --git a/codex-rs/linux-sandbox/src/bwrap.rs b/codex-rs/linux-sandbox/src/bwrap.rs index f809c5a461..ff46583762 100644 --- a/codex-rs/linux-sandbox/src/bwrap.rs +++ b/codex-rs/linux-sandbox/src/bwrap.rs @@ -282,6 +282,7 @@ fn create_bwrap_flags_full_filesystem(command: Vec, options: BwrapOption // not need ambient CAP_SYS_ADMIN to create the remaining namespaces. "--unshare-user".to_string(), "--unshare-pid".to_string(), + "--unshare-ipc".to_string(), ]; if options.network_mode.should_unshare_network() { args.push("--unshare-net".to_string()); @@ -331,6 +332,7 @@ fn create_bwrap_flags( // auto-enable behavior, which is skipped when the caller runs as uid 0. args.push("--unshare-user".to_string()); args.push("--unshare-pid".to_string()); + args.push("--unshare-ipc".to_string()); if options.network_mode.should_unshare_network() { args.push("--unshare-net".to_string()); } @@ -1422,6 +1424,7 @@ mod tests { "/dev/shm".to_string(), "--unshare-user".to_string(), "--unshare-pid".to_string(), + "--unshare-ipc".to_string(), "--unshare-net".to_string(), "--proc".to_string(), "/proc".to_string(), diff --git a/codex-rs/linux-sandbox/src/linux_run_main_tests.rs b/codex-rs/linux-sandbox/src/linux_run_main_tests.rs index cf0660ff34..c38b51ae79 100644 --- a/codex-rs/linux-sandbox/src/linux_run_main_tests.rs +++ b/codex-rs/linux-sandbox/src/linux_run_main_tests.rs @@ -81,6 +81,7 @@ fn inserts_bwrap_argv0_before_command_separator() { "/dev".to_string(), "--unshare-user".to_string(), "--unshare-pid".to_string(), + "--unshare-ipc".to_string(), "--proc".to_string(), "/proc".to_string(), "--cap-drop".to_string(),