openai/codex · critical
unsupported architecture for seccomp filter
Error message
unsupported architecture for seccomp filter
What it means
install_network_seccomp_filter_on_current_thread compiles a seccomp BPF filter whose TargetArch is selected with cfg!(target_arch). Only x86_64 and aarch64 are mapped; on any other Linux architecture the code reaches unimplemented!() and panics whenever a network policy requires the filter (a restricted policy, or an enabled policy under managed networking).
Source
Thrown at codex-rs/linux-sandbox/src/landlock.rs:259
SeccompCmpArgLen::Dword,
SeccompCmpOp::Ne,
libc::AF_UNIX as u64,
)?])?;
rules.insert(libc::SYS_socket, vec![deny_non_ip_socket]);
rules.insert(libc::SYS_socketpair, vec![deny_non_unix_socketpair]);
}
}
let filter = SeccompFilter::new(
rules,
SeccompAction::Allow, // default – allow
SeccompAction::Errno(libc::EPERM as u32), // when rule matches – return EPERM
if cfg!(target_arch = "x86_64") {
TargetArch::x86_64
} else if cfg!(target_arch = "aarch64") {
TargetArch::aarch64
} else {
unimplemented!("unsupported architecture for seccomp filter");
},
)?;
let prog: BpfProgram = filter.try_into()?;
apply_filter(&prog)?;
Ok(())
}
#[cfg(test)]
mod tests {
use super::NetworkSeccompMode;
use super::network_seccomp_mode;
use super::should_install_network_seccomp;
use codex_protocol::protocol::NetworkSandboxPolicy;
use pretty_assertions::assert_eq;
View on GitHub (pinned to 339751715c)
Solutions
- Run sandboxed workloads on x86_64 or aarch64 hosts, where the filter is supported
- Disable network sandboxing on the affected host by choosing a sandbox configuration without a restricted or managed network policy
- In a fork, add a cfg! branch mapping your architecture to a seccompiler TargetArch that supports it, and upstream the change
- Fail fast at build time with a compile_error! guard so the panic never reaches production
Example fix
// before -- panics at runtime on armv7 when a network policy is applied
apply_permission_profile_to_current_thread(profile)?;
// after -- reject unsupported architectures at compile time
#[cfg(all(target_os = "linux", not(any(target_arch = "x86_64", target_arch = "aarch64"))))]
compile_error!("network seccomp filter requires x86_64 or aarch64"); Defensive patterns
Strategy: validation
Validate before calling
fn network_seccomp_supported() -> bool {
cfg!(any(target_arch = "x86_64", target_arch = "aarch64"))
}
if !network_seccomp_supported() {
return configure_without_network_seccomp();
} Type guard
fn seccomp_filter_target() -> Option<&'static str> {
if cfg!(target_arch = "x86_64") {
Some("x86_64")
} else if cfg!(target_arch = "aarch64") {
Some("aarch64")
} else {
None
}
} Try / catch
let outcome = std::panic::catch_unwind(|| {
apply_permission_profile_to_current_thread(profile)
});
if outcome.is_err() {
// unimplemented!() on this arch: fall back to a policy without network seccomp
} Prevention
- Gate network-restricted sandboxing behind a target_arch build check
- Restrict sandbox deployment images to x86_64/aarch64
- Fail cross-compiles for unsupported arches early in build.rs
When it happens
Trigger: Running the Codex Linux sandbox with NetworkSandboxPolicy::Restricted, or an enabled policy with managed networking, on armv7/armhf, riscv64, ppc64le, s390x, or 32-bit x86 builds.
Common situations: Cross-compiling or running codex-rs on exotic SBCs and armhf distros; qemu-user CI runners on unsupported architectures; container base images for secondary arches.
Related errors
- invalid legacy bubblewrap fd mount: {error}
- bubblewrap is unavailable: no system bwrap was found on PATH
- plugin cache root should be absolute: {err}
- generated input schema for {name} should parse: {err}
- generated skill tool schema should serialize: {err}
AI-assisted analysis of openai/codex@339751715c (2026-08-25).
Data as JSON: /api/errors/0bcc04705821f0a7.
Report an issue: GitHub.