Repository navigation
fix(update): restore survivor auto-auth restart proof - #159498
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 27, 2026, 5:16 AM ET / 09:16 UTC (Revision 6). ClawSweeper reviewWhat this changesThe branch places the Docker upgrade test’s simulated Gateway service in a private Linux cgroup and reports its membership during automatic authenticated restart, with regression coverage. Merge readiness✅ Ready for maintainer review Keep this PR open. Current main still supplies an empty cgroup for a live simulated Gateway, so the merged native-membership guard prevents the published upgrade lane from proving automatic restart. The branch has direct final-head upgrade evidence, and the coordinator accepted the documented Docker-fixture security tradeoff. Priority: P2 Review scores
Verification
How this fits togetherThe upgrade-survivor Docker lane starts a published OpenClaw install, updates it to a candidate, and checks that the Gateway and its state survive. A simulated systemd user manager supplies service facts to the candidate updater’s native membership check. flowchart LR
A[Published OpenClaw install] --> B[Docker upgrade lane]
B --> C[Private service cgroup]
C --> D[Simulated systemd manager]
D --> E{Native membership check}
E --> F[Candidate restart]
F --> G[Gateway and state probes]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +96, Other +49. Total +145 across 6 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep the production membership guard and land the fixture-owned containment repair so published-driver-to-candidate upgrades continue to verify restart safety. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source supplies an empty cgroup for the live fixture while the candidate’s Linux guard requires one, giving a specific published-2026.9.6-to-candidate auto-auth reproduction path. I did not execute it in this read-only checkout. Is this the best way to solve the issue? Yes. Supplying native facts at the simulated systemd owner is narrower than weakening the production guard, and the branch preserves the existing restart assertions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 023af0d31935. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Coordinator decision for this prepared head ( The coordinator ACCEPTS the documented trusted-fixture boundary; no separate syscall-filter work is required. The auto-auth fixture runs only in the upgrade-survivor Docker lane (CI docker-seed job, Testbox, manual dispatch). Fork PRs run that job on ephemeral GitHub-hosted runners without repository secrets, where the same PR code already executes directly on the runner in other steps, so a broader in-container syscall filter grants no capability an attacker lacks; member PRs are trusted code. After setup the payload drops all capabilities (empty bounding, inheritable, and ambient sets), sets no_new_privs, and restores the docker-default AppArmor profile, so the SYS_ADMIN-selected seccomp allowances are not usable for privileged operations. The fixture proves native membership and updater survival, not hostile-code isolation within one account. The decision is recorded in the PR body and validated READY review artifact. Native preparation succeeded, both required upgrade lanes passed, and the head's CI passed. No code changes were made for this acceptance. |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
* fix(update): give survivor restart fixtures native cgroup membership * fix(update): restore survivor payload confinement after setup
What Problem This Solves
Fixes the published upgrade-survivor auto-auth lane refusing its candidate-driven recovery update with
service-membership-unverifiedafter #158314. Both manager shims reported a live Gateway PID with an emptyControlGroup.User Impact
No production behavior change. Production LOC delta is 0. The native membership guard still refuses running services with missing or unreadable containment evidence and still ignores inherited service markers as proof of membership.
Update behavior is unchanged for shipped 2026.9.x drivers. In particular, v2026.9.6 does not contain
service-process-membership.ts; it drives the first hop before the candidate is installed. The failing recovery hop is driven by the installed candidate, which contains the newer guard. This harness-only fix supplies real native facts to that hop; it does not patch an already-running shipped updater or change its post-swap contracts.Why This Change Was Made
Systemd legitimately returns an empty
ControlGroupfor a drained inactive or failed unit. Its shared user/system manager property getter returns the cached cgroup path, with null meaning no cgroup. Inactive/failed transitions prune it, while lingering processes or unreadable emptiness retain it. A running Gateway is placed in a cgroup before spawning. Active/exited oneshot units can also have no cgroup; active alone is not sufficient evidence.OpenClaw already bypasses this guard for a nonrunning service without a PID. On macOS the guard uses live process groups and
launchctl print pid/<pid>resource coalitions, not a unit cgroup; stopped jobs have no PID, and unavailable live membership stays unknown. Therefore this repair belongs to the fixture.Auto-auth containers now create a private cgroup subtree, drop setup capabilities, and move the ExecStart shell into it before launching the Gateway. Both manager adapters report the same native cgroup while it owns work and report an empty value once settled. Cgroup population also prevents surviving descendants from being mistaken for a stopped service. The restart/replacement assertions remain intact. This requires cgroup v2 and Docker's private cgroup namespace.
SYS_ADMINis used only for initial remount and removed before the scenario; the host hierarchy is never bind-mounted. A credential-free, network-disabled container first ensures Docker has loadeddocker-default. The bootstrap requests that profile on exec, drops all capability sets, and verifies the payload is underdocker-default (enforce)on AppArmor hosts. Docker's capability-dependent seccomp configuration is not claimed to be identical to a stock container.Evidence
pnpm test test/scripts/upgrade-survivor-systemd-cgroup.test.ts --maxWorkers=1: 3 passed, final command wall 10.86 s, test execution under 50 ms; Linux CI: 0.012 s test time. No added processes, timers, or sleeps.pnpm test test/scripts/upgrade-survivor-systemd.test.ts --maxWorkers=1: 14/15 passed, 152.73 s wall. Same-order replay: 14/15 passed, 156.31 s wall, failing a different loaded-runtime read. Initial failure wasbinds installation paths ... custom=false(expected stopped, got unknown); replay failure was stopped-state inspection after the terminal/restart lifecycle test. Isolated initial case passed (96.41 s wall). Host load/deadline sensitivity is suspected but not proven; no timeouts, assertions, or baselines were weakened, and a passing replay is not claimed as a fix.pnpm update:compat:check: passed for all pinned 2026.9.1–2026.9.6 lazy-import inventories.git diff --check: passed.36301916281failed inupgrade-survivor-plugin-registry.test.tsbecause its direct auto-auth case still asserted no--useroption; downstream jobs were canceled. The correction verifies root setup, a private cgroup namespace, and the setup-before-timeout command, while retaining manual-mode assertions for no added user/capability/security options. Full file: 42 passed, 110.29 s wall on macOS; follow-up focused shell cases after the confinement change: 3 passed, 8.04 s wall. This existing process-heavy shell-contract suite runs both Bash variants on macOS; the existing shell-process fixture is reused, with no new test cases or timers. Linux CI corrected file: 38 passed, 13.215 s test time (job 74 s including setup).tbx_01m3gt8p7xqethj5bw799f5jbw; unprivileged child with setup capabilities dropped observed0::/openclaw-gateway.service, thenpopulated 0after exit. Lease stopped.tbx_01m3gvknbbdqy25325dt734bm4(stopped)5ef7f2782b1e; recovery restart replaced supervisor, final probes passedtbx_01m3gyjbqezycyjkbt4p32c9v8(stopped)Review disposition
The persistent AppArmor reduction finding is accepted and fixed in
5ef7f2782b1e; the exact-head auto-auth lane passed. Its retained tail does not include the profile-label line, so separate live AppArmor enforcement proof is not claimed. The claimed same-user cgroup-containment violation is rejected: this fixture models a systemd user manager.[email protected]delegates the user's subtree, andcg_set_accessassigns that user the writable migration files. Kernel migration rules therefore allow deliberate movement inside that delegated subtree on real hosts too. The production guard proves current membership and protects updater survival across ordinary reparenting/detachment; it does not impose an adversarial same-UID isolation boundary. OpenClaw's operator trust model uses separate OS users/hosts for adversarial isolation. Moving a Gateway outside its reported cgroup continues to fail native validation.Coordinator decision — accepted trusted-fixture boundary
The coordinator ACCEPTS the documented trusted-fixture boundary; no separate syscall-filter work is required. The auto-auth fixture runs only in the upgrade-survivor Docker lane (CI docker-seed job, Testbox, manual dispatch). Fork PRs run that job on ephemeral GitHub-hosted runners without repository secrets, where the same PR code already executes directly on the runner in other steps, so a broader in-container syscall filter grants no capability an attacker lacks; member PRs are trusted code. After setup the payload drops all capabilities (empty bounding, inheritable, and ambient sets), sets no_new_privs, and restores the docker-default AppArmor profile, so the SYS_ADMIN-selected seccomp allowances are not usable for privileged operations. The fixture proves native membership and updater survival, not hostile-code isolation within one account.
Release note: none (internal test harness). Both required lanes passed: manual on
972300e9eab3(unchanged path), and auto-auth again on final head5ef7f2782b1e. Provider portal synchronization timed out after successful receipts and confirmed lease stops. CI run 36304868208 and the requiredopenclaw/ci-gatepassed. The tooling dependency mismatch was resolved by its owner. Native review and preparation are being refreshed to record the coordinator's acceptance; no code changes are authorized or needed.