Repository navigation
Treat userns-unmapped root ancestors (uid 65534) as root-owned in cso (CHE-8998) [squash] - #8
Merged
Conversation
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.
Fixes the Codex-sandbox
cso startfailureUNSAFE_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 exportedunmappedRootInUserNamespace(uid). True only for uid 65534, on Linux, when/proc/self/uid_mapis not the initial0 0 4294967295(unreadable map = false).ensureDirectoryaccepts 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 realbwrap --unshare-userrun ofsecureDirectoryunder/var/tmp.Test
bun test test/cso-state-userns.test.ts-> 5 pass, 0 fail (1 non-Linux skip).Without the
ensureDirectorychange the bwrap case fails withUNSAFE_PATH: Private state ancestor has an unexpected owner(checked).bun test test/cso-eval.test.ts-> 69 pass (one run hit a flakygit inittimeout, rerun green).cso-snapshot-stateandcso-audit-pathsfail identically on the base commit in this checkout (nonode_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.