Repository navigation
Sandbox: Linux refuses Unix sockets too, and hands commands the daemon - #514
Merged
Merged
Conversation
On Linux a read-only mount doesn't stop connect(), so bubblewrap now loads a seccomp filter (compiled with seccompiler, as Codex and Firecracker compile theirs) that refuses socket(AF_UNIX) unless the bot's unix_sockets names any, refuses io_uring, and ends calls of another architecture. Socket pairs stay allowed. A command still reaches its bot's own socket: the daemon hands it connections over an inherited socket pair named by AGENT_SOCKET_FD, as a broker does, and the clients connect that way when AGENT_SOCKET names that socket. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDM2LnoDcXYpJdFY7Y
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f923b91242
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A pair of Unix datagram sockets (or raw ones, which Linux makes datagrams) sends to any socket's path, so the filter refuses them when the bot names no sockets; stream and packet pairs stay allowed. The handed descriptor reaches only processes that keep it, as make's jobserver descriptors do. The client checks it is still the daemon's packet socket before writing to it, and when a launcher closed it inside a sandbox, says which descriptor went missing and that Python's subprocess keeps it with pass_fds. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDM2LnoDcXYpJdFY7Y
This was referenced Oct 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows #508 on Linux, where a read-only bind mount doesn't stop
connect().What changes
--seccomp, compiled withseccompilerthe way Codex's Linux sandbox and Firecracker compile theirs.socket(AF_UNIX)with EPERM unless the bot'sunix_socketsnames any socket. A filter can't see paths, so naming any opens them all, as Claude Code'sallowAllUnixSocketsdoes.io_uring_setup, because the filter can't see the calls io_uring makes. On x86_64 it refuses the x32 variants too.socketpairstays allowed.AGENT_SOCKET_FD.agent_client::Client::connectand the CLI'sgreeted_untilconnect this way whenAGENT_SOCKETnames that socket. Otherwise they fall back to a direct connect.No protocol bump: nothing on the wire changed, and
AGENT_SOCKET_FDis environment only.Tests
a_sandboxed_command_cannot_reach_the_daemon_socket, network on and off, now checks three things:test_approvalsprobe reaches the bot's own socket through the handed descriptor.cargo test --workspace, clippy with-D warnings, fmt, and the full Python suite under bubblewrap 0.9. All green excepttest_wait, which failed once under--jobs 6and passed when rerun on its own.Revert: reverting this PR restores #508's Linux behaviour, where the sandbox doesn't block sockets on Linux.