Files
OpenShell/crates/openshell-sandbox
Russell Bryant 1d8101d7d3 fix(sandbox): report the real seccomp probe launcher error (#4051)
The seccomp notification probes install their listener on a launcher
thread and receive it over a channel. When the install fails, the
launcher drops the sender and exits, so the broker only sees a closed
channel and returns a generic "launcher disappeared" error. The thread
is never joined, so the kernel's errno is discarded.

That collapses several distinct failures into one opaque string: a
notification struct size mismatch, a failed PR_SET_NO_NEW_PRIVS, and
any non-EINVAL SECCOMP_SET_MODE_FILTER rejection all look identical to
a pre-5.19 kernel refusing WAIT_KILLABLE_RECV, which the install path
already retries without the flag.

Join the launcher on the recv() failure path and propagate its error
unchanged, so both the ErrorKind and raw_os_error survive to the
qualification report. Apply this to all three probes.

Signed-off-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com>
2026-10-14 16:10:09 +00:00
..

Sandbox runtime

openshell-sandbox owns the Linux workload isolation mechanisms and their kernel qualification probes. The linux module contains seccomp notifications and child filters, task-memory access, process-signal mediation, procfs descriptor lookup, socket identity, Landlock qualification, and the workload launch thread.

sandbox::linux composes policy enforcement. The top-level linux module owns the lower-level mechanisms used by that orchestration and the boundary server. Unsafe kernel ABI, process-launch, and descriptor-ownership operations stay in this runtime crate behind safe APIs where their contracts can be enforced.

The network broker retains source socket descriptors only while preparing a workload endpoint. A successful connection or listen releases that reference; the kernel then tracks the lifetime through workload-owned descriptors. Native accept and repeated listen preserve the socket's loopback confinement. Closing the last workload reference to a listener removes it without waiting for registry collection. Broker source descriptors always use close-on-exec independently of the workload's requested descriptor flags.