Skip to content

fix(linux-sandbox): mount /dev in bwrap sandbox#12081

Merged
viyatb-oai merged 23 commits intomainfrom
codex/viyatb/fix-12056-bwrap-dev
Feb 19, 2026
Merged

fix(linux-sandbox): mount /dev in bwrap sandbox#12081
viyatb-oai merged 23 commits intomainfrom
codex/viyatb/fix-12056-bwrap-dev

Conversation

@viyatb-oai
Copy link
Copy Markdown
Collaborator

@viyatb-oai viyatb-oai commented Feb 18, 2026

Summary

  • Updates the Linux bubblewrap sandbox args to mount a minimal /dev using --dev /dev instead of only binding /dev/null. tools needing entropy (git, crypto libs, etc.) can fail.

  • Changed mount order so --dev /dev is added before writable-root --bind mounts, preserving writable /dev/* submounts like /dev/shm

Why

Fixes sandboxed command failures when reading /dev/urandom (and similar standard device-node access).

Fixes #12056

Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bd344ee51e

ℹ️ 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".

if let Some(first_missing) = find_first_non_existent_component(&subpath)
&& is_within_allowed_write_paths(&first_missing, &allowed_write_paths)
{
args.push("--ro-bind".to_string());
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this inside this loop?

Copy link
Copy Markdown
Collaborator Author

@viyatb-oai viyatb-oai Feb 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For each read-only path, this is adding its own --ro-bind ... protection.

--ro-bind /dev/null /repo/.git
--ro-bind /dev/null /repo/.codex

@viyatb-oai viyatb-oai merged commit 4fe99b0 into main Feb 19, 2026
33 checks passed
@viyatb-oai viyatb-oai deleted the codex/viyatb/fix-12056-bwrap-dev branch February 19, 2026 07:27
@github-actions github-actions bot locked and limited conversation to collaborators Feb 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow access of /dev/urandom from bubblewrap sandbox

2 participants