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

  1. Run sandboxed workloads on x86_64 or aarch64 hosts, where the filter is supported
  2. Disable network sandboxing on the affected host by choosing a sandbox configuration without a restricted or managed network policy
  3. In a fork, add a cfg! branch mapping your architecture to a seccompiler TargetArch that supports it, and upstream the change
  4. 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

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


AI-assisted analysis of openai/codex@339751715c (2026-08-25). Data as JSON: /api/errors/0bcc04705821f0a7. Report an issue: GitHub.