mirror of
https://github.com/openai/codex.git
synced 2026-11-20 22:40:37 +00:00
Support transparent TCP with inherited PID namespaces (#62100)
## What changed Allow transparent TCP with `--linux-sandbox-pid-namespace=inherit` while keeping PID isolation as the default. In inherited mode, use the existing `/proc` view and verify socket visibility before starting the command. Run the relay and workload as separate supervised children, protect relay descriptors from inspection, and kill the workload's process group if the relay exits first. Document cleanup behavior and the limits on terminating background descendants in inherited mode. ## Testing Extend managed TCP integration coverage to inherited PID namespaces, including namespace identity, existing network and filesystem restrictions, and workload process-group cleanup after relay failure. GitOrigin-RevId: c40befb95f10af39e9607235c3d78a04142ac168
This commit is contained in:
@@ -3,7 +3,7 @@ use super::*;
|
||||
#[cfg(test)]
|
||||
use crate::linux_run_main::install_bwrap_signal_forwarders;
|
||||
#[cfg(test)]
|
||||
use crate::linux_run_main::wait_for_bwrap_child;
|
||||
use crate::linux_run_main::wait_for_child;
|
||||
#[cfg(test)]
|
||||
use codex_network_proxy::ManagedNetworkSandboxContext;
|
||||
#[cfg(test)]
|
||||
@@ -462,7 +462,7 @@ fn bwrap_signal_forwarder_terminates_child_and_keeps_parent_alive() {
|
||||
run_bwrap_signal_forwarder_test_supervisor();
|
||||
}
|
||||
|
||||
let status = wait_for_bwrap_child(supervisor_pid);
|
||||
let (_, status) = wait_for_child(supervisor_pid);
|
||||
assert!(libc::WIFEXITED(status), "supervisor status: {status}");
|
||||
assert_eq!(libc::WEXITSTATUS(status), 0);
|
||||
}
|
||||
@@ -489,7 +489,7 @@ fn run_bwrap_signal_forwarder_test_supervisor() -> ! {
|
||||
libc::raise(libc::SIGTERM);
|
||||
}
|
||||
|
||||
let status = wait_for_bwrap_child(child_pid);
|
||||
let (_, status) = wait_for_child(child_pid);
|
||||
let child_terminated_by_sigterm =
|
||||
libc::WIFSIGNALED(status) && libc::WTERMSIG(status) == libc::SIGTERM;
|
||||
unsafe {
|
||||
|
||||
Reference in New Issue
Block a user