Skip to content

Treat userns-unmapped root ancestors (uid 65534) as root-owned in cso (CHE-8998) [squash] - #8

Merged
congvc-bot-x99[bot] merged 1 commit into
mainfrom
che-8998-cso-userns-unmapped-root
Nov 22, 2026
Merged

congvc-bot-x99[bot] merged 1 commit into
mainfrom
che-8998-cso-userns-unmapped-root

Conversation

@congvc-bot-x99

Copy link
Copy Markdown

Fixes the Codex-sandbox cso start failure UNSAFE_PATH: Private state ancestor has an unexpected owner. Issue: CHE-8998 (replaces CHE-2791; original local patch CHE-2343).

Change

  • lib/cso/state.ts: new exported unmappedRootInUserNamespace(uid). True only for uid 65534, on Linux, when /proc/self/uid_map is not the initial 0 0 4294967295 (unreadable map = false). ensureDirectory accepts such ancestors as root-owned. The group/world-writable check is unchanged.
  • test/cso-state-userns.test.ts: unit cases (non-initial map accepted, initial map rejected, other uids rejected, unreadable map rejected) plus a real bwrap --unshare-user run of secureDirectory under /var/tmp.

Test

bun test test/cso-state-userns.test.ts -> 5 pass, 0 fail (1 non-Linux skip).
Without the ensureDirectory change the bwrap case fails with UNSAFE_PATH: Private state ancestor has an unexpected owner (checked).
bun test test/cso-eval.test.ts -> 69 pass (one run hit a flaky git init timeout, rerun green). cso-snapshot-state and cso-audit-paths fail identically on the base commit in this checkout (no node_modules; 74 and 9 failures before and after), so they say nothing about this change.

Risk

A real host nobody (65534) owned ancestor is still rejected because the host map is the initial one.

@congvc-bot-x99
congvc-bot-x99 Bot marked this pull request as ready for review November 22, 2026 11:37
@congvc-bot-x99 congvc-bot-x99 Bot changed the title fix(cso): treat userns-unmapped root ancestors (uid 65534) as root-owned (CHE-8998) [squash] Treat userns-unmapped root ancestors (uid 65534) as root-owned in cso (CHE-8998) [squash] Nov 22, 2026
@congvc-bot-x99
congvc-bot-x99 Bot merged commit 2b471c6 into main Nov 22, 2026
52 of 55 checks passed
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.

0 participants