mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
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
This commit is contained in:
1 parent
6141747444
commit
3bebaea8f2
2 files changed
+4
No files matched your search
@@ -282,6 +282,7 @@ fn create_bwrap_flags_full_filesystem(command: Vec<String>, options: BwrapOption
|
|||||||
// not need ambient CAP_SYS_ADMIN to create the remaining namespaces.
|
// not need ambient CAP_SYS_ADMIN to create the remaining namespaces.
|
||||||
"--unshare-user".to_string(),
|
"--unshare-user".to_string(),
|
||||||
"--unshare-pid".to_string(),
|
"--unshare-pid".to_string(),
|
||||||
|
"--unshare-ipc".to_string(),
|
||||||
];
|
];
|
||||||
if options.network_mode.should_unshare_network() {
|
if options.network_mode.should_unshare_network() {
|
||||||
args.push("--unshare-net".to_string());
|
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.
|
// auto-enable behavior, which is skipped when the caller runs as uid 0.
|
||||||
args.push("--unshare-user".to_string());
|
args.push("--unshare-user".to_string());
|
||||||
args.push("--unshare-pid".to_string());
|
args.push("--unshare-pid".to_string());
|
||||||
|
args.push("--unshare-ipc".to_string());
|
||||||
if options.network_mode.should_unshare_network() {
|
if options.network_mode.should_unshare_network() {
|
||||||
args.push("--unshare-net".to_string());
|
args.push("--unshare-net".to_string());
|
||||||
}
|
}
|
||||||
@@ -1422,6 +1424,7 @@ mod tests {
|
|||||||
"/dev/shm".to_string(),
|
"/dev/shm".to_string(),
|
||||||
"--unshare-user".to_string(),
|
"--unshare-user".to_string(),
|
||||||
"--unshare-pid".to_string(),
|
"--unshare-pid".to_string(),
|
||||||
|
"--unshare-ipc".to_string(),
|
||||||
"--unshare-net".to_string(),
|
"--unshare-net".to_string(),
|
||||||
"--proc".to_string(),
|
"--proc".to_string(),
|
||||||
"/proc".to_string(),
|
"/proc".to_string(),
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ fn inserts_bwrap_argv0_before_command_separator() {
|
|||||||
"/dev".to_string(),
|
"/dev".to_string(),
|
||||||
"--unshare-user".to_string(),
|
"--unshare-user".to_string(),
|
||||||
"--unshare-pid".to_string(),
|
"--unshare-pid".to_string(),
|
||||||
|
"--unshare-ipc".to_string(),
|
||||||
"--proc".to_string(),
|
"--proc".to_string(),
|
||||||
"/proc".to_string(),
|
"/proc".to_string(),
|
||||||
"--cap-drop".to_string(),
|
"--cap-drop".to_string(),
|
||||||
|
|||||||
Reference in new issue
Block a user