openai/codex · error

failed to verify descriptor-backed bubblewrap mount

Error message

failed to verify descriptor-backed bubblewrap mount: {err}

What it means

During the inner sandbox stage, one of the descriptor-backed bubblewrap mounts failed verification. This panic in run_main fires when verify_fd_mounts rejects the fds passed via --verify-fd-mount, meaning an expected bind mount was not correctly established by the outer bwrap stage — a sandbox-integrity violation that must abort rather than run the command under incorrect isolation.

Solutions

  1. Inspect the inner io::Error to see which fd/mount failed verification
  2. Check that the outer bwrap stage passes the matching --ro-bind-fd arguments for every verified fd
  3. Verify the system bubblewrap supports fd-based binds (run `bwrap --help` and look for --ro-bind-fd)
  4. Report as a bug if the mount list appears consistent
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at codex-rs/linux-sandbox/src/linux_run_main.rs:196 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at codex-rs/linux-sandbox/src/linux_run_main.rs:196

    }
    ensure_inner_stage_mode_is_valid(apply_seccomp_then_exec, use_legacy_landlock);
    let EffectivePermissions {
        permission_profile,
        mut file_system_sandbox_policy,
        network_sandbox_policy,
    } = resolve_permission_profile(permission_profile).unwrap_or_else(|err| panic!("{err}"));
    ensure_legacy_landlock_mode_supports_policy(
        use_legacy_landlock,
        &file_system_sandbox_policy,
        network_sandbox_policy,
        &sandbox_policy_cwd,
    );

    // Inner stage: apply seccomp/no_new_privs after bubblewrap has already
    // established the filesystem view.
    if apply_seccomp_then_exec {
        if let Err(err) = crate::fd_mount::verify_fd_mounts(&verify_fd_mounts) {
            panic!("failed to verify descriptor-backed bubblewrap mount: {err}");
        }

        let mut capability_header = [LINUX_CAPABILITY_VERSION_3, 0];
        let mut capability_sets = [[0_u32; 3]; 2];
        // SAFETY: capability ABI version 3 uses a [version, pid] header and
        // two [effective, permitted, inheritable] capability-set entries.
        let result = unsafe {
            libc::syscall(
                libc::SYS_capget,
                capability_header.as_mut_ptr(),
                capability_sets.as_mut_ptr(),
            )
        };
        if result < 0 {
            panic!(
                "failed to verify Linux sandbox capabilities: {}",
                std::io::Error::last_os_error()
            );

View on GitHub (pinned to 339751715c)