gvisor demos: per-unit rootfs skeleton (spec rev 5.3, ruling R-T2b)
Root runner 20261108T215912-02c7df: the gofer mkdirs missing bind targets inside the host rootfs, so a shared empty read-only rootfs fails under ProtectSystem=strict and is modified without it. Root now prepares a per-unit skeleton with every target; overlay mode is fixed by measurement, never the default self store.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed,
+34
−1
docs/superpowers/plans/2026-11-08-gvisor-demos.md+14 −0docs/superpowers/specs/2026-11-08-gvisor-demos-design.md+20 −1
CI failed — run details
Intent
diff --git a/docs/superpowers/plans/2026-11-08-gvisor-demos.md b/docs/superpowers/plans/2026-11-08-gvisor-demos.md| index c6484abbc..4fde335c8 100644 |
| --- a/docs/superpowers/plans/2026-11-08-gvisor-demos.md |
| +++ b/docs/superpowers/plans/2026-11-08-gvisor-demos.md |
| @@ -552,3 +552,17 @@ Task 3's installer, verifier, cache and garbage collection operate on the set |
| (all-or-nothing install by directory rename). Task 10's cut helper emits five assets |
| per platform and the console mirrors each present member. Every test that named one |
| binary names the set. |
| + |
| +## Build ruling R-T2b (2026-11-08): per-unit rootfs skeleton, measured overlay mode |
| + |
| +Spec rev 5.3 §6.3 supersedes the shared `/var/lib/carlos/oci-rootfs` in Global |
| +Constraints and Tasks 3, 4, 6, 7, 9: `execsandbox.RootfsDir(id)` = |
| +`/var/lib/carlos/oci-rootfs/<id>`; Task 4's writer produces the skeleton from the |
| +same mount list it writes into config.json (one constructor for both) and the |
| +verifier compares it; Task 3's bootstrap/apply creates `/var/lib/carlos/oci-rootfs` |
| +root 0700 and the control unit gains `ReadWritePaths=/var/lib/carlos/oci-rootfs`; |
| +Task 5's `/stop` removes skeleton and bundle together after proof. Task 2 pins the |
| +overlay flag it measured (`--overlay2=none` preferred, else `root:memory`) into the |
| +command recipe. NOFILE: the guest's soft limit under gVisor is not the host unit's; |
| +tests assert the hard limit equals the native hard limit and the soft limit is at |
| +least the native soft limit, and record the observed pair. |
diff --git a/docs/superpowers/specs/2026-11-08-gvisor-demos-design.md b/docs/superpowers/specs/2026-11-08-gvisor-demos-design.md| index 7e82ac0de..927d992e7 100644 |
| --- a/docs/superpowers/specs/2026-11-08-gvisor-demos-design.md |
| +++ b/docs/superpowers/specs/2026-11-08-gvisor-demos-design.md |
| @@ -1,4 +1,4 @@ |
| -# gVisor sandbox for anonymous demos: design (2026-11-08, rev 5.2) |
| +# gVisor sandbox for anonymous demos: design (2026-11-08, rev 5.3) |
| Discussion: amadan carlos/platform #527. Spike: `~/.cache/gvisor-spike/REPORT.md` |
| and `astra-integration.md` (2026-11-07, runsc release-20261102.0, systrap, t4g). |
| @@ -220,6 +220,25 @@ Where things live (round 1 P1-2): |
| never reads or deletes runsc state; leftovers go through the unit's own |
| `ExecStartPre=runsc delete -force` and through stopping the unit. |
| +**Rev 5.3 (build ruling R-T2b, root runner `20261108T215912-02c7df`):** the shared |
| +empty rootfs above does not work. runsc's gofer creates every missing bind-mount |
| +target inside the host rootfs directory (`mkdir /proc/fs/root/opt: read-only file |
| +system` under `ProtectSystem=strict`; without it, the shared rootfs is modified). |
| +So each unit gets its own **rootfs skeleton**: `root.path` = |
| +`/var/lib/carlos/oci-rootfs/<id>`, built by root before start from the validated |
| +(host, role, gen) only, containing exactly the mount targets of the bundle's mount |
| +list (directories for directory mounts, empty 0444 regular files for file mounts, |
| +`proc`, `dev`, `tmp`), every entry root-owned, directories 0755, nothing else. The |
| +gofer then creates nothing. The controller's unit gains |
| +`ReadWritePaths=/var/lib/carlos/oci-rootfs` (that directory only; bootstrap creates |
| +it 0700 root). The skeleton is removed with the bundle, after the stop's proof, |
| +inside the same `/stop` fence. The root runner checks the skeleton is byte-for-byte |
| +unchanged after a run. The rootfs overlay mode is fixed by the same measurement: |
| +`--overlay2=none` if it passes with the full hardening set, otherwise |
| +`--overlay2=root:memory` (charged to the unit's cgroup); never the default `self` |
| +file store, which writes into the rootfs directory. The chosen flag joins the |
| +asserted runsc argv. |
| + |
| Inputs are the validated host shape, role and generation. No byte a tenant or app |
| can write is read by root to build it: not the launch JSON, not the app's files. |