Skip to content

v1.91.321.0 ci(free-tests): grant user namespaces to the bundled Chromium on runner image 20261026 - #3616

Merged
capy-ai[bot] merged 3 commits into
mainfrom
capy/gst131-chromium-userns
Oct 29, 2026
Merged

capy-ai[bot] merged 3 commits into
mainfrom
capy/gst131-chromium-userns

Conversation

@garrytan

@garrytan garrytan commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3616,
  "head": "cbc09f669983ac6ca5141490df3f72ea90c72fb0",
  "version": "1.91.320.0",
  "base": "main",
  "gate": {
    "touched-tests": {
      "pass": 7,
      "fail": 0,
      "skip": 0
    },
    "remote-pregate": {
      "pass": 10111,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "7fc12d6f133a7a6ea7b5060ef0c501e26f61fe60",
  "product_patch_id": "38d583d4a64f723b526a58a0f3fe9befd7a9a084",
  "gstack_version": "1.91.319.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 30,
    "rules": "9bc0e4d2f74ef6b4",
    "base": "319ef500ca2ff1294e0e08e90afef94d75222367",
    "registry": "319ef500ca2ff1294e0e08e90afef94d75222367",
    "gate_scan": {
      "tagged": 0,
      "head": "cbc09f669983ac6ca5141490df3f72ea90c72fb0"
    },
    "reasons": [
      "gate-class",
      "runtime=30<=50"
    ]
  },
  "pregate": "requires-remote cleared @7fc12d6f133a (1 checks, current for cbc09f669983)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/40924876102",
    "windows-free-tests.yml/windows-free-shard: https://github.com/garrytan/gstack/actions/runs/40924876138",
    "pregate.json/remote_gate: remote-gate tree=7fc12d6f133a tests=10111"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/ (TESTING_INTERNALS Ubicloud runner sections, troubleshooting), README.md, CONTRIBUTING.md, CLAUDE.md, AGENTS.md, CHANGELOG.md"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 3,
    "fixed": 0,
    "scope": "frozen",
    "est_input_tokens": 9232,
    "dispatches": {
      "adversarial-native": 1,
      "outside-voice": 1
    }
  }
}

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's unprivileged_userns and 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:

FATAL:sandbox/linux/services/credentials.cc:131] Check failed: . : Permission denied (13)

Fix. After the existing SUID-helper step, both Linux jobs that launch Chromium (free-suite, quick-bun-default) now load an AppArmor profile that grants userns to the resolved Playwright Chromium binary only. This is the shape of Ubuntu's own chrome profile. The kernel restriction stays on for everything else, the SUID helper step is unchanged, and no --no-sandbox or sysctl is involved, so test/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):

Before (main) After (this branch)
Steps before the suite Playwright install, SUID sandbox helper Playwright install, SUID sandbox helper, AppArmor userns grant for the resolved Chromium binary
Image 20261026.1.0 (3 AppArmor profiles) cookie-import pipe smoke fails: credentials.cc:131 Permission denied (9 of 9 jobs) profile loads (apparmor_parser exit 0) and the whole file passes (9 of 9); unloading it brings the failure back
Image 20261021.1.0 (123 profiles) passes passes; the extra profile loads beside Ubuntu's (8 of 8)
Kernel userns restriction on on for every other binary
--no-sandbox, sysctl none none

Why

"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 in test/chromium-sandbox-ci.test.ts.

Approvals

Date Asked Exact words Outcome Covers Still pending
2026-10-29 Merge #3616 when green “yes merge when green” (Garry, 2026-10-16 (GStack Minder crew rule 6)) standing approval every crew PR, merged by GStack Minder through a train none
2026-10-29 Remote pregate spend on Ubicloud for #3616 (cap $2) “it's fine run as many $93 paid gates as you want who cares” (Garry, 2026-10-15 (GStack Minder crew rule 5)) standing approval gates and focused paid runs, lane cap $10 per PR none

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 userns profile 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.ts gains four cases, two per job. Each runs the real step with stubbed bun/sudo and checks the step order, the exact profile bytes and the apparmor_parser -r call, the absence of protection-lowering flags, and the refusal of an outside path. The new cases fail against main's workflow.

Test Coverage

free-tests.yml "Let the bundled Chromium create its sandbox namespaces" (free-suite, quick-bun-default)
├─ resolved path under ~/.cache/ms-playwright → tee profile + apparmor_parser -r ── [★★★ chromium-sandbox-ci: exact bytes + call order, per job]
├─ step order: after SUID helper, before the suite ── [★★ chromium-sandbox-ci: index assertions, per job]
├─ no --no-sandbox / sysctl / apparmor_restrict ── [★★ chromium-sandbox-ci: regex negative, per job]
└─ unexpected path → exit non-zero, no sudo call ── [★★★ chromium-sandbox-ci: refusal case, per job]
Kernel acceptance of the profile: live only (run 40921806393; this PR's free-suite cookie-import smoke)
COVERAGE: 4/4 paths (100%), weak 0, gaps 0

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.

  • INFORMATIONAL .github/workflows/free-tests.yml:292 The 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.
  • INFORMATIONAL .github/workflows/free-tests.yml:300 The 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.
  • INFORMATIONAL test/chromium-sandbox-ci.test.ts:94 sudo 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 in quick-bun-default and free-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 because setup-free-suite.sh turns the restriction off with its own sysctl.
  • README.md: current. The local advice to set GSTACK_CHROMIUM_NO_SANDBOX=1 is 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.md would be a minor addition. Diagram drift: none.

Test plan

  • bun test test/chromium-sandbox-ci.test.ts: 7 pass, 0 fail
  • Remote pregate (gstack-pregate --stage tests --remote --spend-cap 2): 10111 tests, 0 failed, $0.06, tree 7fc12d6
  • bun run typecheck, bun run typecheck:test (814 known diagnostics, none new), actionlint 1.7.11: pass
  • Free Tests 40924876102 and Windows Free Tests 40924876138 at cbc09f6: success

Open in Capy

…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>
@trunk-io

trunk-io Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 2 commits October 29, 2026 17:48
…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>
@github-actions github-actions Bot changed the title ci(free-tests): grant user namespaces to the bundled Chromium on runner image 20261026 v1.91.321.0 ci(free-tests): grant user namespaces to the bundled Chromium on runner image 20261026 Oct 29, 2026
@capy-ai
capy-ai Bot merged commit 057bac8 into main Oct 29, 2026
62 of 63 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.

1 participant