Skip to content

fix(test): hand E2E evidence back to the right user under rootless Docker - #87

Merged
yashranaway merged 1 commit into
mainfrom
t3code/rootless-evidence
Aug 6, 2026
Merged

fix(test): hand E2E evidence back to the right user under rootless Docker#87
yashranaway merged 1 commit into
mainfrom
t3code/rootless-evidence

Conversation

@yashranaway

Copy link
Copy Markdown
Collaborator

Found while getting the Linux E2E running locally on a rootless Docker daemon.

Symptom

The E2E passes — including Chromium's nested namespace sandbox, which is the part worth knowing works — but the run then dies on its own manifest:

Linux P2 end-to-end flow passed
sha256sum: SHA256SUMS: No such file or directory

The evidence was all there, owned by an id the invoking user cannot read.

Cause

The container writes evidence as its own non-root user, and restore_evidence_owner chowns it back to $(id -u) from inside the container. That is correct only under the uid-for-uid mapping of a rootful daemon — the one CI uses, which is why this never surfaced.

Rootless inverts the mapping. Measured on this machine:

Container uid Host uid
root (0) 1004 — the invoking user
headless (10001) 372144 — an unreadable subuid

So chowning to 1004 inside the container lands on another subuid rather than the caller.

Fix

Detect the daemon mode and chown to 0:0 when rootless. Rootful behaviour, and therefore CI, is unchanged — the else branch is exactly what ran before.

Verified

On rootless, before: evidence owned by 372144, sha256sum -c fails. After: owned by the invoking user, 0600 intact, sha256sum -c passes, and the suite's own file-mode assertions still hold. Full run is 1m11s warm.

Worth stating plainly: I cannot verify the rootful path locally — this machine has no rootful daemon. That path is unchanged code, and CI exercises it on every run of this PR, which is the evidence for it.

CONTRIBUTING.md now notes that rootless is supported, since it is a reasonable default on shared machines where the docker group is effectively passwordless root.

…cker

The Linux E2E passes under rootless Docker, but its evidence came back
unreadable, and the run ended on sha256sum failing to open the manifest it had
just written.

The container writes evidence as its own non-root user. restore_evidence_owner
chowned that back to $(id -u) from inside the container, which is correct only
because rootful Docker maps uid to uid — the mapping CI runs under, which is
why this was never noticed. Rootless inverts it: container root maps to the
invoking user, and every other container id maps to a subuid the user cannot
read. Chowning to 1004 there produces another subuid, not the caller.

Detect the daemon mode and chown to 0:0 when rootless. Rootful behaviour, and
therefore CI, is unchanged.

Verified locally on rootless: evidence lands owned by the invoking user with
0600 intact, sha256sum -c passes, and the suite's own mode assertions still
hold. CONTRIBUTING notes that rootless is supported.
@yashranaway
yashranaway requested a review from SarthakWade August 6, 2026 09:40
@yashranaway
yashranaway merged commit 9ddc6d7 into main Aug 6, 2026
7 checks passed
@yashranaway
yashranaway deleted the t3code/rootless-evidence branch August 6, 2026 09:43
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.

1 participant