host: leave the dormant claim-bound template out of the filter
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6 files changed,
+15
−17
docs/superpowers/notes/census-proposal-instance-syscall-filter.md+1 −3docs/superpowers/plans/2026-11-08-instance-syscall-filter.md+3 −2docs/superpowers/specs/2026-11-08-instance-syscall-filter-design.md+5 −4internal/host/claimunit_template.go+0 −3internal/host/units_hardening_test.go+5 −2internal/provision/testdata/plan14-root-reads-instance-syscall-filter.tsv+1 −3
CI cancelled — superseded by a newer push — run details
Intent
Attributed to this commit: 135 g CO₂e (13,849,379 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on instance-syscall-filter, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.
diff --git a/docs/superpowers/notes/census-proposal-instance-syscall-filter.md b/docs/superpowers/notes/census-proposal-instance-syscall-filter.md| index 067ba274f..9659b60b2 100644 |
| --- a/docs/superpowers/notes/census-proposal-instance-syscall-filter.md |
| +++ b/docs/superpowers/notes/census-proposal-instance-syscall-filter.md |
| @@ -4,7 +4,6 @@ Ruling `census-ruling-instance-syscall-filter`. The independent reviewer approve |
| | unit | change | read sites | what changed | |
| |---|---|---|---| |
| -| `internal/host/claimunit_template.go` `const claimBoundTemplate` | body | unchanged (1) | the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, in the constant's text; the renderer, its inputs and what root writes from it are unchanged | |
| | `internal/host/units/carlos-demo-build@.service` `external` | body | unchanged (1) | the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with a one-line comment | |
| | `internal/host/units/carlos-demo-snapshot@.service` `external` | body | unchanged (1) | the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with a one-line comment | |
| | `internal/host/units/carlos-instance-cmd@.service` `external` | body | unchanged (1) | the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates) | |
| @@ -23,13 +22,12 @@ Ruling `census-ruling-instance-syscall-filter`. The independent reviewer approve |
| | `internal/instanceexec/probe.go` `productionProbeEnv` | body | unchanged (1) | the probe env gains syscallFilterEnforced (its own environment, CARLOS_PROBE_SYSCALL_FILTER exactly "1"), ioUringSetup and keyctl (realIOUringSetup, realKeyctl); runs inside the probe units as carlos; no root read | |
| | `internal/instanceexec/probe_hardening.go` `networkAndIPCChecks` | body | unchanged (2) | one more verdict line, syscall-filter (syscallFilterHeld: both calls must answer ENOSYS; unverified when the unit does not advertise the filter); inside the probe units as carlos; decides nothing for root beyond one more probe line that can fail readiness | |
| -Envelopes re-pinned: `internal/host`, `internal/host/units`, `internal/instancectl`, `internal/instanceexec`. |
| +Envelopes re-pinned: `internal/host/units`, `internal/instancectl`, `internal/instanceexec`. |
| Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner. |
| Recorded dispositions, which each change must still satisfy: |
| -- `internal/host/claimunit_template.go` `const claimBoundTemplate`: authority, task E2. Basis: PROPOSED E51: Root-only bound-unit template is held inside the claim renderer; ordinary bootstrap never enumerates or installs it. |
| - `internal/host/units/carlos-demo-build@.service` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=New dynamic-UID compiler execution path with fixed argv, root-derived mounts, no network and bounded resources/termination. |
| - `internal/host/units/carlos-demo-snapshot@.service` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-agent-start-demo-3;basis=Run the unprivileged fixed snapshot helper with private receive bytes, bounded memory/disk/time, no network or credentials, and operation-owned cleanup. Census read-site delta: +file:external. |
| - `internal/host/units/carlos-instance-cmd@.service` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-carlos-run;basis=the cmd unit template (applied by PID 1 as root; its process runs as carlos): extends the J4 seed pattern to the run role. The template equals the seed template outside named lines, and the template-equality test pins that. Root lays out a staged executable validated by the same refuseStagedExe the seed and generation paths use, then starts this unit, which runs as carlos with the instance's own reach. No new trust of registry, /data or agent-asserted content beyond the seed path;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else |
diff --git a/docs/superpowers/plans/2026-11-08-instance-syscall-filter.md b/docs/superpowers/plans/2026-11-08-instance-syscall-filter.md| index 04d15fbcc..db9fe4d02 100644 |
| --- a/docs/superpowers/plans/2026-11-08-instance-syscall-filter.md |
| +++ b/docs/superpowers/plans/2026-11-08-instance-syscall-filter.md |
| @@ -4,9 +4,10 @@ Spec: `docs/superpowers/specs/2026-11-08-instance-syscall-filter-design.md`. |
| Branch `instance-syscall-filter` from origin/main 1751f78f. |
| 1. Unit test `TestTenantUnitsCarryTheSyscallFilter` (internal/host): the |
| - three lines on the 15 tenant unit files and `claimBoundTemplate`, no |
| + three lines on the 15 tenant unit files (not the dormant |
| + `claimBoundTemplate`), no |
| other syscall-shaping line. Then the lines, in the shared binary block, |
| - the shared rootfs block, both demo units and the claim template. The |
| + the shared rootfs block and both demo units. The |
| snapshot unit contract test learns that `SystemCallFilter` is the one |
| list-valued key. |
| 2. Probe line `syscall-filter` (internal/instanceexec): seams |
diff --git a/docs/superpowers/specs/2026-11-08-instance-syscall-filter-design.md b/docs/superpowers/specs/2026-11-08-instance-syscall-filter-design.md| index f8546f53c..b54723048 100644 |
| --- a/docs/superpowers/specs/2026-11-08-instance-syscall-filter-design.md |
| +++ b/docs/superpowers/specs/2026-11-08-instance-syscall-filter-design.md |
| @@ -51,11 +51,12 @@ Units covered (all units that run tenant or anonymous code): |
| byte-identical, so the line goes in the shared block); |
| - the six rootfs units (one restated rootfs block, byte-identical); |
| - `carlos-demo-build@` and `carlos-demo-snapshot@` (anonymous source and |
| - its data); |
| -- `claimBoundTemplate` (claim generation units already add their own |
| - narrower filter in the trampoline; this makes the unit match). |
| + its data). |
| -Not covered: `carlos-app@` (the legacy DynamicUser template for |
| +Not covered: `claimBoundTemplate` (the claim-bound path is dormant while |
| +claims are shelved, its trampoline already installs a narrower filter of |
| +its own with io_uring in it, and the template is pinned by the |
| +record-write census; it follows when claims come back), `carlos-app@` (the legacy DynamicUser template for |
| operator-run, single-process tenants; out of scope for the demo and a |
| behaviour change for self-hosters), the platform's own services, and |
| capability units rendered by `internal/caps`. |
diff --git a/internal/host/claimunit_template.go b/internal/host/claimunit_template.go| index ed39bd6fe..62de03963 100644 |
| --- a/internal/host/claimunit_template.go |
| +++ b/internal/host/claimunit_template.go |
| @@ -57,9 +57,6 @@ LockPersonality=yes |
| RestrictRealtime=yes |
| MemoryDenyWriteExecute=yes |
| SystemCallArchitectures=native |
| -SystemCallFilter=@system-service |
| -SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd |
| -SystemCallErrorNumber=ENOSYS |
| TasksMax=256 |
| OOMScoreAdjust=500 |
diff --git a/internal/host/units_hardening_test.go b/internal/host/units_hardening_test.go| index 6b28cd9b9..b558b4a92 100644 |
| --- a/internal/host/units_hardening_test.go |
| +++ b/internal/host/units_hardening_test.go |
| @@ -228,7 +228,10 @@ var syscallBlock = []string{ |
| // the first, and RestrictSUIDSGID= filters on openat2's open_how, which |
| // breaks every instancefs open (#126). |
| func TestTenantUnitsCarryTheSyscallFilter(t *testing.T) { |
| - units := map[string]string{"claimBoundTemplate": claimBoundTemplate} |
| + // claimBoundTemplate is left out: the claim-bound path is dormant |
| + // (claims shelved) and its trampoline installs a narrower filter of its |
| + // own (instanceexec claim_generation_linux.go), io_uring included. |
| + units := map[string]string{} |
| for _, name := range []string{ |
| "carlos-instance@.service", "carlos-instance-gen@.service", "carlos-instance-seed@.service", "carlos-instance-sidecar@.service", |
| "carlos-instance-cmd@.service", "carlos-instance-tty@.service", "carlos-instance-probe.service", |
| @@ -262,7 +265,7 @@ func TestTenantUnitsCarryTheSyscallFilter(t *testing.T) { |
| // RestrictSUIDSGID=; they open no instancefs path. Everywhere else it |
| // is refused (TestInstanceTemplatesShareOneNamespace pins the binary |
| // block; this pins the rest). |
| - for _, name := range []string{"claimBoundTemplate", "carlos-instance-rootfs@.service", "carlos-instance-rootfs-probe.service"} { |
| + for _, name := range []string{"carlos-instance-rootfs@.service", "carlos-instance-rootfs-probe.service"} { |
| for _, d := range directives(units[name]) { |
| if strings.HasPrefix(d, "RestrictSUIDSGID=") { |
| t.Errorf("%s carries %q, which breaks openat2", name, d) |
diff --git a/internal/provision/testdata/plan14-root-reads-instance-syscall-filter.tsv b/internal/provision/testdata/plan14-root-reads-instance-syscall-filter.tsv| index c6d1b1534..28e18d8e3 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-instance-syscall-filter.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-instance-syscall-filter.tsv |
| @@ -1,5 +1,5 @@ |
| # Census overlay instance-syscall-filter, written by census-propose (#369). census-ruling-instance-syscall-filter, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-instance-syscall-filter.md. |
| -# 18 body, 0 sites, 4 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| +# 17 body, 0 sites, 3 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| # 2 new dispositions: 0 reads re-frozen at their disposition with the claim, 2 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other. |
| @legacy 5bdc3f1b99d299cb3ee11d4b85eb161597bc81be501b153946ac2604853bfdaf internal/host/units/carlos-demo-build@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=New dynamic-UID compiler execution path with fixed argv, root-derived mounts, no network and bounded resources/termination.;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with a one-line comment file:external@0 a109a53d7af15b55c9e1f24361dba46aaba4c05578dec8e804f0d942c800bd77 |
| @legacy 72a06b6870bd267b6fe35ef5060f363621523e7d45b41ef2b85f68c45fd41e5a internal/host/units/carlos-demo-snapshot@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-3;basis=Run the unprivileged fixed snapshot helper with private receive bytes, bounded memory/disk/time, no network or credentials, and operation-owned cleanup. Census read-site delta: +file:external.;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with a one-line comment file:external@0 ccb3996dfea3f527cf69958a5d2a436206be392026b89e6fbdc42929e2f2d40a |
| @@ -20,7 +20,6 @@ |
| @legacy beb6ef05df4718a18af1413f00ea36a8e706df03b88068fe9cc6c68bebedd47a internal/instanceexec/probe_hardening.go networkAndIPCChecks legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=both isolation probes (carlos instance-probe in carlos-instance-probe.service and instance-probe --rootfs in carlos-instance-rootfs-probe.service, both started by instance control, user carlos inside the unit's own namespace; no tenant code runs there);basis=root-input (J4, as hardeningChecks, whose body this is): new (rootfs Plan 2 Tasks 7 and 7a): hardeningChecks' network, IPC and resource lines, shared by both probes, with the box-addr (boxAddrClosed) and mdwe lines added; its two sites are hardeningChecks': ReadFile of the unit's resolv.conf and of its own cgroup's io.weight; no root process runs it; decides nothing for root;rev3=census-ruling-instance-syscall-filter;basis=one more verdict line, syscall-filter (syscallFilterHeld: both calls must answer ENOSYS; unverified when the unit does not advertise the filter); inside the probe units as carlos; decides nothing for root beyond one more probe line that can fail readiness file:ReadFile@352,file:ReadFile@4885 c5f1389db848553260d537b12ff0ef16eea2152f13104a2c96ab3975efc18bb3 |
| @legacy 65678ec20448bd3007d229d6d24de28a8f542e35891006daa510659639176d80 internal/instanceexec/probe_hardening_linux.go realIOUringSetup legacy accepted-legacy accepted-legacy;rev3=census-ruling-instance-syscall-filter;basis=new: io_uring_setup(0 entries, a zeroed params struct on the stack), closing any fd returned; no path, no file; runs only inside the probe units as carlos file:Syscall@97 a719c211e26c1f84198b3d182f3bf28e5edacfced8a4fde07fa0a44b244e2d42 |
| @legacy 5b799d4b0552f395f668368950d31e80a6d4dc35b350dd8d9a8008424de363b1 internal/instanceexec/probe_hardening_linux.go realKeyctl legacy accepted-legacy accepted-legacy;rev3=census-ruling-instance-syscall-filter;basis=new: keyctl(KEYCTL_GET_KEYRING_ID, KEY_SPEC_PROCESS_KEYRING, 0), creating nothing; no path, no file; runs only inside the probe units as carlos file:Syscall@42 da7ccd448c83a9e4e41b43013f906d88bfe7e0ab4a13139c604e1757191b9a64 |
| -internal/host/claimunit_template.go const claimBoundTemplate authority E2 PROPOSED E51: Root-only bound-unit template is held inside the claim renderer; ordinary bootstrap never enumerates or installs it.;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, in the constant's text; the renderer, its inputs and what root writes from it are unchanged data-literal@27 d592e7893d821e42b80f8d60a4c89d212d0d24cba1c4e5bb737c0a7f30e2e0dc |
| internal/host/units/carlos-demo-build@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=New dynamic-UID compiler execution path with fixed argv, root-derived mounts, no network and bounded resources/termination.;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with a one-line comment file:external@0 a109a53d7af15b55c9e1f24361dba46aaba4c05578dec8e804f0d942c800bd77 |
| internal/host/units/carlos-demo-snapshot@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-3;basis=Run the unprivileged fixed snapshot helper with private receive bytes, bounded memory/disk/time, no network or credentials, and operation-owned cleanup. Census read-site delta: +file:external.;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with a one-line comment file:external@0 ccb3996dfea3f527cf69958a5d2a436206be392026b89e6fbdc42929e2f2d40a |
| internal/host/units/carlos-instance-cmd@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=the cmd unit template (applied by PID 1 as root; its process runs as carlos): extends the J4 seed pattern to the run role. The template equals the seed template outside named lines, and the template-equality test pins that. Root lays out a staged executable validated by the same refuseStagedExe the seed and generation paths use, then starts this unit, which runs as carlos with the instance's own reach. No new trust of registry, /data or agent-asserted content beyond the seed path;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: the same one namespace-block line, TemporaryFileSystem=/dev/pts:ro, as carlos-instance@.service; nothing else;rev3=census-ruling-instance-syscall-filter;basis=the tenant syscall filter (#527 Q5): three [Service] lines after SystemCallArchitectures=native (SystemCallFilter=@system-service; SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd; SystemCallErrorNumber=ENOSYS), applied by PID 1 as a seccomp filter on the unit's own process as carlos; no bind source, Exec line, user, mount or path read by root added, with its comment, inside the shared namespace block (byte-identical across the binary templates) file:external@0 0de8125c3116a10ab9b8db2167531199249f6db49492d1dc239bee9fc5c30269 |
| @@ -40,7 +39,6 @@ internal/instanceexec/probe.go productionProbeEnv legacy accepted-legacy accepte |
| internal/instanceexec/probe_hardening.go networkAndIPCChecks legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=both isolation probes (carlos instance-probe in carlos-instance-probe.service and instance-probe --rootfs in carlos-instance-rootfs-probe.service, both started by instance control, user carlos inside the unit's own namespace; no tenant code runs there);basis=root-input (J4, as hardeningChecks, whose body this is): new (rootfs Plan 2 Tasks 7 and 7a): hardeningChecks' network, IPC and resource lines, shared by both probes, with the box-addr (boxAddrClosed) and mdwe lines added; its two sites are hardeningChecks': ReadFile of the unit's resolv.conf and of its own cgroup's io.weight; no root process runs it; decides nothing for root;rev3=census-ruling-instance-syscall-filter;basis=one more verdict line, syscall-filter (syscallFilterHeld: both calls must answer ENOSYS; unverified when the unit does not advertise the filter); inside the probe units as carlos; decides nothing for root beyond one more probe line that can fail readiness file:ReadFile@352,file:ReadFile@4885 c5f1389db848553260d537b12ff0ef16eea2152f13104a2c96ab3975efc18bb3 |
| internal/instanceexec/probe_hardening_linux.go realIOUringSetup legacy accepted-legacy accepted-legacy;rev3=census-ruling-instance-syscall-filter;basis=new: io_uring_setup(0 entries, a zeroed params struct on the stack), closing any fd returned; no path, no file; runs only inside the probe units as carlos file:Syscall@97 a719c211e26c1f84198b3d182f3bf28e5edacfced8a4fde07fa0a44b244e2d42 |
| internal/instanceexec/probe_hardening_linux.go realKeyctl legacy accepted-legacy accepted-legacy;rev3=census-ruling-instance-syscall-filter;basis=new: keyctl(KEYCTL_GET_KEYRING_ID, KEY_SPEC_PROCESS_KEYRING, 0), creating nothing; no path, no file; runs only inside the probe units as carlos file:Syscall@42 da7ccd448c83a9e4e41b43013f906d88bfe7e0ab4a13139c604e1757191b9a64 |
| -@coverage internal/host ac652b93e86b9a8349420bda910a2ff0326c0cf2297818f7b17b39463200f9e8 |
| @coverage internal/host/units 0f3b763de100e60301993cd4ae1dabae776ac8448387b11944a241943df93d36 |
| @coverage internal/instancectl f9a40e824a188205317b84c8381d42c2825bc51e36e5f42aa96932f9d906f49a |
| @coverage internal/instanceexec 119cb0b74c3f1f4990cb983c142c4e94dc04bc1c2dc645410ec6a01138388930 |