Skip to content

Fix drop-sudo socket ACL verification on Ubuntu 26.04 - #192

Merged
bolinfest merged 5 commits into
mainfrom
codex/acl-aware-socket-check
Nov 16, 2026
Merged

bolinfest merged 5 commits into
mainfrom
codex/acl-aware-socket-check

Conversation

@ww-oai

@ww-oai ww-oai commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Ubuntu 26.04’s /usr/bin/test -w reports a mode-0666 socket as writable even when a named-user ACL denies the runner access. That makes drop-sudo stop at the D-Bus socket after successfully applying the ACL.

Use Node’s fs.access(..., W_OK) on the pinned socket descriptor. Keep setpriv to run the probe with each runner identity. The existing integration tests now use Bash’s ACL-aware builtin for their independent permission assertions.

Reproduced the D-Bus failure on main in an Ubuntu 26.04.1 container and verified that the updated bundle completes against the same socket. TypeScript passed. All 182 tests passed in the container, including the privileged drop-sudo scenarios.

Fixes #188.

@ww-oai
ww-oai marked this pull request as ready for review November 13, 2026 19:02
Comment thread src/dropSudo.ts
]),
];

for (const identity of identityGroups) {

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.

I feel like this could benefit from a comment to explain the test strategy.

Comment thread src/dropSudo.ts Outdated
const LINUX_O_PATH = 0o10000000;

// Some implementations of `test -w` only inspect mode bits and miss POSIX ACLs.
const CHECK_SOCKET_WRITE_ACCESS = `

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.

While I generally favor pulling constants at the top of a file, I think this one might make more sense to declare just before for (const identity of identityGroups) {.

Comment thread src/dropSudo.ts Outdated
const LINUX_RUNTIME_DIRECTORY = "/run";
const LINUX_O_PATH = 0o10000000;

// Some implementations of `test -w` only inspect mode bits and miss POSIX ACLs.

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.

I don't know that this reference to test -w makes sense going forward because the context will be lost once those lines of code are deleted?

Comment thread test/dropSudo.test.mjs
canTestLinuxIsolation &&
spawnSync("/usr/bin/setfacl", ["--version"], { stdio: "ignore" }).status === 0;

// Bash's builtin checks effective access, including named-user and group ACLs.

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.

Please update the comment to describe the intention behind this code.

Comment thread test/dropSudo.test.mjs
@@ -25,6 +25,9 @@ const canTestSocketAcls =
canTestLinuxIsolation &&

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.

Also, does CI run these tests on multiple versions of Ubuntu? It feels like we should at least test on 24 and 26?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Yeah, I'll switch to a runner matrix for CI here.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Done, and fixed the sudo -E issue that this revealed.

Comment thread .github/workflows/ci.yml
os:
- ubuntu-24.04
- ubuntu-26.04
- ubuntu-latest

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Noting: this is currently the same as ubuntu-26.04, but I think it makes sense to have a matrix entry for the -latest alias as well since it floats.

Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Comment thread src/runCodexExec.ts
env.USER = user.username;
env.LOGNAME = user.username;
for (const name of [
"ENV", "BASH_ENV", "SHELLOPTS",

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.

Are we running Prettier in this repo? This formatting seems odd to me.

@bolinfest bolinfest left a comment

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.

Thanks so much for fixing this! I'll look into setting up Prettier afterwards.

@bolinfest
bolinfest merged commit 306c6a1 into main Nov 16, 2026
5 checks passed
sahandilshan added a commit to sahandilshan/thunder that referenced this pull request Nov 17, 2026
ubuntu-latest now resolves to ubuntu-26.04, where codex-action v1.13 stops in its drop-sudo setup ("Could not restrict access to /run/dbus/system_bus_socket") and sudo ignores -E, so Codex would also lose CODEX_HOME and the cache settings. v1.14 (openai/codex-action#192) checks socket access with fs.access and passes the environment on stdin.

Signed-off-by: Sahan Dilshan <[email protected]>
benbrandt added a commit to agentclientprotocol/codex-acp that referenced this pull request Nov 19, 2026
## Summary

The [scheduled Codex
update](https://github.com/agentclientprotocol/codex-acp/actions/runs/44316562515)
installs Codex and regenerates the app-server types, then fails before
pushing a branch or opening a PR. On Ubuntu 26.04, `codex-action`
v1.13's `drop-sudo` probe incorrectly reports that the runner can still
write to the D-Bus socket after its access has been denied.

Pin `openai/codex-action` to v1.14, which includes the [upstream
fix](openai/codex-action#192). This keeps the
existing runner and privilege restrictions in place.

## Validation

- `actionlint .github/workflows/codex-update.yml` and `git diff --check`
passed locally.
- Upstream's fix passed its Ubuntu 26.04 verification. After merging,
dispatch a fresh **Codex Update** run on `main` to confirm that it opens
the dependency update PR.
github-actions Bot pushed a commit to gccammelli/meowstache that referenced this pull request Nov 19, 2026
…4) (#40)

The nightly Upstream Android repair job has failed since the runner image
moved to Ubuntu 26.04: drop-sudo could not verify the socket ACL. v1.14
carries the fix (openai/codex-action#192).

Co-authored-by: Claude Sonnet 5.5 <[email protected]>
ua741 added a commit to ente/ente that referenced this pull request Nov 20, 2026
The Dependabot follow-up job has failed on every run since 2026-11-13.
Its Codex step runs on ubuntu-latest, now Ubuntu 26.04, where Codex
Action v1.13's drop-sudo step fails with `Could not restrict access to
/run/dbus/system_bus_socket` before Codex starts. Codex review and the
security review were pinned to Ubuntu 24.04 for the same bug (#14528,
#14533); this job was missed.

Codex Action v1.14
([openai/codex-action#192](https://redirect.github.com/openai/codex-action/pull/192))
fixes the check: on 26.04 `test -w` ignores the socket ACL, so v1.14
uses Node's `fs.access`. This bumps only this workflow and updates
`actions.lock` with `gh actions-lock`. The action's repository identity
and its transitive setup-node pin are unchanged from v1.13. v1.14 was
released on 2026-11-16, so this is ahead of the 7-day Dependabot
cooldown.

This job is the Ubuntu 26.04 check for v1.14. After merge, dispatch it
on main and confirm the drop-sudo steps pass and Codex runs with the
`update` profile from `CODEX_HOME`. If it does, a follow-up moves Codex
review and the security review to v1.14 and back to ubuntu-latest. `gh
actions-lock --verify`, the workflow security check and the repo checks
pass locally.

[Pilot PR](https://redirect.github.com/neeraj-pilot/ente/pull/353)

Co-authored-by: Neeraj Gupta <[email protected]>
Stephan202 added a commit to PicnicSupermarket/error-prone-support that referenced this pull request Nov 20, 2026
`openai/codex-action` v1.14 fixes the `drop-sudo` step on that image, so
the `ubuntu-24.04` workaround from #2457 is no longer needed.

See:
- openai/codex-action#188
- openai/codex-action#192
jkomyno added a commit to ComposioHQ/composio that referenced this pull request Nov 20, 2026
- Pin the changelog-to-docs workflow to `openai/codex-action` v1.14. The
November 19 run failed on Ubuntu 26.04 while checking access to the
system D-Bus socket. [Failed
run](https://github.com/ComposioHQ/composio/actions/runs/44481707782)
- v1.14 contains the upstream fix for that exact error and keeps the
workflow's `workspace-write` setting. [Upstream
fix](openai/codex-action#192)

## Verification

- Verified the pinned SHA against the upstream v1.14 tag. The upstream
test suite passed on Ubuntu 26.04. [Upstream
CI](https://github.com/openai/codex-action/actions/runs/43900570479/job/133415711392)
- Passed `git diff --check` and workflow syntax validation. ShellCheck
diagnostics match `next`.
- The next eligible changelog push to `next` will exercise the updated
Codex step in this repository.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

drop-sudo fails on Ubuntu 26.04

3 participants