Repository navigation
v1.91.321.0 ci(free-tests): grant user namespaces to the bundled Chromium on runner image 20261026 - #3616
Merged
Conversation
…er image 20261026 Runner image 20261026.1.0 keeps kernel.apparmor_restrict_unprivileged_userns=1 but loads only three AppArmor profiles, so Chromium's namespace sandbox aborts (credentials.cc:131 Permission denied) and the cookie-import-native pipe smoke fails on every job that lands on it. Load a scoped AppArmor profile granting userns to the resolved Playwright Chromium only, in both Linux jobs that set up the sandbox helper. The kernel restriction and the SUID helper stay as they are. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
10 tasks done
…nner image 20261026 Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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.
What changed
Free Tests started failing on every job that lands on Ubicloud runner image 20261026.1.0. The failure is in
browse/test/cookie-import-native.test.ts("real synthetic Playwright pipe smoke"), it fails in-shard and again on the serial retry, and a rule-16 rerun passes only if it happens to land on the older 20261021.1.0 image. Main is about to go red the same way.Cause. Both images set
kernel.apparmor_restrict_unprivileged_userns=1. 20261021 loads 123 AppArmor profiles, including Ubuntu'sunprivileged_usernsand browser profiles. 20261026 loads three. With the restriction on and no profile,unshare(CLONE_NEWUSER)is denied, and Chromium's namespace sandbox aborts before the SUID helper is consulted:Fix. After the existing SUID-helper step, both Linux jobs that launch Chromium (
free-suite,quick-bun-default) now load an AppArmor profile that grantsusernsto the resolved Playwright Chromium binary only. This is the shape of Ubuntu's ownchromeprofile. The kernel restriction stays on for everything else, the SUID helper step is unchanged, and no--no-sandboxorsysctlis involved, sotest/chromium-sandbox-ci.test.ts's "without disabling protections" contract still holds. The path guard is the same as the helper step's: an unexpected Chromium location is refused before any privileged call.CI wiring only, no UI, so the before/after is one Linux free-suite job (diagnostic dispatch 40921806393):
usernsgrant for the resolved Chromium binarycredentials.cc:131 Permission denied(9 of 9 jobs)apparmor_parserexit 0) and the whole file passes (9 of 9); unloading it brings the failure back--no-sandbox,sysctlWhy
"Free Tests started failing on every job that lands on Ubicloud runner image 20261026.1.0" (GST-131, S1), so every PR head and soon main went red on a test nobody touched. Now the bundled Chromium gets the one permission the new image stopped granting, and Free Tests is green on both images without turning the sandbox off.
Blast radius
The step runs only in the two Linux jobs that already install Playwright's Chromium and its SUID helper (
free-suite,quick-bun-default); macOS, Windows and paid jobs are untouched. The profile attaches to the one resolved path under~/.cache/ms-playwright, so nothing else on the runner gains user namespaces, and on the older image it loads beside Ubuntu's profiles without replacing them. Evidence rung: script ran, live on both images in run 40921806393 (17 jobs), plus the four stubbed-sudo cases intest/chromium-sandbox-ci.test.ts.Approvals
Source: gstack-approvals record for capy/gst131-chromium-userns (display only; not an approval citation).
Summary
A runner image change removed the AppArmor profiles that let Chromium build its sandbox, so the cookie-import smoke crashed on every job that landed there. Both Linux Chromium jobs now load a one-binary
usernsprofile after the SUID helper, the way Ubuntu's own chrome profile does, with tests pinning the step's order, bytes and path refusal. The branch also adds the CHANGELOG[Unreleased]entry the train stamps at the slot.Evidence
Diagnostic dispatch 40921806393, on a throwaway branch, ran 17 jobs. All 9 on 20261026 failed the smoke before the profile, passed the whole file with it, and failed again after it was unloaded. All 8 on 20261021 passed throughout.
Tests
test/chromium-sandbox-ci.test.tsgains four cases, two per job. Each runs the real step with stubbedbun/sudoand checks the step order, the exact profile bytes and theapparmor_parser -rcall, the absence of protection-lowering flags, and the refusal of an outside path. The new cases fail against main's workflow.Test Coverage
Tests: 3 → 7 in
test/chromium-sandbox-ci.test.ts(+4 new)Coverage: 100% value-weighted (100% including 0 weakly covered paths)
Test value: 4 tests written, 0 rejected by the authoring gate, 0 existing tests extended, 0 paths weakly covered (weak = ★, gate-failing or unrated).
Tests ran: touched-tests 7
Tests ran: remote-pregate 10111
Tests ran: typecheck count unavailable
Tests ran: typecheck-test count unavailable
Tests ran: actionlint count unavailable
Pre-Landing Review
No issues at the blocking floor; three informational notes below, not fixed (crew rule 30a).
REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=3 fixed=0 scope=frozen dispatches=3 est_input_tokens=9232
Gate edits: none detected (3 listed, 0 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Outside review: openai/gpt-6.1-sol (Capy subagent), completed, NO FINDINGS. Native adversarial: completed, 2 informational.
Review notes
Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.
.github/workflows/free-tests.yml:292The new step's comment says runner image 20261026.1.0 loads no AppArmor profiles; it loads three (none for Chromium), as the CHANGELOG and PR evidence say. Same text at :416..github/workflows/free-tests.yml:300The case guard's * also matches '/', spaces and AppArmor glob characters, and the resolved path is written into the profile unquoted; a path with *, { or [ would widen the attachment. The path comes from Playwright via realpath and is not attacker-controlled; the existing helper guard has the same pattern. Same at :424.test/chromium-sandbox-ci.test.ts:94sudo is stubbed, so the new cases prove step order, profile bytes, the parser call and the path refusal, not that the kernel accepts the profile; kernel acceptance is proven only by diagnostic run 40921806393 and the CI cookie-import smoke itself.Exploratory QA
No product surface changed (CI workflow and its test). The smoke is the CI run itself: this head's free-suite cookie-import-native job on image 20261021.1.0 (
free-suite (10), which needs no fix); the new step itself ran green on 20261026.1.0 inquick-bun-defaultandfree-suite (21), neither of which runs that file.Design Review
No frontend files changed — design review skipped.
Eval Results
No prompt-related files changed — evals skipped.
Greptile Review
No Greptile comments.
Plan Completion
No plan file: S1 incident fix (GST-131) under GStack Minder's urgent single-PR train.
Verification Results
Diagnostic dispatch 40921806393 (17 jobs, both images): PASS. This head's Free Tests and Windows Free Tests: Free Tests 40924876102 success, Windows Free Tests 40924876138 success (all 45 scheduled checks green, 0 failed, 0 pending).
TODOS
No TODO items completed in this PR.
Documentation
Status: current. No edits needed for this CI-only change.
Scope: the diff against 319ef50 (
.github/workflows/free-tests.yml,test/chromium-sandbox-ci.test.ts,CHANGELOG.md). There were no staged, unstaged or new files. I searched the docs for Chromium sandbox, userns, AppArmor and cookie-import-native mentions.Documentation health
docs/TESTING_INTERNALS.md: current. The Ubicloud runner paragraphs (setuid helper, AppArmor userns) are still correct becausesetup-free-suite.shturns the restriction off with its ownsysctl.README.md: current. The local advice to setGSTACK_CHROMIUM_NO_SANDBOX=1is unaffected.docs/troubleshooting.md: current. Its local AppArmor fixes are unaffected.CONTRIBUTING.md: current. It doesn't list free-tests job steps.CHANGELOG.md: not edited; it belongs to the parent.Coverage debt: the new AppArmor step is CI infrastructure with no public surface. It's explained only by the workflow comment and the CHANGELOG entry, so a sentence in
docs/TESTING_INTERNALS.mdwould be a minor addition. Diagram drift: none.Test plan
bun test test/chromium-sandbox-ci.test.ts: 7 pass, 0 failgstack-pregate --stage tests --remote --spend-cap 2): 10111 tests, 0 failed, $0.06, tree 7fc12d6bun run typecheck,bun run typecheck:test(814 known diagnostics, none new), actionlint 1.7.11: pass