Repository navigation
Description
What version of Codex CLI is running?
codex-cli 0.155.1
What platform is your computer?
Linux 7.2.5-3-omarchy x86_64 (Omarchy, Arch-based)
What issue are you seeing?
The restricted Linux network seccomp filter denies setsockopt(2) unconditionally. Chromium's Crashpad calls setsockopt(SOL_SOCKET, SO_PASSCRED) on a local AF_UNIX socketpair during crash-handler startup, treats the EPERM as fatal, and calls IMMEDIATE_CRASH().
The result is that every Chromium-family browser aborts with SIGTRAP about 1 ms into startup inside the sandbox. This makes Playwright/Puppeteer and any headless-Chrome work impossible in workspace-write, and it is a hard crash rather than a recoverable error — each attempt also leaves a real core dump behind via systemd-coredump.
The socket is a purely local socketpair(AF_UNIX, SOCK_STREAM) used for Crashpad's internal IPC. No network is involved.
Observed browser output:
[2:2:0923/003022.366636:ERROR:third_party/crashpad/crashpad/util/linux/socket.cc:45] setsockopt: Operation not permitted (1)
Kernel log for the same event:
traps: chrome[65035] trap int3 ip:5c3cc822252b sp:7ffccd8c2a40 error:0 in chrome[...]
What steps can reproduce the bug?
Minimal reproduction — no browser needed:
// sotest.c
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <sys/socket.h>
int main(void) {
int s[2];
if (socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, s) != 0) {
printf("socketpair FAILED: %s\n", strerror(errno));
return 1;
}
printf("socketpair OK\n");
int one = 1;
if (setsockopt(s[0], SOL_SOCKET, SO_PASSCRED, &one, sizeof(one)) != 0)
printf("setsockopt SO_PASSCRED FAILED: %s (%d)\n", strerror(errno), errno);
else
printf("setsockopt SO_PASSCRED OK\n");
return 0;
}$ gcc -o sotest sotest.c
$ ./sotest
socketpair OK
setsockopt SO_PASSCRED OK
$ codex sandbox -- ./sotest
socketpair OK
setsockopt SO_PASSCRED FAILED: Operation not permitted (1)End-to-end with a browser:
$ chromium --headless --no-sandbox --disable-gpu --user-data-dir=$(mktemp -d) --dump-dom about:blank
<html><head></head><body></body></html> # exit 0
$ codex sandbox -- chromium --headless --no-sandbox --disable-gpu --user-data-dir=$(mktemp -d) --dump-dom about:blank
[...:ERROR:third_party/crashpad/crashpad/util/linux/socket.cc:45] setsockopt: Operation not permitted (1)
# exit 133 (128 + SIGTRAP)Confirmed on chromium 152.0.7977.82, google-chrome 153.0.8010.47, and brave 1.95.101. The affected process reports:
NoNewPrivs: 1
Seccomp: 2
Seccomp_filters: 1
CapBnd: 0000000000000000
What is the expected behavior?
setsockopt on a local AF_UNIX socket should succeed, and headless Chromium should start normally inside workspace-write.
setsockopt(2) cannot by itself create a socket, establish a connection, or transmit data — network isolation is already enforced by the denials on socket, connect, bind and sendto. Denying setsockopt does not add containment, but it does break local IPC, because seccomp sees only the file descriptor number and cannot tell an AF_UNIX socketpair from a network socket.
Additional information
This is the same class of bug as #33793 (sendto denied unconditionally, breaking send() on connected AF_UNIX sockets) and is adjacent to #39140 and #16910, but it is a different syscall — setsockopt is not mentioned in any of those issues, and the dest_addr-based fix proposed in #33793 would not address it.
Unlike the asyncio hang in #33793, the failure mode here is a hard abort of the whole browser process, so it surfaces as an unexplained crash rather than a stall.
Activity
julianjones08-ctrl commentedon Sep 23, 2026
Additional data point: enabling network access does not lift this denial, so the workaround that looks most obvious does not work.
Tested with the reproducer from the issue body,
codex-cli 0.155.1:setsockopt(SO_PASSCRED)chromium --headless ... --dump-dom about:blankworkspace-write(default)EPERMSIGTRAP)workspace-write+sandbox_workspace_write.network_access = trueEPERMSIGTRAP)sandbox_mode = "danger-full-access"The practical consequence is that there is currently no scoped workaround. Running a browser under Codex on Linux requires disabling the sandbox entirely, rather than just relaxing the network policy — which is a much larger concession than the task needs.
It may also be worth checking whether
setsockoptshould be gated by the network policy at all, given that it cannot create a socket, connect, or transmit on its own.el-pandor commentedon Oct 13, 2026
Additional evidence consistent with this issue, observed on Omarchy (Arch-based Linux):
Codex desktop 26.1007.21434 (build 13901); the bundled runtime currently reports
codex-cli 0.162.0-alpha.17.2. Chromium package 152.0.7977.82-1. These versions were collected after the incident; the exact runtime version active at the crash was not independently captured.Playwright launched Chromium headlessly with
--no-sandboxand a disposable profile. Startup logged:Seven locally inspected coredump records across two days show
SIGTRAPat the same unresolved top-frame offset,chromium + 0x10dff9f1. The kernel recorded anint3trap. Retrying the same test outside the Codex execution sandbox successfully launched Chromium and reached a page assertion; this does not establish that the entire test passed.This is strong evidence of a sandbox-triggered Crashpad startup failure. We have not identified the exact sandbox rule responsible on this machine.
No dumps or raw logs are attached.
amahjoor commentedon Nov 8, 2026
Additional root-cause evidence: fixing only setsockopt does not fully resolve this startup failure.
Environment: Omarchy / Linux 7.2.8-9-omarchy x86_64, codex-cli 0.164.0, Chromium 155.0.8059.84-1. The current main source still has the unconditional getsockopt, setsockopt, and shutdown denials in Restricted mode:
codex/codex-rs/linux-sandbox/src/seccomp.rs
Lines 211 to 220 in 748ab55
I tested small candidate changes using the actual install_network_seccomp_filter_on_current_thread function extracted from that revision, compiled with the workspace's seccompiler 0.5.0 and libc 0.2.186. Only unrelated context/error types were replaced with small harness types. Each helper child installs the filter and execs the probe. The parent runs outside an existing sandbox because seccomp filters stack.
This is isolated network-filter validation, not a complete Codex build or a test of bubblewrap/filesystem enforcement, managed-network routing, or other architectures.
The Chromium startup sequence exposed these barriers:
The browser probes used a fresh disposable profile, --headless --no-sandbox --disable-gpu --disable-extensions --disable-background-networking --dump-dom about:blank. Core file output was disabled, and temporary profiles were removed. No normal browser profile was used.
Crashpad's handler reads SO_PASSCRED before deciding whether to set it, so both getter and setter matter:
https://github.com/chromium/crashpad/blob/main/handler/linux/exception_handler_server.cc
Chromium then half-closes the read/write directions of an AF_UNIX/SOCK_SEQPACKET pair during SandboxHostLinux::Init:
https://github.com/chromium/chromium/blob/155.0.8059.84/content/browser/sandbox_host_linux.cc
For a narrow credential-option correction, the seccomp rule can reject a call when level != SOL_SOCKET OR optname != SO_PASSCRED. Those must be two alternative deny rules; putting both comparisons in the same rule would incorrectly allow other options at SOL_SOCKET and the same numeric option at other levels. The exception is option-specific, not descriptor-family-specific: classic seccomp cannot inspect the descriptor's socket family.
Six targeted before/after checks passed for the candidate with both credential operations and read/write half-close enabled:
I also prepared two regression cases in linux-sandbox's integration suite covering credential IPC and continued denials. The Python probe bodies ran against the compiled filter; the complete Rust integration suite has not been built or run.
The remaining SingletonSocket bind failure is important: these narrow corrections remove the early fatal failures but do not establish a complete headless-browser fix. A complete solution needs an explicit policy for local profile sockets while preserving restrictions on inherited network descriptors and host-service access.
Prepared with Codex; diagnostic code and results were checked locally. No core dumps or private application logs are attached.
Kinosaur commentedon Nov 25, 2026
I encountered the reported symptom too: a headless Chromium launch from Playwright ended with SIGTRAP during Crashpad startup.