carlos / platform Public

instances: tenant syscall filter on every tenant unit (#527 Q5)

SystemCallFilter=@system-service less io_uring, the keyring and
userfaultfd, refused with ENOSYS, on the binary and rootfs instance
templates, both probes and the demo build and snapshot units. Both
probes check it from inside (syscall-filter line, gated on a
unit-advertised env var for roll order). Root-runner witness: Go, Node,
Python, Ruby and PHP serve under the block; openat2 and Landlock work.
Astra R1 READY; census approved on #280.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Squashed from instance-syscall-filter into main.
claude agent, operated by paul@keymail.dev f4d9b095de5621e4c6193c9eee56810d9208dc47 parent 1751f78
31 files changed, +1,033 −2
  • docs/superpowers/notes/census-proposal-instance-syscall-filter.md +56 −0
  • docs/superpowers/plans/2026-11-08-instance-syscall-filter.md +25 −0
  • docs/superpowers/specs/2026-11-08-instance-syscall-filter-design.md +97 −0
  • internal/host/demo_snapshot_test.go +11 −0
  • internal/host/syscallfilter_rootrunner_linux_test.go +400 −0
  • internal/host/units/carlos-demo-build@.service +4 −0
  • internal/host/units/carlos-demo-snapshot@.service +4 −0
  • internal/host/units/carlos-instance-cmd@.service +12 −0
  • internal/host/units/carlos-instance-gen@.service +12 −0
  • internal/host/units/carlos-instance-probe.service +17 −0
  • internal/host/units/carlos-instance-rootfs-cmd@.service +12 −0
  • internal/host/units/carlos-instance-rootfs-gen@.service +12 −0
  • internal/host/units/carlos-instance-rootfs-probe.service +17 −0
  • internal/host/units/carlos-instance-rootfs-tty@.service +12 −0
  • internal/host/units/carlos-instance-rootfs-worker@.service +12 −0
  • internal/host/units/carlos-instance-rootfs@.service +12 −0
  • internal/host/units/carlos-instance-seed@.service +12 −0
  • internal/host/units/carlos-instance-sidecar@.service +12 −0
  • internal/host/units/carlos-instance-tty@.service +12 −0
  • internal/host/units/carlos-instance@.service +12 −0
  • internal/host/units_hardening_test.go +66 −0
  • internal/host/units_isolation_test.go +30 −0
  • internal/instancectl/names.go +7 −0
  • internal/instanceexec/probe.go +11 −0
  • internal/instanceexec/probe_hardening.go +29 −0
  • internal/instanceexec/probe_hardening_linux.go +27 −0
  • internal/instanceexec/probe_hardening_other.go +4 −0
  • internal/instanceexec/probe_rootfs_test.go +1 −1
  • internal/instanceexec/probe_test.go +50 −1
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −0
  • internal/provision/testdata/plan14-root-reads-instance-syscall-filter.tsv +44 −0

CI passed — run details

diff --git a/docs/superpowers/notes/census-proposal-instance-syscall-filter.md b/docs/superpowers/notes/census-proposal-instance-syscall-filter.md
new file mode 100644
index 000000000..9659b60b2
--- /dev/null
+++ b/docs/superpowers/notes/census-proposal-instance-syscall-filter.md
@@ -0,0 +1,56 @@
+# Census approval: instance-syscall-filter
+
+Ruling `census-ruling-instance-syscall-filter`. The independent reviewer approves or rejects every change below, 2 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
+
+| unit | change | read sites | what changed |
+|---|---|---|---|
+| `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) |
+| `internal/host/units/carlos-instance-gen@.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) |
+| `internal/host/units/carlos-instance-probe.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, inside the shared namespace block; plus one line outside it, Environment=CARLOS_PROBE_SYSCALL_FILTER=1, a constant the unit sets for its own process (the probe, as carlos); it names no path |
+| `internal/host/units/carlos-instance-rootfs-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 restated rootfs block (byte-identical across the rootfs units) |
+| `internal/host/units/carlos-instance-rootfs-gen@.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 restated rootfs block (byte-identical across the rootfs units) |
+| `internal/host/units/carlos-instance-rootfs-probe.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, inside the rootfs block; plus one line outside it, Environment=CARLOS_PROBE_SYSCALL_FILTER=1, a constant the unit sets for its own process (the probe, as carlos); it names no path |
+| `internal/host/units/carlos-instance-rootfs-tty@.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 restated rootfs block (byte-identical across the rootfs units) |
+| `internal/host/units/carlos-instance-rootfs-worker@.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 restated rootfs block (byte-identical across the rootfs units) |
+| `internal/host/units/carlos-instance-rootfs@.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 restated rootfs block (byte-identical across the rootfs units) |
+| `internal/host/units/carlos-instance-seed@.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) |
+| `internal/host/units/carlos-instance-sidecar@.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) |
+| `internal/host/units/carlos-instance-tty@.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) |
+| `internal/host/units/carlos-instance@.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) |
+| `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/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/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
+- `internal/host/units/carlos-instance-gen@.service` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J4;basis=root-input;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
+- `internal/host/units/carlos-instance-probe.service` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-2;basis=one more BindReadOnlyPaths= line, so PID 1 opens one more bind source: /run/carlos-control/exe/_probe/box-addrs, bound to /opt/carlos/box-addrs, root's list of the box's own addresses, which RunProbe writes before every run (#367) in the root-only directory the unit already binds from; no tenant, app or agent input names or writes it;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, so the probe proves what the tenants get (its new pts-private line); fix round 1 (Astra P2, roll order): one line outside the namespace block, Environment=CARLOS_PROBE_PTS_PRIVATE=1, a constant the unit sets for its own process (the probe, as carlos, in the namespace); it names no path, adds no bind source or Exec line, and root reads nothing new
+- `internal/host/units/carlos-instance-rootfs-cmd@.service` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=a rootfs unit template (embedded in the carlos binary, installed under /etc/systemd/system by root's unit install as the other templates are, applied by PID 1 as root; its process runs as user carlos);basis=root-input (J4, as carlos-instance-cmd@.service, accepted at census-ruling-carlos-run): new (rootfs Plan 2 Task 4): the rootfs cmd unit (oneshot, TimeoutStartSec=6h5m, the cmd log sockets), binding /run/carlos-control/exe/%I/rootfs/cmd/. The template carries the binary template's hardening block restated for an image root (ProtectSystem=strict, the /data, /run/carlos and /opt/carlos tmpfs mounts read-only, PrivateDevices=, PrivateIPC=, ProtectControlGroups=strict, PrivatePIDs=, RestrictNamespaces=, NoNewPrivileges=, an empty CapabilityBoundingSet=, the IPAddressDeny= list, MemoryDenyWriteExecute=yes) plus RootImage= with RootImageOptions=ro,nosuid,nodev; what PID 1 mounts for it: the image, a link root's ensureRootfsExe made under /run/carlos-control/exe (root's, never in any instance's namespace) to the image validateStagedImage checked; root's launch.json and resolv.conf copy from the same root-only directory, read-only; the platform binary, read-only; the instance's own two directories. Provenance: the RootImage= path is fixed and root-controlled (a link root made to the image validateStagedImage checked), but the image's contents are tenant-built: PID 1 and the kernel mount a tenant-produced squashfs (read-only, nosuid, nodev) as the unit's root, after root has checked its bytes against root's own staged manifest; that mount is the new authority this template carries. The tenant also writes its own two directories; it names no path PID 1 or root opens
+- `internal/host/units/carlos-instance-rootfs-gen@.service` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=a rootfs unit template (embedded in the carlos binary, installed under /etc/systemd/system by root's unit install as the other templates are, applied by PID 1 as root; its process runs as user carlos);basis=root-input (J4, as carlos-instance-gen@.service): new (rootfs Plan 2 Task 4): a rootfs generation's template, the run template without Slice=, StandardOutput=, the instance's binds and RootImage=, which only root's per-start drop-in (RootfsGenDropIn) supplies, so the template alone mounts and runs nothing. The template carries the binary template's hardening block restated for an image root (ProtectSystem=strict, the /data, /run/carlos and /opt/carlos tmpfs mounts read-only, PrivateDevices=, PrivateIPC=, ProtectControlGroups=strict, PrivatePIDs=, RestrictNamespaces=, NoNewPrivileges=, an empty CapabilityBoundingSet=, the IPAddressDeny= list, MemoryDenyWriteExecute=yes) plus RootImageOptions=ro,nosuid,nodev, with no RootImage= of its own (root's per-start drop-in names the image); what PID 1 mounts for it: the image, a link root's ensureRootfsExe made under /run/carlos-control/exe (root's, never in any instance's namespace) to the image validateStagedImage checked; root's launch.json and resolv.conf copy from the same root-only directory, read-only; the platform binary, read-only; the instance's own two directories. Provenance: the RootImage= path is fixed and root-controlled (a link root made to the image validateStagedImage checked), but the image's contents are tenant-built: PID 1 and the kernel mount a tenant-produced squashfs (read-only, nosuid, nodev) as the unit's root, after root has checked its bytes against root's own staged manifest; that mount is the new authority this template carries. The tenant also writes its own two directories; it names no path PID 1 or root opens
+- `internal/host/units/carlos-instance-rootfs-probe.service` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=the rootfs probe's unit (embedded in the carlos binary, installed by root's unit install, applied by PID 1 as root; its process, carlos instance-probe --rootfs, runs as user carlos);basis=root-input (J4, as carlos-instance-probe.service): new (rootfs Plan 2 Task 7): a oneshot on carlos-instances.slice with the same restated block, RootImage= the probe image root builds itself (BuildProbeImage, under /run/carlos-control/probe), the probe's own _probe directories, root's launch.json, resolv.conf copy and box-addrs list read-only from /run/carlos-control/exe/_probe/rootfs/run/, and StandardOutput=truncate:/run/carlos-control/rootfs-probe.out, which PID 1 writes and root reads (runRootfsProbe); no tenant image, file or name reaches it
+- `internal/host/units/carlos-instance-rootfs-tty@.service` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5, new: the rootfs tty template, carlos-instance-rootfs-cmd@.service outside named lines held by TestRootfsTTYTemplateEqualsRootfsCmdOutsideTheNamedLines: Description (tty), ExecStart/ExecStopPost instance-exec/instance-exit --rootfs tty %I, StandardInput=file:/run/carlos/logs/%I.tty.sock with StandardOutput/StandardError=journal, and RootImage plus the two BindReadOnlyPaths sources under /run/carlos-control/exe/%I/rootfs/tty/ (root-only exe layout) instead of rootfs/cmd/. The rootfs namespace block byte for byte (TestRootfsTemplatesShareOneNamespace), runs as carlos, binds only the instance own and root paths (TestRootfsTemplatesBindOnlyTheInstancesOwnAndRoots). Task 6: POST /tty runtime=rootfs (startRootfsCmd with RoleTTY) starts it through Plan 2's rootfs one-shot path (preflight, validateStagedImage, ensureRootfsExe under rootfs/tty/, jit drop-in and owed reload, post-start MemoryDenyWriteExecute check); its files go only through removeRootfsUnitFiles (stopRootfs and cleanCmdExe with RoleTTY, the sweep)
+- `internal/host/units/carlos-instance-rootfs-worker@.service` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=a rootfs unit template (embedded in the carlos binary, installed under /etc/systemd/system by root's unit install as the other templates are, applied by PID 1 as root; its process runs as user carlos);basis=root-input (J4, as carlos-instance-gen@.service): new (rootfs Plan 2 Task 4): a rootfs worker's template, the run template without Slice=, StandardOutput=, the instance's binds and RootImage=, which only root's per-start drop-in (WorkerDropIn) supplies. The template carries the binary template's hardening block restated for an image root (ProtectSystem=strict, the /data, /run/carlos and /opt/carlos tmpfs mounts read-only, PrivateDevices=, PrivateIPC=, ProtectControlGroups=strict, PrivatePIDs=, RestrictNamespaces=, NoNewPrivileges=, an empty CapabilityBoundingSet=, the IPAddressDeny= list, MemoryDenyWriteExecute=yes) plus RootImageOptions=ro,nosuid,nodev, with no RootImage= of its own (root's per-start drop-in names the image); what PID 1 mounts for it: the image, a link root's ensureRootfsExe made under /run/carlos-control/exe (root's, never in any instance's namespace) to the image validateStagedImage checked; root's launch.json and resolv.conf copy from the same root-only directory, read-only; the platform binary, read-only; the instance's own two directories. Provenance: the RootImage= path is fixed and root-controlled (a link root made to the image validateStagedImage checked), but the image's contents are tenant-built: PID 1 and the kernel mount a tenant-produced squashfs (read-only, nosuid, nodev) as the unit's root, after root has checked its bytes against root's own staged manifest; that mount is the new authority this template carries. The tenant also writes its own two directories; it names no path PID 1 or root opens
+- `internal/host/units/carlos-instance-rootfs@.service` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=a rootfs unit template (embedded in the carlos binary, installed under /etc/systemd/system by root's unit install as the other templates are, applied by PID 1 as root; its process runs as user carlos);basis=root-input (J4, as carlos-instance@.service): new (rootfs Plan 2 Task 4): the run unit of a rootfs instance (ExecStart= the trampoline with --rootfs run, ExecStopPost= instance-exit --rootfs run), Slice=carlos-instances-%i.slice, binding /run/carlos-control/exe/%I/rootfs/run/. The template carries the binary template's hardening block restated for an image root (ProtectSystem=strict, the /data, /run/carlos and /opt/carlos tmpfs mounts read-only, PrivateDevices=, PrivateIPC=, ProtectControlGroups=strict, PrivatePIDs=, RestrictNamespaces=, NoNewPrivileges=, an empty CapabilityBoundingSet=, the IPAddressDeny= list, MemoryDenyWriteExecute=yes) plus RootImage= with RootImageOptions=ro,nosuid,nodev; what PID 1 mounts for it: the image, a link root's ensureRootfsExe made under /run/carlos-control/exe (root's, never in any instance's namespace) to the image validateStagedImage checked; root's launch.json and resolv.conf copy from the same root-only directory, read-only; the platform binary, read-only; the instance's own two directories. Provenance: the RootImage= path is fixed and root-controlled (a link root made to the image validateStagedImage checked), but the image's contents are tenant-built: PID 1 and the kernel mount a tenant-produced squashfs (read-only, nosuid, nodev) as the unit's root, after root has checked its bytes against root's own staged manifest; that mount is the new authority this template carries. The tenant also writes its own two directories; it names no path PID 1 or root opens
+- `internal/host/units/carlos-instance-seed@.service` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J4;basis=root-input;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
+- `internal/host/units/carlos-instance-sidecar@.service` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J4;basis=root-input;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
+- `internal/host/units/carlos-instance-tty@.service` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5, new: the binary tty template, carlos-instance-cmd@.service outside six named lines held by TestTTYTemplateEqualsCmdOutsideTheNamedLines: Description (tty), ExecStart/ExecStopPost instance-exec/instance-exit tty %I (the same root binary as every template), StandardInput=file:/run/carlos/logs/%I.tty.sock replacing the cmd StandardOutput socket (PID 1 opens it as root on the nosymfollow logs mount, as the cmd streams), StandardOutput=journal, StandardError=journal, and BindReadOnlyPaths sources tty-app/tty-live under /run/carlos-control/exe/%I (root-only exe layout, as cmd-app/cmd-live). Same namespace block byte for byte, runs as carlos. Task 6: POST /tty (handleOneShot(RoleTTY), claimAwareLegacy) starts it, after the role lock, the loaded-state refusal and refuseStagedExe; the tty-app/tty-live sources are laid out by ensureCmdExeAt(RoleTTY) and removed by removeCmdExe(RoleTTY) at /stop role=tty and /sweep
+- `internal/host/units/carlos-instance@.service` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: one namespace-block line added after TemporaryFileSystem=/dev/mqueue:ro, TemporaryFileSystem=/dev/pts:ro (with its comment): PID 1 mounts an empty read-only tmpfs over the private /dev/pts, hiding the host devpts PrivateDevices= binds in; no bind source, Exec line, user or path read by root added; the block stays byte-identical across the binary templates (TestInstanceTemplatesShareOneNamespace)
+- `internal/instanceexec/probe.go` `productionProbeEnv`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-2;basis=the binary probe's env gains boxAddrs (instancectl.BoxAddrsPath, /opt/carlos/box-addrs), which boxAddrClosed (a decision row) reads inside the probe unit, and mmapWX (realMmapWX, an anonymous mapping); the same one direct site;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5 (PF-8): the binary probe env sets devPts=/dev/pts and openPtmx (open /dev/ptmx O_RDWR|O_NOCTTY and close at once), the fields the rootfs probe env already set; read by the new pts-private line inside the probe unit (as carlos, in the namespace); fix round 1: also reads its own environment, CARLOS_PROBE_PTS_PRIVATE (exactly "1" enforces pts-private; otherwise the line is reported unverified), which the probe unit sets; the same direct site, no new root read
+- `internal/instanceexec/probe_hardening.go` `networkAndIPCChecks`: legacy, task accepted-legacy. Basis: 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
+
+New dispositions, which census-propose wrote and the reviewer checks against the unit's reads and the diff:
+
+- new `internal/instanceexec/probe_hardening_linux.go:realIOUringSetup`: reads +file:Syscall; written legacy, accepted-legacy, frozen
+- new `internal/instanceexec/probe_hardening_linux.go:realKeyctl`: reads +file:Syscall; written legacy, accepted-legacy, frozen
+
+Seal: `f19eb78c1da1475cbf8e11a3d6c394d828aa1c8f88ae24469fe8d473581b934b` → `b970bb28c5a633d2572a1da549030e9258cfdabb6322ddffdd0ebf41b56c464c`.
+
+Overlay: `internal/provision/testdata/plan14-root-reads-instance-syscall-filter.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/docs/superpowers/plans/2026-11-08-instance-syscall-filter.md b/docs/superpowers/plans/2026-11-08-instance-syscall-filter.md
new file mode 100644
index 000000000..db9fe4d02
--- /dev/null
+++ b/docs/superpowers/plans/2026-11-08-instance-syscall-filter.md
@@ -0,0 +1,25 @@
+# Plan: instance syscall filter (#527 Q5)
+
+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 (not the dormant
+ `claimBoundTemplate`), no
+ other syscall-shaping line. Then the lines, in the shared binary block,
+ 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
+ `ioUringSetup`, `keyctl`, gated on `ProbeSyscallFilterEnv`; both probe
+ units set it outside their shared blocks
+ (`TestBothProbesAdvertiseTheSyscallFilter`). Table test
+ `TestProbeSyscallFilterLine`.
+3. Root-runner witness `TestRootSyscallFilterRuntimes`
+ (internal/host, `linux && rootrunner`): the embedded template's
+ hardening on transient units running Go, Node (UV_USE_IO_URING=1),
+ Python, Ruby and PHP, each serving over a unix socket; io_uring_setup
+ and keyctl ENOSYS, openat2 and the Landlock ABI query working inside.
+4. Census: `make census-card`, CLAIMS, `make census-propose
+ NAME=instance-syscall-filter`, Astra cross-family verdict on #280.
+5. Astra review (max three rounds), CI green on the tip, squash merge.
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
new file mode 100644
index 000000000..b54723048
--- /dev/null
+++ b/docs/superpowers/specs/2026-11-08-instance-syscall-filter-design.md
@@ -0,0 +1,97 @@
+# Instance syscall filter (#527 Q5)
+
+Status: rev 1, 2026-11-08. Pre-launch hardening for the /start demo; Paul
+ruled it must land before anonymous demo code runs on flagship.
+
+## Problem
+
+The gVisor spike (2026-11-07, #527) found that no tenant unit the platform
+writes carries `SystemCallFilter=`. A tenant reaches every syscall the host
+kernel offers that its capabilities (none) and namespaces do not already
+refuse. The native probe got `io_uring_setup: ok`. io_uring is the largest
+single piece of that surface and a repeat source of local privilege
+escalations; the kernel keyring and userfaultfd are smaller but have the
+same history. None of our supported runtimes needs any of them.
+
+## Change
+
+Every tenant unit gets one syscall block, placed after
+`SystemCallArchitectures=native` (already on all of them):
+
+```
+SystemCallFilter=@system-service
+SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd
+SystemCallErrorNumber=ENOSYS
+```
+
+- `@system-service` is systemd's own baseline allow-list for ordinary
+ services; the edge, dbread and devbox units already run under it. It
+ leaves out what needs capabilities an instance does not have (mount,
+ bpf, module and clock calls, chroot, pivot_root), plus ptrace,
+ perf_event_open, fanotify and similar.
+- The `~` line takes io_uring, the keyring calls (`add_key`, `keyctl`,
+ `request_key`) and userfaultfd back out of the allow-list. Legacy AIO
+ (`io_setup`, `io_submit`) stays: some databases use it, and it has none
+ of io_uring's history.
+- `ENOSYS`, not `EPERM` and not the default SIGSYS kill: a refused call
+ looks like a kernel without it, which is the fallback path every runtime
+ already has (libuv falls back from io_uring to its thread pool, glibc
+ falls back on ENOSYS). A kill would take a tenant down for probing.
+- openat2 stays allowed: `@system-service` includes `@file-system`, which
+ lists it, and an allow-list does not inspect arguments. The 2026-11-06
+ lesson was `RestrictSUIDSGID=`, which filters on `open_how` contents and
+ so refuses openat2 outright. The block adds no such argument filter.
+- The trampoline's own needs are in the list: Landlock
+ (`landlock_*`), `seccomp` (the claim generation filter), `prctl`,
+ `pidfd_*` except `pidfd_getfd`, `clone3`, `openat2`.
+
+Units covered (all units that run tenant or anonymous code):
+
+- the seven binary templates and the binary probe (one namespace block,
+ 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).
+
+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`.
+
+The JIT drop-in (rootfs `jit` manifests) lifts `MemoryDenyWriteExecute`
+only; it does not touch the filter.
+
+## Proof
+
+1. Unit tests pin the three lines on every covered unit, and refuse a
+ second `SystemCallFilter=` allow-list or any argument-inspecting
+ setting (`RestrictSUIDSGID=`) in the shared blocks.
+2. Both probes (binary and rootfs) gain a `syscall-filter` line: it fails
+ unless `io_uring_setup` and `keyctl` both answer ENOSYS inside the
+ unit. `keyctl` is the presence check: it succeeds for an
+ unprivileged process on any kernel with keys, so a refusal proves the
+ filter is in force, while io_uring alone could be refused by
+ `kernel.io_uring_disabled`. A box whose probe fails this line refuses
+ readiness like any other failed probe line, so the property is
+ re-checked on every box at every probe run. A roll replaces the binary
+ before the units, so the line is enforced only under a probe unit that
+ says `Environment=CARLOS_PROBE_SYSCALL_FILTER=1` and is `unverified`
+ otherwise, the pattern the pts-private line set.
+3. Root-runner witness (dev, throwaway arm64): the embedded
+ `carlos-instance@.service` hardening, filter included, applied to a
+ transient unit running each supported runtime (Go, Node with libuv's
+ io_uring forced on, Python, Ruby, PHP) serving HTTP on a unix socket;
+ each must serve, and inside the unit `io_uring_setup` and `keyctl` must
+ answer ENOSYS while `openat2` and Landlock's ABI query work. Static
+ sites are served by the edge and run no instance unit, so they are out
+ of the witness.
+
+## Rollout
+
+The units ship embedded in the binary and are installed by the roll, so
+the probe and the filter arrive together. No flag: the filter is on for
+every instance at the first start after the roll. The rollback is the
+previous release.
diff --git a/internal/host/demo_snapshot_test.go b/internal/host/demo_snapshot_test.go
index db431ab2f..afd189353 100644
--- a/internal/host/demo_snapshot_test.go
+++ b/internal/host/demo_snapshot_test.go
@@ -17,6 +17,7 @@ func TestDemoClaimSnapshotUnitContract(t *testing.T) {
t.Fatal(err)
}
props := map[string]string{}
+ var filters []string
section := ""
for _, line := range strings.Split(string(b), "\n") {
line = strings.TrimSpace(line)
@@ -32,6 +33,12 @@ func TestDemoClaimSnapshotUnitContract(t *testing.T) {
t.Fatalf("bad unit line %q", line)
}
key := section + "/" + k
+ // The one list-valued key: an allow-list, then what it takes back
+ // out (#527 Q5). Checked in order below.
+ if key == "[Service]/SystemCallFilter" {
+ filters = append(filters, v)
+ continue
+ }
if _, exists := props[key]; exists {
t.Fatalf("duplicate %s", key)
}
@@ -54,6 +61,10 @@ func TestDemoClaimSnapshotUnitContract(t *testing.T) {
"ProtectControlGroups": "yes", "ProtectProc": "invisible", "ProcSubset": "pid",
"ProtectKernelTunables": "yes", "ProtectKernelModules": "yes", "ProtectKernelLogs": "yes", "ProtectClock": "yes", "ProtectHostname": "yes",
"RemoveIPC": "yes", "LockPersonality": "yes", "RestrictRealtime": "yes", "MemoryDenyWriteExecute": "yes", "SystemCallArchitectures": "native",
+ "SystemCallErrorNumber": "ENOSYS",
+ }
+ if strings.Join(filters, "\n") != "@system-service\n~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd" {
+ t.Errorf("SystemCallFilter lines = %q", filters)
}
for key := range props {
if name, ok := strings.CutPrefix(key, "[Service]/"); ok {
diff --git a/internal/host/syscallfilter_rootrunner_linux_test.go b/internal/host/syscallfilter_rootrunner_linux_test.go
new file mode 100644
index 000000000..302c4e52a
--- /dev/null
+++ b/internal/host/syscallfilter_rootrunner_linux_test.go
@@ -0,0 +1,400 @@
+//go:build linux && rootrunner
+
+package host
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ "io"
+ "net"
+ "net/http"
+ "os"
+ "os/exec"
+ "os/user"
+ "path/filepath"
+ "strings"
+ "syscall"
+ "testing"
+ "time"
+ "unsafe"
+
+ "golang.org/x/sys/unix"
+
+ "github.com/carlosframework/platform/internal/instanceexec"
+ "github.com/carlosframework/platform/internal/instancefs"
+)
+
+// TestRootSyscallFilterRuntimes is the kernel witness for the tenant
+// syscall filter (#527 Q5). It applies the embedded carlos-instance@
+// namespace block, filter included, to transient units that run each
+// supported runtime as carlos and serve HTTP on a unix socket: Go (this
+// binary, which also runs the trampoline's own openat2 and Landlock calls
+// inside the unit), Node with libuv's io_uring forced on, Python, Ruby and
+// PHP. Every one must serve. Inside the units io_uring_setup and keyctl
+// must answer ENOSYS; a control unit with the filter lines removed must
+// see both reach the kernel, so the witness tells the two apart.
+//
+// Path-specific lines of the block (binds, InaccessiblePaths) are dropped:
+// their sources exist only on an installed box, and they shape mounts, not
+// syscalls. Static sites are served by the edge and run no unit.
+//
+// Network: this test runs apt-get to install the interpreters (Debian
+// mirrors). Nothing else leaves the box.
+func TestRootSyscallFilterRuntimes(t *testing.T) {
+ if os.Geteuid() != 0 {
+ t.Fatal("needs real root")
+ }
+ if b, err := os.ReadFile("/proc/1/comm"); err != nil || strings.TrimSpace(string(b)) != "systemd" {
+ t.Fatalf("needs systemd as PID 1: %q %v", b, err)
+ }
+ ctx, cancel := context.WithTimeout(t.Context(), 9*time.Minute)
+ defer cancel()
+ sh := func(name string, args ...string) string {
+ t.Helper()
+ cmd := exec.CommandContext(ctx, name, args...)
+ cmd.Env = append(os.Environ(), "DEBIAN_FRONTEND=noninteractive", "LC_ALL=C")
+ out, err := cmd.CombinedOutput()
+ if err != nil {
+ t.Fatalf("%s %v: %v\n%s", name, args, err, out)
+ }
+ return string(out)
+ }
+ sh("apt-get", "update", "-q")
+ sh("apt-get", "install", "-y", "-q", "--no-install-recommends", "nodejs", "python3", "ruby", "php-cli")
+ for _, v := range [][]string{{"node", "--version"}, {"python3", "--version"}, {"ruby", "--version"}, {"php", "--version"}, {"systemctl", "--version"}, {"uname", "-a"}} {
+ t.Logf("%s: %s", v[0], strings.SplitN(sh(v[0], v[1:]...), "\n", 2)[0])
+ }
+
+ // carlos, as on a box; made here (and removed after) when absent.
+ if _, err := user.Lookup("carlos"); err != nil {
+ sh("useradd", "--system", "--user-group", "--no-create-home", "--shell", "/usr/sbin/nologin", "carlos")
+ t.Cleanup(func() { _ = exec.Command("userdel", "carlos").Run() })
+ }
+ // The block's TemporaryFileSystem= mount points, made when absent.
+ for _, dir := range []string{"/data", "/run/carlos", "/opt/carlos", "/var/cache", "/var/lib"} {
+ if _, err := os.Stat(dir); errors.Is(err, os.ErrNotExist) {
+ if err := os.MkdirAll(dir, 0o755); err != nil {
+ t.Fatal(err)
+ }
+ t.Cleanup(func() { _ = os.Remove(dir) })
+ }
+ }
+
+ block := syscallWitnessBlock(t)
+ scratch, err := os.MkdirTemp("/srv", "scf-")
+ if err != nil {
+ t.Fatal(err)
+ }
+ t.Cleanup(func() { _ = os.RemoveAll(scratch) })
+ if err := os.Chmod(scratch, 0o777); err != nil {
+ t.Fatal(err)
+ }
+ exe, err := os.Executable()
+ if err != nil {
+ t.Fatal(err)
+ }
+ helper := filepath.Join(scratch, "w.test")
+ sh("install", "-m", "0755", exe, helper)
+ scripts := map[string]string{"node": nodeScript, "python": pythonScript, "ruby": rubyScript, "php": phpScript}
+ for name, body := range scripts {
+ if err := os.WriteFile(filepath.Join(scratch, name+".src"), []byte(body), 0o644); err != nil {
+ t.Fatal(err)
+ }
+ }
+ // What Landlock's ABI query answers outside any unit, as carlos: the
+ // trampoline's scope must answer the same inside.
+ outside := exec.CommandContext(ctx, helper, "-test.run=^TestRootSyscallFilterHelper$")
+ outside.Env = []string{"SCF_MODE=outside", "SCF_DIR=" + scratch}
+ outside.SysProcAttr = &syscall.SysProcAttr{Credential: carlosCred(t)}
+ if out, err := outside.CombinedOutput(); err != nil {
+ t.Fatalf("outside control: %v\n%s", err, out)
+ }
+
+ type runtime struct {
+ name, exec string
+ jit bool // the rootfs jit drop-in: MemoryDenyWriteExecute=no
+ filtered bool
+ }
+ runtimes := []runtime{
+ {"go", helper + " -test.run=^TestRootSyscallFilterHelper$", false, true},
+ {"node", "/usr/bin/node " + scratch + "/node.src", true, true},
+ {"python", "/usr/bin/python3 " + scratch + "/python.src", false, true},
+ {"ruby", "/usr/bin/ruby " + scratch + "/ruby.src", false, true},
+ {"php", "/usr/bin/php " + scratch + "/php.src", false, true},
+ {"control", helper + " -test.run=^TestRootSyscallFilterHelper$", false, false},
+ // Unfiltered twins, run second: the filtered runs paid the cold
+ // page cache, so a twin that serves no faster says the filter
+ // costs nothing at start.
+ {"node-control", "/usr/bin/node " + scratch + "/node.src", true, false},
+ {"python-control", "/usr/bin/python3 " + scratch + "/python.src", false, false},
+ {"node-again", "/usr/bin/node " + scratch + "/node.src", true, true},
+ {"python-again", "/usr/bin/python3 " + scratch + "/python.src", false, true},
+ }
+ ctl := func(args ...string) (string, error) {
+ out, err := exec.CommandContext(ctx, "systemctl", args...).CombinedOutput()
+ return string(out), err
+ }
+ for _, rt := range runtimes {
+ t.Run(rt.name, func(t *testing.T) {
+ unit := "carlos-scf-" + rt.name + ".service"
+ path := filepath.Join("/run/systemd/system", unit)
+ if _, err := os.Lstat(path); !errors.Is(err, os.ErrNotExist) {
+ t.Fatalf("%s already exists", path)
+ }
+ sock := filepath.Join(scratch, rt.name+".sock")
+ mode := "filtered"
+ var b strings.Builder
+ fmt.Fprintf(&b, "[Service]\nType=simple\nUser=carlos\nGroup=carlos\nExecStart=%s\n", rt.exec)
+ fmt.Fprintf(&b, "Environment=SCF_SOCK=%s SCF_DIR=%s SCF_NAME=%s UV_USE_IO_URING=1\n", sock, scratch, rt.name)
+ for _, line := range block {
+ if !rt.filtered && (strings.HasPrefix(line, "SystemCallFilter=") || strings.HasPrefix(line, "SystemCallErrorNumber=")) {
+ continue
+ }
+ b.WriteString(line + "\n")
+ }
+ if !rt.filtered {
+ mode = "control"
+ }
+ fmt.Fprintf(&b, "Environment=SCF_MODE=%s\n", mode)
+ if rt.jit {
+ b.WriteString("MemoryDenyWriteExecute=no\n")
+ }
+ fmt.Fprintf(&b, "BindPaths=%s\nReadWritePaths=%s\nTimeoutStopSec=20\n", scratch, scratch)
+ if err := os.WriteFile(path, []byte(b.String()), 0o644); err != nil {
+ t.Fatal(err)
+ }
+ t.Cleanup(func() {
+ _, _ = ctl("stop", unit)
+ _, _ = ctl("reset-failed", unit)
+ _ = os.Remove(path)
+ _, _ = ctl("daemon-reload")
+ })
+ if out, err := ctl("daemon-reload"); err != nil {
+ t.Fatal(out, err)
+ }
+ if out, err := ctl("start", unit); err != nil {
+ t.Fatalf("start: %v %s\n%s", err, out, journalOf(unit))
+ }
+ client := &http.Client{Timeout: 2 * time.Second, Transport: &http.Transport{DialContext: func(c context.Context, _, _ string) (net.Conn, error) {
+ return (&net.Dialer{}).DialContext(c, "unix", sock)
+ }}}
+ started := time.Now()
+ deadline := started.Add(60 * time.Second)
+ for {
+ resp, err := client.Get("http://app/")
+ if err == nil {
+ body, _ := io.ReadAll(resp.Body)
+ resp.Body.Close()
+ want := "ok:" + strings.SplitN(rt.name, "-", 2)[0]
+ if rt.name == "control" {
+ want = "ok:control"
+ }
+ if !strings.HasPrefix(string(body), want) {
+ t.Fatalf("%s answered %q, want %q\n%s", rt.name, body, want, journalOf(unit))
+ }
+ t.Logf("%s served after %s: %s", rt.name, time.Since(started).Round(time.Millisecond), strings.TrimSpace(string(body)))
+ break
+ }
+ if st, _ := ctl("show", unit, "-p", "ActiveState", "--value"); strings.TrimSpace(st) == "failed" || strings.TrimSpace(st) == "inactive" {
+ t.Fatalf("%s exited before serving: %s\n%s", rt.name, st, journalOf(unit))
+ }
+ if time.Now().After(deadline) {
+ t.Fatalf("%s never served: %v\n%s", rt.name, err, journalOf(unit))
+ }
+ time.Sleep(100 * time.Millisecond)
+ }
+ if !rt.filtered {
+ return
+ }
+ show, _ := ctl("show", unit, "-p", "SystemCallFilter,SystemCallErrorNumber,SystemCallArchitectures")
+ for _, gone := range []string{"io_uring_setup", "io_uring_enter", "io_uring_register", "keyctl", "add_key", "request_key", "userfaultfd"} {
+ if strings.Contains(show, " "+gone+" ") || strings.Contains(show, "="+gone+" ") {
+ t.Errorf("effective allow-list still holds %s", gone)
+ }
+ }
+ if !strings.Contains(show, "openat2") {
+ t.Errorf("effective allow-list lacks openat2")
+ }
+ t.Logf("effective: SystemCallErrorNumber/Architectures: %s", lastLines(show, 2))
+ })
+ }
+}
+
+// syscallWitnessBlock is the embedded carlos-instance@ namespace block's
+// directives, less the path-specific ones, and must hold this build's
+// three syscall lines.
+func syscallWitnessBlock(t *testing.T) []string {
+ t.Helper()
+ raw, err := unitsFS.ReadFile("units/carlos-instance@.service")
+ if err != nil {
+ t.Fatal(err)
+ }
+ u := string(raw)
+ start, end := strings.Index(u, "# --- the namespace"), strings.Index(u, "# --- per-service resources")
+ if start < 0 || end < start {
+ t.Fatal("namespace block markers missing")
+ }
+ var out []string
+ for _, d := range directives(u[start:end]) {
+ key, _, _ := strings.Cut(d, "=")
+ switch key {
+ case "BindPaths", "BindReadOnlyPaths", "InaccessiblePaths", "ReadWritePaths":
+ continue
+ }
+ if strings.Contains(d, "%") {
+ continue
+ }
+ out = append(out, d)
+ }
+ for _, want := range syscallBlock {
+ found := false
+ for _, d := range out {
+ found = found || d == want
+ }
+ if !found {
+ t.Fatalf("this build's block lacks %q", want)
+ }
+ }
+ return out
+}
+
+func carlosCred(t *testing.T) *syscall.Credential {
+ t.Helper()
+ u, err := user.Lookup("carlos")
+ if err != nil {
+ t.Fatal(err)
+ }
+ var uid, gid uint32
+ fmt.Sscan(u.Uid, &uid)
+ fmt.Sscan(u.Gid, &gid)
+ return &syscall.Credential{Uid: uid, Gid: gid}
+}
+
+func journalOf(unit string) string {
+ out, _ := exec.Command("journalctl", "-u", unit, "--no-pager", "-n", "40", "-o", "cat").CombinedOutput()
+ return string(out)
+}
+
+func lastLines(s string, n int) string {
+ lines := strings.Split(strings.TrimSpace(s), "\n")
+ if len(lines) > n {
+ lines = lines[len(lines)-n:]
+ }
+ return strings.Join(lines, " ")
+}
+
+// TestRootSyscallFilterHelper runs inside the units (and once outside, as
+// carlos, for the Landlock control). In a filtered unit io_uring_setup,
+// keyctl and userfaultfd answer ENOSYS while instancefs's openat2 and the
+// trampoline's Landlock scope behave as they do outside; in the control
+// unit io_uring_setup and keyctl reach the kernel. Then it serves.
+func TestRootSyscallFilterHelper(t *testing.T) {
+ mode, dir := os.Getenv("SCF_MODE"), os.Getenv("SCF_DIR")
+ if mode == "" {
+ t.Skip("helper only")
+ }
+ landlock := filepath.Join(dir, "landlock-outside")
+ _, _, abiErr := unix.Syscall(unix.SYS_LANDLOCK_CREATE_RULESET, 0, 0, unix.LANDLOCK_CREATE_RULESET_VERSION)
+ if mode == "outside" {
+ if err := os.WriteFile(landlock, []byte(abiErr.Error()), 0o644); err != nil {
+ t.Fatal(err)
+ }
+ return
+ }
+ var params [120]byte
+ _, _, ioErr := unix.Syscall(unix.SYS_IO_URING_SETUP, 0, uintptr(unsafe.Pointer(&params)), 0)
+ _, _, keyErr := unix.Syscall(unix.SYS_KEYCTL, unix.KEYCTL_GET_KEYRING_ID, uintptr(^uint(1)), 0)
+ _, _, ufErr := unix.Syscall(unix.SYS_USERFAULTFD, 0, 0, 0)
+ report := fmt.Sprintf("io_uring_setup=%v keyctl=%v userfaultfd=%v", ioErr, keyErr, ufErr)
+ switch mode {
+ case "filtered":
+ if ioErr != unix.ENOSYS || keyErr != unix.ENOSYS || ufErr != unix.ENOSYS {
+ t.Fatalf("filter not in force: %s", report)
+ }
+ if err := instancefs.SelfCheck(dir); err != nil {
+ t.Fatalf("instancefs openat2 under the filter: %v", err)
+ }
+ want, err := os.ReadFile(landlock)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if abiErr.Error() != string(want) {
+ t.Fatalf("Landlock ABI query inside = %v, outside = %s", abiErr, want)
+ }
+ // The trampoline's own scope call, as it runs before every app.
+ if err := instanceexec.ScopeAbstractUnix(); err != nil && string(want) == unix.Errno(0).Error() {
+ t.Fatalf("ScopeAbstractUnix under the filter: %v", err)
+ }
+ report += fmt.Sprintf(" openat2=ok landlock=%v", abiErr)
+ case "control":
+ if ioErr == unix.ENOSYS || keyErr == unix.ENOSYS {
+ t.Fatalf("control unit refuses without the filter, so the witness cannot tell: %s", report)
+ }
+ }
+ ln, err := net.Listen("unix", os.Getenv("SCF_SOCK"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer ln.Close()
+ srv := &http.Server{Handler: http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
+ _, _ = io.WriteString(w, "ok:"+os.Getenv("SCF_NAME")+" "+report)
+ })}
+ _ = srv.Serve(ln)
+}
+
+// Each script checks io_uring_setup (425 on every Linux architecture)
+// where the language can make a raw call, exercises its async I/O, and
+// serves "ok:<name>" on $SCF_SOCK.
+const nodeScript = `
+const fs = require('fs'), http = require('http');
+(async () => {
+ // libuv submits these through io_uring when UV_USE_IO_URING=1 and the
+ // ring can be made; under the filter it must fall back, not fail.
+ for (let i = 0; i < 50; i++) await fs.promises.readFile('/etc/os-release');
+ await fs.promises.writeFile(process.env.SCF_DIR + '/node.tmp', 'x');
+ await fs.promises.unlink(process.env.SCF_DIR + '/node.tmp');
+ http.createServer((q, s) => s.end('ok:node ' + process.version)).listen(process.env.SCF_SOCK);
+})().catch(e => { console.error(e); process.exit(1); });
+`
+
+const pythonScript = `
+import ctypes, errno, os, socketserver, http.server, threading
+libc = ctypes.CDLL(None, use_errno=True)
+buf = ctypes.create_string_buffer(120)
+r = libc.syscall(425, 0, buf)
+e = ctypes.get_errno()
+if os.environ["SCF_MODE"] == "filtered" and (r != -1 or e != errno.ENOSYS):
+ raise SystemExit("io_uring_setup reached the kernel: r=%d errno=%d" % (r, e))
+class H(http.server.BaseHTTPRequestHandler):
+ def do_GET(self):
+ b = ("ok:python io_uring_setup errno=%d" % e).encode()
+ self.send_response(200); self.send_header("Content-Length", str(len(b))); self.end_headers(); self.wfile.write(b)
+ def address_string(self): return "unix"
+class S(socketserver.ThreadingMixIn, socketserver.UnixStreamServer): pass
+S(os.environ["SCF_SOCK"], H).serve_forever()
+`
+
+const rubyScript = `
+require 'socket'
+srv = UNIXServer.new(ENV['SCF_SOCK'])
+loop do
+ Thread.new(srv.accept) do |c|
+ while (l = c.gets) && l != "\r\n"; end
+ b = "ok:ruby #{RUBY_VERSION}"
+ c.write("HTTP/1.1 200 OK\r\nContent-Length: #{b.bytesize}\r\nConnection: close\r\n\r\n#{b}")
+ c.close
+ end
+end
+`
+
+const phpScript = `<?php
+$s = stream_socket_server("unix://" . getenv("SCF_SOCK"), $no, $str);
+if (!$s) { fwrite(STDERR, "$str\n"); exit(1); }
+while ($c = stream_socket_accept($s, -1)) {
+ while (($l = fgets($c)) !== false && $l !== "\r\n") {}
+ $b = "ok:php " . PHP_VERSION;
+ fwrite($c, "HTTP/1.1 200 OK\r\nContent-Length: " . strlen($b) . "\r\nConnection: close\r\n\r\n" . $b);
+ fclose($c);
+}
+`
diff --git a/internal/host/units/carlos-demo-build@.service b/internal/host/units/carlos-demo-build@.service
index 112afcc2f..65ff1ab85 100644
--- a/internal/host/units/carlos-demo-build@.service
+++ b/internal/host/units/carlos-demo-build@.service
@@ -61,3 +61,7 @@ LockPersonality=yes
RestrictRealtime=yes
MemoryDenyWriteExecute=yes
SystemCallArchitectures=native
+# The tenant syscall surface (#527 Q5; see carlos-instance@.service).
+SystemCallFilter=@system-service
+SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd
+SystemCallErrorNumber=ENOSYS
diff --git a/internal/host/units/carlos-demo-snapshot@.service b/internal/host/units/carlos-demo-snapshot@.service
index a9a63d6ea..95c81d3fc 100644
--- a/internal/host/units/carlos-demo-snapshot@.service
+++ b/internal/host/units/carlos-demo-snapshot@.service
@@ -59,3 +59,7 @@ LockPersonality=yes
RestrictRealtime=yes
MemoryDenyWriteExecute=yes
SystemCallArchitectures=native
+# The tenant syscall surface (#527 Q5; see carlos-instance@.service).
+SystemCallFilter=@system-service
+SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd
+SystemCallErrorNumber=ENOSYS
diff --git a/internal/host/units/carlos-instance-cmd@.service b/internal/host/units/carlos-instance-cmd@.service
index 040660163..364976f52 100644
--- a/internal/host/units/carlos-instance-cmd@.service
+++ b/internal/host/units/carlos-instance-cmd@.service
@@ -164,6 +164,18 @@ RestrictRealtime=yes
# directory).
MemoryDenyWriteExecute=yes
SystemCallArchitectures=native
+# The tenant's syscall surface (#527 Q5): systemd's baseline for an
+# ordinary service, less io_uring, the kernel keyring and userfaultfd,
+# which no supported runtime needs and which carry most of the recent
+# local privilege escalations. A refused call answers ENOSYS, as a kernel
+# without it would, so runtimes take the fallback they already have
+# (libuv's thread pool for io_uring) rather than being killed. openat2 is
+# in @system-service and an allow-list never reads arguments, so instancefs
+# is untouched (unlike RestrictSUIDSGID=, above). The probes' syscall-filter
+# line checks it from inside.
+SystemCallFilter=@system-service
+SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd
+SystemCallErrorNumber=ENOSYS
# --- per-service resources; the tier lives on the host slice (§4.3) ---
TasksMax=256
diff --git a/internal/host/units/carlos-instance-gen@.service b/internal/host/units/carlos-instance-gen@.service
index a0b3a263e..cb8707654 100644
--- a/internal/host/units/carlos-instance-gen@.service
+++ b/internal/host/units/carlos-instance-gen@.service
@@ -146,6 +146,18 @@ RestrictRealtime=yes
# directory).
MemoryDenyWriteExecute=yes
SystemCallArchitectures=native
+# The tenant's syscall surface (#527 Q5): systemd's baseline for an
+# ordinary service, less io_uring, the kernel keyring and userfaultfd,
+# which no supported runtime needs and which carry most of the recent
+# local privilege escalations. A refused call answers ENOSYS, as a kernel
+# without it would, so runtimes take the fallback they already have
+# (libuv's thread pool for io_uring) rather than being killed. openat2 is
+# in @system-service and an allow-list never reads arguments, so instancefs
+# is untouched (unlike RestrictSUIDSGID=, above). The probes' syscall-filter
+# line checks it from inside.
+SystemCallFilter=@system-service
+SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd
+SystemCallErrorNumber=ENOSYS
# --- per-service resources; the tier lives on the host slice (§4.3) ---
TasksMax=256
diff --git a/internal/host/units/carlos-instance-probe.service b/internal/host/units/carlos-instance-probe.service
index 540dad33e..efe56e7f5 100644
--- a/internal/host/units/carlos-instance-probe.service
+++ b/internal/host/units/carlos-instance-probe.service
@@ -39,6 +39,11 @@ BindReadOnlyPaths=/run/carlos-control/exe/_probe/box-addrs:/opt/carlos/box-addrs
# a new probe can run under an old probe unit, and it enforces its
# pts-private line only when this is set (instancectl.ProbePtsPrivateEnv).
Environment=CARLOS_PROBE_PTS_PRIVATE=1
+# This unit carries the tenant syscall filter (below) and says so: a roll
+# replaces the binary before it installs the units, so a new probe can run
+# under an old probe unit, and it enforces its syscall-filter line only
+# when this is set (instancectl.ProbeSyscallFilterEnv, #527 Q5).
+Environment=CARLOS_PROBE_SYSCALL_FILTER=1
# --- the namespace (titogo@.service, 2026-07-31 design, on systemd 257) ---
ProtectSystem=strict
@@ -145,6 +150,18 @@ RestrictRealtime=yes
# directory).
MemoryDenyWriteExecute=yes
SystemCallArchitectures=native
+# The tenant's syscall surface (#527 Q5): systemd's baseline for an
+# ordinary service, less io_uring, the kernel keyring and userfaultfd,
+# which no supported runtime needs and which carry most of the recent
+# local privilege escalations. A refused call answers ENOSYS, as a kernel
+# without it would, so runtimes take the fallback they already have
+# (libuv's thread pool for io_uring) rather than being killed. openat2 is
+# in @system-service and an allow-list never reads arguments, so instancefs
+# is untouched (unlike RestrictSUIDSGID=, above). The probes' syscall-filter
+# line checks it from inside.
+SystemCallFilter=@system-service
+SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd
+SystemCallErrorNumber=ENOSYS
# --- per-service resources; the tier lives on the host slice (§4.3) ---
TasksMax=64
diff --git a/internal/host/units/carlos-instance-rootfs-cmd@.service b/internal/host/units/carlos-instance-rootfs-cmd@.service
index a85ff7570..205ed6eb1 100644
--- a/internal/host/units/carlos-instance-rootfs-cmd@.service
+++ b/internal/host/units/carlos-instance-rootfs-cmd@.service
@@ -253,6 +253,18 @@ RestrictRealtime=yes
# seccomp fallback).
MemoryDenyWriteExecute=yes
SystemCallArchitectures=native
+# The tenant's syscall surface (#527 Q5): systemd's baseline for an
+# ordinary service, less io_uring, the kernel keyring and userfaultfd,
+# which no supported runtime needs and which carry most of the recent
+# local privilege escalations. A refused call answers ENOSYS, as a kernel
+# without it would, so runtimes take the fallback they already have
+# (libuv's thread pool for io_uring) rather than being killed. openat2 is
+# in @system-service and an allow-list never reads arguments, so instancefs
+# is untouched (unlike RestrictSUIDSGID=, above). The probes' syscall-filter
+# line checks it from inside.
+SystemCallFilter=@system-service
+SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd
+SystemCallErrorNumber=ENOSYS
# --- per-service resources; the tier lives on the host slice (§4.3) ---
TasksMax=256
diff --git a/internal/host/units/carlos-instance-rootfs-gen@.service b/internal/host/units/carlos-instance-rootfs-gen@.service
index 540b519fe..61f43a960 100644
--- a/internal/host/units/carlos-instance-rootfs-gen@.service
+++ b/internal/host/units/carlos-instance-rootfs-gen@.service
@@ -233,6 +233,18 @@ RestrictRealtime=yes
# seccomp fallback).
MemoryDenyWriteExecute=yes
SystemCallArchitectures=native
+# The tenant's syscall surface (#527 Q5): systemd's baseline for an
+# ordinary service, less io_uring, the kernel keyring and userfaultfd,
+# which no supported runtime needs and which carry most of the recent
+# local privilege escalations. A refused call answers ENOSYS, as a kernel
+# without it would, so runtimes take the fallback they already have
+# (libuv's thread pool for io_uring) rather than being killed. openat2 is
+# in @system-service and an allow-list never reads arguments, so instancefs
+# is untouched (unlike RestrictSUIDSGID=, above). The probes' syscall-filter
+# line checks it from inside.
+SystemCallFilter=@system-service
+SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd
+SystemCallErrorNumber=ENOSYS
# --- per-service resources; the tier lives on the host slice (§4.3) ---
TasksMax=256
diff --git a/internal/host/units/carlos-instance-rootfs-probe.service b/internal/host/units/carlos-instance-rootfs-probe.service
index 81e54e784..5f0291152 100644
--- a/internal/host/units/carlos-instance-rootfs-probe.service
+++ b/internal/host/units/carlos-instance-rootfs-probe.service
@@ -24,6 +24,11 @@ Slice=carlos-instances.slice
StandardOutput=truncate:/run/carlos-control/rootfs-probe.out
StandardError=journal
TimeoutStartSec=30
+# This unit carries the tenant syscall filter (below) and says so: a roll
+# replaces the binary before it installs the units, so a new probe can run
+# under an old probe unit, and it enforces its syscall-filter line only
+# when this is set (instancectl.ProbeSyscallFilterEnv, #527 Q5).
+Environment=CARLOS_PROBE_SYSCALL_FILTER=1
# The instance's own two directories, the only writable data paths.
BindPaths=/data/instances/_probe /run/carlos/instances/_probe
ReadWritePaths=/data/instances/_probe /run/carlos/instances/_probe
@@ -225,6 +230,18 @@ RestrictRealtime=yes
# seccomp fallback).
MemoryDenyWriteExecute=yes
SystemCallArchitectures=native
+# The tenant's syscall surface (#527 Q5): systemd's baseline for an
+# ordinary service, less io_uring, the kernel keyring and userfaultfd,
+# which no supported runtime needs and which carry most of the recent
+# local privilege escalations. A refused call answers ENOSYS, as a kernel
+# without it would, so runtimes take the fallback they already have
+# (libuv's thread pool for io_uring) rather than being killed. openat2 is
+# in @system-service and an allow-list never reads arguments, so instancefs
+# is untouched (unlike RestrictSUIDSGID=, above). The probes' syscall-filter
+# line checks it from inside.
+SystemCallFilter=@system-service
+SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd
+SystemCallErrorNumber=ENOSYS
# --- per-service resources; the tier lives on the host slice (§4.3) ---
TasksMax=64
diff --git a/internal/host/units/carlos-instance-rootfs-tty@.service b/internal/host/units/carlos-instance-rootfs-tty@.service
index f2d048cd3..06232d086 100644
--- a/internal/host/units/carlos-instance-rootfs-tty@.service
+++ b/internal/host/units/carlos-instance-rootfs-tty@.service
@@ -257,6 +257,18 @@ RestrictRealtime=yes
# seccomp fallback).
MemoryDenyWriteExecute=yes
SystemCallArchitectures=native
+# The tenant's syscall surface (#527 Q5): systemd's baseline for an
+# ordinary service, less io_uring, the kernel keyring and userfaultfd,
+# which no supported runtime needs and which carry most of the recent
+# local privilege escalations. A refused call answers ENOSYS, as a kernel
+# without it would, so runtimes take the fallback they already have
+# (libuv's thread pool for io_uring) rather than being killed. openat2 is
+# in @system-service and an allow-list never reads arguments, so instancefs
+# is untouched (unlike RestrictSUIDSGID=, above). The probes' syscall-filter
+# line checks it from inside.
+SystemCallFilter=@system-service
+SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd
+SystemCallErrorNumber=ENOSYS
# --- per-service resources; the tier lives on the host slice (§4.3) ---
TasksMax=256
diff --git a/internal/host/units/carlos-instance-rootfs-worker@.service b/internal/host/units/carlos-instance-rootfs-worker@.service
index 270142e6a..1ef4735ae 100644
--- a/internal/host/units/carlos-instance-rootfs-worker@.service
+++ b/internal/host/units/carlos-instance-rootfs-worker@.service
@@ -245,6 +245,18 @@ RestrictRealtime=yes
# seccomp fallback).
MemoryDenyWriteExecute=yes
SystemCallArchitectures=native
+# The tenant's syscall surface (#527 Q5): systemd's baseline for an
+# ordinary service, less io_uring, the kernel keyring and userfaultfd,
+# which no supported runtime needs and which carry most of the recent
+# local privilege escalations. A refused call answers ENOSYS, as a kernel
+# without it would, so runtimes take the fallback they already have
+# (libuv's thread pool for io_uring) rather than being killed. openat2 is
+# in @system-service and an allow-list never reads arguments, so instancefs
+# is untouched (unlike RestrictSUIDSGID=, above). The probes' syscall-filter
+# line checks it from inside.
+SystemCallFilter=@system-service
+SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd
+SystemCallErrorNumber=ENOSYS
# --- per-service resources; the tier lives on the host slice (§4.3) ---
TasksMax=256
diff --git a/internal/host/units/carlos-instance-rootfs@.service b/internal/host/units/carlos-instance-rootfs@.service
index 3cb29f5b0..088bd51ae 100644
--- a/internal/host/units/carlos-instance-rootfs@.service
+++ b/internal/host/units/carlos-instance-rootfs@.service
@@ -275,6 +275,18 @@ RestrictRealtime=yes
# seccomp fallback).
MemoryDenyWriteExecute=yes
SystemCallArchitectures=native
+# The tenant's syscall surface (#527 Q5): systemd's baseline for an
+# ordinary service, less io_uring, the kernel keyring and userfaultfd,
+# which no supported runtime needs and which carry most of the recent
+# local privilege escalations. A refused call answers ENOSYS, as a kernel
+# without it would, so runtimes take the fallback they already have
+# (libuv's thread pool for io_uring) rather than being killed. openat2 is
+# in @system-service and an allow-list never reads arguments, so instancefs
+# is untouched (unlike RestrictSUIDSGID=, above). The probes' syscall-filter
+# line checks it from inside.
+SystemCallFilter=@system-service
+SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd
+SystemCallErrorNumber=ENOSYS
# --- per-service resources; the tier lives on the host slice (§4.3) ---
TasksMax=256
diff --git a/internal/host/units/carlos-instance-seed@.service b/internal/host/units/carlos-instance-seed@.service
index 72f162fd8..11152d49a 100644
--- a/internal/host/units/carlos-instance-seed@.service
+++ b/internal/host/units/carlos-instance-seed@.service
@@ -174,6 +174,18 @@ RestrictRealtime=yes
# directory).
MemoryDenyWriteExecute=yes
SystemCallArchitectures=native
+# The tenant's syscall surface (#527 Q5): systemd's baseline for an
+# ordinary service, less io_uring, the kernel keyring and userfaultfd,
+# which no supported runtime needs and which carry most of the recent
+# local privilege escalations. A refused call answers ENOSYS, as a kernel
+# without it would, so runtimes take the fallback they already have
+# (libuv's thread pool for io_uring) rather than being killed. openat2 is
+# in @system-service and an allow-list never reads arguments, so instancefs
+# is untouched (unlike RestrictSUIDSGID=, above). The probes' syscall-filter
+# line checks it from inside.
+SystemCallFilter=@system-service
+SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd
+SystemCallErrorNumber=ENOSYS
# --- per-service resources; the tier lives on the host slice (§4.3) ---
TasksMax=256
diff --git a/internal/host/units/carlos-instance-sidecar@.service b/internal/host/units/carlos-instance-sidecar@.service
index befa84c4a..24046330a 100644
--- a/internal/host/units/carlos-instance-sidecar@.service
+++ b/internal/host/units/carlos-instance-sidecar@.service
@@ -173,6 +173,18 @@ RestrictRealtime=yes
# directory).
MemoryDenyWriteExecute=yes
SystemCallArchitectures=native
+# The tenant's syscall surface (#527 Q5): systemd's baseline for an
+# ordinary service, less io_uring, the kernel keyring and userfaultfd,
+# which no supported runtime needs and which carry most of the recent
+# local privilege escalations. A refused call answers ENOSYS, as a kernel
+# without it would, so runtimes take the fallback they already have
+# (libuv's thread pool for io_uring) rather than being killed. openat2 is
+# in @system-service and an allow-list never reads arguments, so instancefs
+# is untouched (unlike RestrictSUIDSGID=, above). The probes' syscall-filter
+# line checks it from inside.
+SystemCallFilter=@system-service
+SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd
+SystemCallErrorNumber=ENOSYS
# --- per-service resources; the tier lives on the host slice (§4.3) ---
TasksMax=256
diff --git a/internal/host/units/carlos-instance-tty@.service b/internal/host/units/carlos-instance-tty@.service
index 168f4e195..094ca5cb8 100644
--- a/internal/host/units/carlos-instance-tty@.service
+++ b/internal/host/units/carlos-instance-tty@.service
@@ -168,6 +168,18 @@ RestrictRealtime=yes
# directory).
MemoryDenyWriteExecute=yes
SystemCallArchitectures=native
+# The tenant's syscall surface (#527 Q5): systemd's baseline for an
+# ordinary service, less io_uring, the kernel keyring and userfaultfd,
+# which no supported runtime needs and which carry most of the recent
+# local privilege escalations. A refused call answers ENOSYS, as a kernel
+# without it would, so runtimes take the fallback they already have
+# (libuv's thread pool for io_uring) rather than being killed. openat2 is
+# in @system-service and an allow-list never reads arguments, so instancefs
+# is untouched (unlike RestrictSUIDSGID=, above). The probes' syscall-filter
+# line checks it from inside.
+SystemCallFilter=@system-service
+SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd
+SystemCallErrorNumber=ENOSYS
# --- per-service resources; the tier lives on the host slice (§4.3) ---
TasksMax=256
diff --git a/internal/host/units/carlos-instance@.service b/internal/host/units/carlos-instance@.service
index 750d06d33..1e093f647 100644
--- a/internal/host/units/carlos-instance@.service
+++ b/internal/host/units/carlos-instance@.service
@@ -173,6 +173,18 @@ RestrictRealtime=yes
# directory).
MemoryDenyWriteExecute=yes
SystemCallArchitectures=native
+# The tenant's syscall surface (#527 Q5): systemd's baseline for an
+# ordinary service, less io_uring, the kernel keyring and userfaultfd,
+# which no supported runtime needs and which carry most of the recent
+# local privilege escalations. A refused call answers ENOSYS, as a kernel
+# without it would, so runtimes take the fallback they already have
+# (libuv's thread pool for io_uring) rather than being killed. openat2 is
+# in @system-service and an allow-list never reads arguments, so instancefs
+# is untouched (unlike RestrictSUIDSGID=, above). The probes' syscall-filter
+# line checks it from inside.
+SystemCallFilter=@system-service
+SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd
+SystemCallErrorNumber=ENOSYS
# --- per-service resources; the tier lives on the host slice (§4.3) ---
TasksMax=256
diff --git a/internal/host/units_hardening_test.go b/internal/host/units_hardening_test.go
index 338f07ab9..e39bf7767 100644
--- a/internal/host/units_hardening_test.go
+++ b/internal/host/units_hardening_test.go
@@ -212,3 +212,69 @@ func TestAppTemplateSeesOnlyItsOwnBuild(t *testing.T) {
}
}
}
+
+// syscallBlock is the tenant syscall surface (#527 Q5): systemd's service
+// baseline, less io_uring, the kernel keyring and userfaultfd, refused as
+// a kernel without them would refuse them.
+var syscallBlock = []string{
+ "SystemCallFilter=@system-service",
+ "SystemCallFilter=~@keyring io_uring_setup io_uring_enter io_uring_register userfaultfd",
+ "SystemCallErrorNumber=ENOSYS",
+ "SystemCallArchitectures=native",
+}
+
+// Every unit that runs tenant or anonymous code carries the block, and
+// nothing else that shapes the filter: a second allow-list would replace
+// the first, and RestrictSUIDSGID= filters on openat2's open_how, which
+// breaks every instancefs open (#126).
+func TestTenantUnitsCarryTheSyscallFilter(t *testing.T) {
+ // 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",
+ "carlos-instance-rootfs@.service", "carlos-instance-rootfs-cmd@.service", "carlos-instance-rootfs-gen@.service",
+ "carlos-instance-rootfs-probe.service", "carlos-instance-rootfs-tty@.service", "carlos-instance-rootfs-worker@.service",
+ "carlos-demo-build@.service", "carlos-demo-snapshot@.service",
+ } {
+ units[name] = readUnit(t, name)
+ }
+ allowed := map[string]bool{}
+ for _, d := range syscallBlock {
+ allowed[d] = true
+ }
+ for name, u := range units {
+ // Exactly the block, in order, once: systemd folds every
+ // SystemCallFilter= line in sequence, so a later allow line puts
+ // back what the ~ line took out, and a reversed pair is a
+ // deny-list with nothing else refused (Astra R1 P2).
+ var got []string
+ for _, d := range directives(u) {
+ key, _, _ := strings.Cut(d, "=")
+ switch key {
+ case "SystemCallFilter", "SystemCallErrorNumber", "SystemCallArchitectures", "SystemCallLog":
+ if !allowed[d] {
+ t.Errorf("%s carries %q beside the tenant syscall block", name, d)
+ }
+ got = append(got, d)
+ }
+ }
+ want := []string{syscallBlock[3], syscallBlock[0], syscallBlock[1], syscallBlock[2]}
+ if strings.Join(got, "\n") != strings.Join(want, "\n") {
+ t.Errorf("%s syscall lines = %q, want exactly %q", name, got, want)
+ }
+ }
+ // The demo build and snapshot units are DynamicUser, which implies
+ // RestrictSUIDSGID=; they open no instancefs path. Everywhere else it
+ // is refused (TestInstanceTemplatesShareOneNamespace pins the binary
+ // block; this pins the rest).
+ 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/host/units_isolation_test.go b/internal/host/units_isolation_test.go
index 867706119..9b7d8b114 100644
--- a/internal/host/units_isolation_test.go
+++ b/internal/host/units_isolation_test.go
@@ -512,6 +512,36 @@ func TestOnlyTheBinaryProbeAdvertisesPtsPrivate(t *testing.T) {
}
}
+// Both probes advertise the tenant syscall filter (#527 Q5), outside their
+// shared blocks, and carry it; no tenant unit advertises anything.
+func TestBothProbesAdvertiseTheSyscallFilter(t *testing.T) {
+ want := "Environment=" + instancectl.ProbeSyscallFilterEnv + "=1"
+ for name, marks := range map[string][2]string{
+ "carlos-instance-probe.service": {"# --- the namespace", "# --- per-service resources"},
+ "carlos-instance-rootfs-probe.service": {rootfsBlockStart, "# --- per-service resources"},
+ } {
+ u := readUnit(t, name)
+ if n := strings.Count("\n"+u, "\n"+want+"\n"); n != 1 {
+ t.Errorf("%s carries %q %d times, want 1", name, want, n)
+ }
+ start, end := strings.Index(u, marks[0]), strings.Index(u, marks[1])
+ if i := strings.Index(u, want); start < 0 || end < 0 || (i > start && i < end) {
+ t.Errorf("%s: the advertisement is inside the shared block", name)
+ }
+ for _, d := range syscallBlock {
+ if !hasDirective(u, d) {
+ t.Errorf("%s advertises the syscall filter and lacks %q", name, d)
+ }
+ }
+ }
+ 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-rootfs@.service", "carlos-instance-rootfs-gen@.service", "carlos-instance-rootfs-worker@.service", "carlos-instance-rootfs-cmd@.service", "carlos-instance-rootfs-tty@.service"} {
+ if strings.Contains(readUnit(t, name), instancectl.ProbeSyscallFilterEnv) {
+ t.Errorf("%s carries %s; only the probes advertise it", name, instancectl.ProbeSyscallFilterEnv)
+ }
+ }
+}
+
// unitDirectives is a unit's directives in order: comments and blank lines
// dropped, each line trimmed.
func unitDirectives(t *testing.T, name string) []string {
diff --git a/internal/instancectl/names.go b/internal/instancectl/names.go
index 5ca31391b..9c0403bb2 100644
--- a/internal/instancectl/names.go
+++ b/internal/instancectl/names.go
@@ -571,6 +571,13 @@ const (
// (rootfs Plan 6, Task 5 fix round 1). The rootfs probe always enforces.
const ProbePtsPrivateEnv = "CARLOS_PROBE_PTS_PRIVATE"
+// ProbeSyscallFilterEnv is both probe units' advertisement that they carry
+// the tenant syscall filter (#527 Q5): Environment=CARLOS_PROBE_SYSCALL_FILTER=1,
+// outside the shared blocks. As with ProbePtsPrivateEnv, a roll can run a
+// new probe under an old unit, so the syscall-filter line is enforced only
+// when the unit says "1" and is unverified otherwise.
+const ProbeSyscallFilterEnv = "CARLOS_PROBE_SYSCALL_FILTER"
+
// RootfsProbeMarker is the file at the root of the probe image
// (BuildProbeImage): the rootfs probe's root-image line finds it there
// when its root is that image and not the host's or another's.
diff --git a/internal/instanceexec/probe.go b/internal/instanceexec/probe.go
index 6ff4134cb..7e6644b6e 100644
--- a/internal/instanceexec/probe.go
+++ b/internal/instanceexec/probe.go
@@ -90,6 +90,13 @@ type probeEnv struct {
// once (R11): MemoryDenyWriteExecute=yes must refuse it, in both
// probes, which never get the jit drop-in.
mmapWX func() error
+ // syscallFilterEnforced is the probe unit's advertisement that it
+ // carries the tenant syscall filter (instancectl.ProbeSyscallFilterEnv,
+ // #527 Q5); ioUringSetup and keyctl make the two calls the
+ // syscall-filter line asks about, each returning the bare errno.
+ syscallFilterEnforced bool
+ ioUringSetup func() error
+ keyctl func() error
}
// cgroupMountpoint is the fixed system path the cgroup-ro-mount check
@@ -157,6 +164,10 @@ func productionProbeEnv() probeEnv {
boxAddrs: instancectl.BoxAddrsPath,
mmapWX: realMmapWX,
+
+ syscallFilterEnforced: os.Getenv(instancectl.ProbeSyscallFilterEnv) == "1",
+ ioUringSetup: realIOUringSetup,
+ keyctl: realKeyctl,
}
}
diff --git a/internal/instanceexec/probe_hardening.go b/internal/instanceexec/probe_hardening.go
index 0dabf5f39..16ab95f04 100644
--- a/internal/instanceexec/probe_hardening.go
+++ b/internal/instanceexec/probe_hardening.go
@@ -147,6 +147,14 @@ func networkAndIPCChecks(e probeEnv, add func(check, verdict, detail string), pa
md, mok := mdweHeld(e)
pass("mdwe", md, mok)
+ // #527 Q5: the tenant syscall filter is in force.
+ if e.syscallFilterEnforced {
+ sd, sok := syscallFilterHeld(e)
+ pass("syscall-filter", sd, sok)
+ } else {
+ add("syscall-filter", "unverified", "the probe unit does not set "+instancectl.ProbeSyscallFilterEnv+"=1 (installed before the syscall filter); not checked")
+ }
+
// #367: the box's own addresses are closed, as the private ranges are.
bv, bd := boxAddrClosed(e)
add("box-addr", bv, bd)
@@ -203,6 +211,27 @@ func mdweHeld(e probeEnv) (detail string, ok bool) {
return fmt.Sprintf("mmap(PROT_WRITE|PROT_EXEC) = %v", err), false
}
+// syscallFilterHeld is the syscall-filter line (#527 Q5): io_uring_setup
+// and keyctl both answer ENOSYS, the units' SystemCallErrorNumber=, so the
+// filter is in force. keyctl is the presence check: it reaches the kernel
+// for any unprivileged process on a kernel with keys, so an io_uring
+// refused only by kernel.io_uring_disabled (EPERM) does not pass. Any
+// other answer, success included, names the call and fails.
+func syscallFilterHeld(e probeEnv) (detail string, ok bool) {
+ ok = true
+ var bad []string
+ for _, c := range []struct {
+ name string
+ call func() error
+ }{{"io_uring_setup", e.ioUringSetup}, {"keyctl", e.keyctl}} {
+ if err := c.call(); !errors.Is(err, syscall.ENOSYS) {
+ ok = false
+ bad = append(bad, fmt.Sprintf("%s = %v, want ENOSYS", c.name, err))
+ }
+ }
+ return strings.Join(bad, "; "), ok
+}
+
// ptsPrivate is the pts-private line (Plan 2 deviation 8): the private
// /dev carries no terminal of the host's. /dev/pts lists nothing and
// /dev/ptmx cannot be opened, so no pty can be made or reached from in
diff --git a/internal/instanceexec/probe_hardening_linux.go b/internal/instanceexec/probe_hardening_linux.go
index 458c38a1d..98f614e96 100644
--- a/internal/instanceexec/probe_hardening_linux.go
+++ b/internal/instanceexec/probe_hardening_linux.go
@@ -4,6 +4,7 @@ package instanceexec
import (
"os"
+ "unsafe"
"golang.org/x/sys/unix"
)
@@ -20,3 +21,29 @@ func realMmapWX() error {
}
return unix.Munmap(b)
}
+
+// realIOUringSetup asks for a ring of zero entries: a kernel that receives
+// the call refuses it (EINVAL or EFAULT) without making a ring, and the
+// tenant syscall filter answers ENOSYS before it gets there. Should a
+// kernel ever return a ring fd, it is closed at once.
+func realIOUringSetup() error {
+ var params [120]byte // struct io_uring_params
+ fd, _, errno := unix.Syscall(unix.SYS_IO_URING_SETUP, 0, uintptr(unsafe.Pointer(&params)), 0)
+ if errno != 0 {
+ return errno
+ }
+ _ = unix.Close(int(fd))
+ return nil
+}
+
+// realKeyctl asks for this process's own keyring id without creating it
+// (KEYCTL_GET_KEYRING_ID, KEY_SPEC_PROCESS_KEYRING, create 0): it reaches
+// the kernel for any process, answering an id or ENOKEY, unless the
+// tenant syscall filter refuses it with ENOSYS.
+func realKeyctl() error {
+ _, _, errno := unix.Syscall(unix.SYS_KEYCTL, unix.KEYCTL_GET_KEYRING_ID, uintptr(^uint(1)), 0) // -2
+ if errno != 0 {
+ return errno
+ }
+ return nil
+}
diff --git a/internal/instanceexec/probe_hardening_other.go b/internal/instanceexec/probe_hardening_other.go
index 53f37a833..ba7a503eb 100644
--- a/internal/instanceexec/probe_hardening_other.go
+++ b/internal/instanceexec/probe_hardening_other.go
@@ -5,3 +5,7 @@ package instanceexec
import "errors"
func realMmapWX() error { return errors.ErrUnsupported }
+
+func realIOUringSetup() error { return errors.ErrUnsupported }
+
+func realKeyctl() error { return errors.ErrUnsupported }
diff --git a/internal/instanceexec/probe_rootfs_test.go b/internal/instanceexec/probe_rootfs_test.go
index b816de6b8..864b84c4b 100644
--- a/internal/instanceexec/probe_rootfs_test.go
+++ b/internal/instanceexec/probe_rootfs_test.go
@@ -193,7 +193,7 @@ func TestRootfsProbePassesInsideAnImageRoot(t *testing.T) {
if !r.Ready {
t.Fatalf("not ready: %+v", r.Lines)
}
- for _, c := range []string{"root-image", "mounts-allowlisted", "data-tree", "run-tree", "opt-own-image", "launch-root-owned", "root-read-only", "tmp-private", "etc-carlos", "control-unreachable", "pid1", "shm-private", "symlink-eloop", "nosymfollow", "imds-v4", "imds-tcp", "cgroup-strict", "pts-private", "dns", "loopback-v4", "private-v4", "box-addr", "mdwe",
+ for _, c := range []string{"root-image", "mounts-allowlisted", "data-tree", "run-tree", "opt-own-image", "launch-root-owned", "root-read-only", "tmp-private", "etc-carlos", "control-unreachable", "pid1", "shm-private", "symlink-eloop", "nosymfollow", "imds-v4", "imds-tcp", "cgroup-strict", "pts-private", "dns", "loopback-v4", "private-v4", "box-addr", "mdwe", "syscall-filter",
"imds-v6", "resolver-ports", "loopback-v6", "private-v6", "ipc-private", "abstract-unix", "cpu-limits", "io-weight"} {
if v := verdict(r, c); v != "ok" {
t.Errorf("%s = %s: %s", c, v, detail(r, c))
diff --git a/internal/instanceexec/probe_test.go b/internal/instanceexec/probe_test.go
index 88f90241e..2868140cc 100644
--- a/internal/instanceexec/probe_test.go
+++ b/internal/instanceexec/probe_test.go
@@ -103,6 +103,11 @@ func goodEnv(t *testing.T) probeEnv {
// MemoryDenyWriteExecute=yes as systemd 257 sets it on a 6.3+
// kernel (PR_SET_MDWE).
mmapWX: func() error { return syscall.EACCES },
+ // The tenant syscall filter (#527 Q5), advertised by the unit and
+ // answering ENOSYS for io_uring and the keyring.
+ syscallFilterEnforced: true,
+ ioUringSetup: func() error { return syscall.ENOSYS },
+ keyctl: func() error { return syscall.ENOSYS },
}
}
@@ -131,7 +136,7 @@ func TestProbePassesOnAnIsolatedNamespace(t *testing.T) {
t.Fatalf("not ready: %+v", r.Lines)
}
for _, c := range []string{"data-tree", "run-tree", "var-empty", "pid1", "cgroup-ro", "cgroup-ro-mount", "control-unreachable", "etc-carlos", "shm-private", "symlink-eloop", "nosymfollow", "imds-v4", "imds-v6", "imds-tcp",
- "opt-own-build", "dns", "resolver-ports", "loopback-v4", "loopback-v6", "private-v4", "private-v6", "box-addr", "mdwe", "ipc-private", "abstract-unix", "cpu-limits", "io-weight", "pts-private"} {
+ "opt-own-build", "dns", "resolver-ports", "loopback-v4", "loopback-v6", "private-v4", "private-v6", "box-addr", "mdwe", "ipc-private", "abstract-unix", "cpu-limits", "io-weight", "pts-private", "syscall-filter"} {
if v := verdict(r, c); v != "ok" {
t.Errorf("%s = %s", c, v)
}
@@ -531,3 +536,47 @@ func TestProductionProbeEnvReadsThePtsAdvertisement(t *testing.T) {
t.Errorf("ProbePtsPrivateEnv = %q", instancectl.ProbePtsPrivateEnv)
}
}
+
+// The syscall-filter line (#527 Q5): io_uring_setup and keyctl both answer
+// ENOSYS inside the unit. keyctl is the presence check (it works for any
+// unprivileged process on a kernel with keys), so io_uring refused by
+// kernel.io_uring_disabled alone, a call that reaches the kernel, or any
+// other errno fails. A unit that does not advertise the filter, an old one
+// mid-roll, is unverified, never a pass.
+func TestProbeSyscallFilterLine(t *testing.T) {
+ for _, tc := range []struct {
+ name string
+ enforced bool
+ ioUring, keys error
+ want string
+ }{
+ {"held", true, syscall.ENOSYS, syscall.ENOSYS, "ok"},
+ {"io_uring reached the kernel", true, syscall.EINVAL, syscall.ENOSYS, "fail"},
+ {"io_uring only sysctl-disabled", true, syscall.EPERM, nil, "fail"},
+ {"keyring open", true, syscall.ENOSYS, nil, "fail"},
+ {"keyring other errno", true, syscall.ENOSYS, syscall.ENOKEY, "fail"},
+ {"unsupported platform", true, errors.ErrUnsupported, errors.ErrUnsupported, "fail"},
+ {"old unit mid-roll", false, syscall.EINVAL, nil, "unverified"},
+ } {
+ t.Run(tc.name, func(t *testing.T) {
+ e := goodEnv(t)
+ e.syscallFilterEnforced = tc.enforced
+ e.ioUringSetup = func() error { return tc.ioUring }
+ e.keyctl = func() error { return tc.keys }
+ r := runChecks(e)
+ if got := verdict(r, "syscall-filter"); got != tc.want {
+ t.Fatalf("binary probe syscall-filter = %s (%s), want %s", got, detail(r, "syscall-filter"), tc.want)
+ }
+ if tc.want == "fail" && r.Ready {
+ t.Fatal("a failed syscall-filter line left the probe ready")
+ }
+ re := goodRootfsEnv(t)
+ re.syscallFilterEnforced = tc.enforced
+ re.ioUringSetup = e.ioUringSetup
+ re.keyctl = e.keyctl
+ if got := verdict(runRootfsChecks(re), "syscall-filter"); got != tc.want {
+ t.Fatalf("rootfs probe syscall-filter = %s, want %s", got, tc.want)
+ }
+ })
+ }
+}
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index a2c022f12..d4b97253a 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -126,3 +126,4 @@ plan14-root-reads-static-sweep-periodic.tsv 3dc3f6657527133a251c028772315bdd333b
plan14-root-reads-agent-login-link.tsv e820ef22ac677cd49aa9ca3f70d6bca9dea061bce3184ca86f0a3fc98f8de0eb
plan14-root-reads-fix-activator-backoff-flake.tsv feba66806ddfcbdfaf369d72413bb18e75162263b6f82f117fccf1b75497986a
plan14-root-reads-region-ha-dr5.tsv f19eb78c1da1475cbf8e11a3d6c394d828aa1c8f88ae24469fe8d473581b934b
+plan14-root-reads-instance-syscall-filter.tsv b970bb28c5a633d2572a1da549030e9258cfdabb6322ddffdd0ebf41b56c464c
diff --git a/internal/provision/testdata/plan14-root-reads-instance-syscall-filter.tsv b/internal/provision/testdata/plan14-root-reads-instance-syscall-filter.tsv
new file mode 100644
index 000000000..28e18d8e3
--- /dev/null
+++ b/internal/provision/testdata/plan14-root-reads-instance-syscall-filter.tsv
@@ -0,0 +1,44 @@
+# 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.
+# 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
+@legacy 7a0f015dc6ad0d294650b2118cb6e3d34a1eb1e736a462a77cbc293bea3cd667 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
+@legacy 83e7b090b760de4ff5b1ed68979ed8e3e0c8336c01e9dc1ac001a1eb19794546 internal/host/units/carlos-instance-gen@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;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 c8e264952f10b7996616d511b07ccaa3ded8e08b62cf1641c170d623a911202a
+@legacy 8cf672a8ca2c8f42fee172e67c5467f365519363d51b017fd81934c980d37e31 internal/host/units/carlos-instance-probe.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-2;basis=one more BindReadOnlyPaths= line, so PID 1 opens one more bind source: /run/carlos-control/exe/_probe/box-addrs, bound to /opt/carlos/box-addrs, root's list of the box's own addresses, which RunProbe writes before every run (#367) in the root-only directory the unit already binds from; no tenant, app or agent input names or writes it;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, so the probe proves what the tenants get (its new pts-private line); fix round 1 (Astra P2, roll order): one line outside the namespace block, Environment=CARLOS_PROBE_PTS_PRIVATE=1, a constant the unit sets for its own process (the probe, as carlos, in the namespace); it names no path, adds no bind source or Exec line, and root reads nothing new;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, inside the shared namespace block; plus one line outside it, Environment=CARLOS_PROBE_SYSCALL_FILTER=1, a constant the unit sets for its own process (the probe, as carlos); it names no path file:external@0 af13bfd4563c31fe228b3ba71674861e96bc7f2054c1e6f6ab0734c4acfcca50
+@legacy 694b29fc421d01928959d17c7c417af793f196c5636c92c0d191271133b5fdff internal/host/units/carlos-instance-rootfs-cmd@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=a rootfs unit template (embedded in the carlos binary, installed under /etc/systemd/system by root's unit install as the other templates are, applied by PID 1 as root; its process runs as user carlos);basis=root-input (J4, as carlos-instance-cmd@.service, accepted at census-ruling-carlos-run): new (rootfs Plan 2 Task 4): the rootfs cmd unit (oneshot, TimeoutStartSec=6h5m, the cmd log sockets), binding /run/carlos-control/exe/%I/rootfs/cmd/. The template carries the binary template's hardening block restated for an image root (ProtectSystem=strict, the /data, /run/carlos and /opt/carlos tmpfs mounts read-only, PrivateDevices=, PrivateIPC=, ProtectControlGroups=strict, PrivatePIDs=, RestrictNamespaces=, NoNewPrivileges=, an empty CapabilityBoundingSet=, the IPAddressDeny= list, MemoryDenyWriteExecute=yes) plus RootImage= with RootImageOptions=ro,nosuid,nodev; what PID 1 mounts for it: the image, a link root's ensureRootfsExe made under /run/carlos-control/exe (root's, never in any instance's namespace) to the image validateStagedImage checked; root's launch.json and resolv.conf copy from the same root-only directory, read-only; the platform binary, read-only; the instance's own two directories. Provenance: the RootImage= path is fixed and root-controlled (a link root made to the image validateStagedImage checked), but the image's contents are tenant-built: PID 1 and the kernel mount a tenant-produced squashfs (read-only, nosuid, nodev) as the unit's root, after root has checked its bytes against root's own staged manifest; that mount is the new authority this template carries. The tenant also writes its own two directories; it names no path PID 1 or root opens;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 restated rootfs block (byte-identical across the rootfs units) file:external@0 d47e1a325ac56bbb28774f0467a025d8461cb2dcdc9d20a0c2ae501e76c22d94
+@legacy bee279b7f53765240c28a9cb20a265b074b8485722b99afb330fc3ebd51fce78 internal/host/units/carlos-instance-rootfs-gen@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=a rootfs unit template (embedded in the carlos binary, installed under /etc/systemd/system by root's unit install as the other templates are, applied by PID 1 as root; its process runs as user carlos);basis=root-input (J4, as carlos-instance-gen@.service): new (rootfs Plan 2 Task 4): a rootfs generation's template, the run template without Slice=, StandardOutput=, the instance's binds and RootImage=, which only root's per-start drop-in (RootfsGenDropIn) supplies, so the template alone mounts and runs nothing. The template carries the binary template's hardening block restated for an image root (ProtectSystem=strict, the /data, /run/carlos and /opt/carlos tmpfs mounts read-only, PrivateDevices=, PrivateIPC=, ProtectControlGroups=strict, PrivatePIDs=, RestrictNamespaces=, NoNewPrivileges=, an empty CapabilityBoundingSet=, the IPAddressDeny= list, MemoryDenyWriteExecute=yes) plus RootImageOptions=ro,nosuid,nodev, with no RootImage= of its own (root's per-start drop-in names the image); what PID 1 mounts for it: the image, a link root's ensureRootfsExe made under /run/carlos-control/exe (root's, never in any instance's namespace) to the image validateStagedImage checked; root's launch.json and resolv.conf copy from the same root-only directory, read-only; the platform binary, read-only; the instance's own two directories. Provenance: the RootImage= path is fixed and root-controlled (a link root made to the image validateStagedImage checked), but the image's contents are tenant-built: PID 1 and the kernel mount a tenant-produced squashfs (read-only, nosuid, nodev) as the unit's root, after root has checked its bytes against root's own staged manifest; that mount is the new authority this template carries. The tenant also writes its own two directories; it names no path PID 1 or root opens;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 restated rootfs block (byte-identical across the rootfs units) file:external@0 2c0a84a863fe53c8553d400ef87fdd950b13bcdd89eea69e102dfee605695177
+@legacy c6e8d6f5352069bcd8afee3303b3f00cd6444ee9e6334259905ec0b1619dc4cc internal/host/units/carlos-instance-rootfs-probe.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=the rootfs probe's unit (embedded in the carlos binary, installed by root's unit install, applied by PID 1 as root; its process, carlos instance-probe --rootfs, runs as user carlos);basis=root-input (J4, as carlos-instance-probe.service): new (rootfs Plan 2 Task 7): a oneshot on carlos-instances.slice with the same restated block, RootImage= the probe image root builds itself (BuildProbeImage, under /run/carlos-control/probe), the probe's own _probe directories, root's launch.json, resolv.conf copy and box-addrs list read-only from /run/carlos-control/exe/_probe/rootfs/run/, and StandardOutput=truncate:/run/carlos-control/rootfs-probe.out, which PID 1 writes and root reads (runRootfsProbe); no tenant image, file or name reaches 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, inside the rootfs block; plus one line outside it, Environment=CARLOS_PROBE_SYSCALL_FILTER=1, a constant the unit sets for its own process (the probe, as carlos); it names no path file:external@0 68ed83bb550112a6ebfc22b2eaad0fd0b9f405613f07d75b640e52e296e63eed
+@legacy 8ebae8a03430759bff141bb0b726443334b9c19a03bdb8b904b2f1ccdd3f0514 internal/host/units/carlos-instance-rootfs-tty@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5, new: the rootfs tty template, carlos-instance-rootfs-cmd@.service outside named lines held by TestRootfsTTYTemplateEqualsRootfsCmdOutsideTheNamedLines: Description (tty), ExecStart/ExecStopPost instance-exec/instance-exit --rootfs tty %I, StandardInput=file:/run/carlos/logs/%I.tty.sock with StandardOutput/StandardError=journal, and RootImage plus the two BindReadOnlyPaths sources under /run/carlos-control/exe/%I/rootfs/tty/ (root-only exe layout) instead of rootfs/cmd/. The rootfs namespace block byte for byte (TestRootfsTemplatesShareOneNamespace), runs as carlos, binds only the instance own and root paths (TestRootfsTemplatesBindOnlyTheInstancesOwnAndRoots). Task 6: POST /tty runtime=rootfs (startRootfsCmd with RoleTTY) starts it through Plan 2's rootfs one-shot path (preflight, validateStagedImage, ensureRootfsExe under rootfs/tty/, jit drop-in and owed reload, post-start MemoryDenyWriteExecute check); its files go only through removeRootfsUnitFiles (stopRootfs and cleanCmdExe with RoleTTY, the sweep);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 restated rootfs block (byte-identical across the rootfs units) file:external@0 64552fe1728fca085a4d3b455d82ff7075b8378fa148235e61775a87028d0fb3
+@legacy 9b4783650b27d9a07eb3f73fa31dc557d32bcad2ba28b68b03b559cf3fada354 internal/host/units/carlos-instance-rootfs-worker@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=a rootfs unit template (embedded in the carlos binary, installed under /etc/systemd/system by root's unit install as the other templates are, applied by PID 1 as root; its process runs as user carlos);basis=root-input (J4, as carlos-instance-gen@.service): new (rootfs Plan 2 Task 4): a rootfs worker's template, the run template without Slice=, StandardOutput=, the instance's binds and RootImage=, which only root's per-start drop-in (WorkerDropIn) supplies. The template carries the binary template's hardening block restated for an image root (ProtectSystem=strict, the /data, /run/carlos and /opt/carlos tmpfs mounts read-only, PrivateDevices=, PrivateIPC=, ProtectControlGroups=strict, PrivatePIDs=, RestrictNamespaces=, NoNewPrivileges=, an empty CapabilityBoundingSet=, the IPAddressDeny= list, MemoryDenyWriteExecute=yes) plus RootImageOptions=ro,nosuid,nodev, with no RootImage= of its own (root's per-start drop-in names the image); what PID 1 mounts for it: the image, a link root's ensureRootfsExe made under /run/carlos-control/exe (root's, never in any instance's namespace) to the image validateStagedImage checked; root's launch.json and resolv.conf copy from the same root-only directory, read-only; the platform binary, read-only; the instance's own two directories. Provenance: the RootImage= path is fixed and root-controlled (a link root made to the image validateStagedImage checked), but the image's contents are tenant-built: PID 1 and the kernel mount a tenant-produced squashfs (read-only, nosuid, nodev) as the unit's root, after root has checked its bytes against root's own staged manifest; that mount is the new authority this template carries. The tenant also writes its own two directories; it names no path PID 1 or root opens;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 restated rootfs block (byte-identical across the rootfs units) file:external@0 fcde2ad9fa1e0d547f76e3b1eade7381bcc68d78863508541f70c3dd63b82258
+@legacy cfb1e28c469a7354e86df2b60b05ff8d221e0c3162c024bc7b3587a4c8fd58a0 internal/host/units/carlos-instance-rootfs@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=a rootfs unit template (embedded in the carlos binary, installed under /etc/systemd/system by root's unit install as the other templates are, applied by PID 1 as root; its process runs as user carlos);basis=root-input (J4, as carlos-instance@.service): new (rootfs Plan 2 Task 4): the run unit of a rootfs instance (ExecStart= the trampoline with --rootfs run, ExecStopPost= instance-exit --rootfs run), Slice=carlos-instances-%i.slice, binding /run/carlos-control/exe/%I/rootfs/run/. The template carries the binary template's hardening block restated for an image root (ProtectSystem=strict, the /data, /run/carlos and /opt/carlos tmpfs mounts read-only, PrivateDevices=, PrivateIPC=, ProtectControlGroups=strict, PrivatePIDs=, RestrictNamespaces=, NoNewPrivileges=, an empty CapabilityBoundingSet=, the IPAddressDeny= list, MemoryDenyWriteExecute=yes) plus RootImage= with RootImageOptions=ro,nosuid,nodev; what PID 1 mounts for it: the image, a link root's ensureRootfsExe made under /run/carlos-control/exe (root's, never in any instance's namespace) to the image validateStagedImage checked; root's launch.json and resolv.conf copy from the same root-only directory, read-only; the platform binary, read-only; the instance's own two directories. Provenance: the RootImage= path is fixed and root-controlled (a link root made to the image validateStagedImage checked), but the image's contents are tenant-built: PID 1 and the kernel mount a tenant-produced squashfs (read-only, nosuid, nodev) as the unit's root, after root has checked its bytes against root's own staged manifest; that mount is the new authority this template carries. The tenant also writes its own two directories; it names no path PID 1 or root opens;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 restated rootfs block (byte-identical across the rootfs units) file:external@0 c26adc1d3576d59bfe40be9aa7e1fced41672473e5440796002b2dd9b8758efa
+@legacy b794adbc4ae2fbcf5b6069395f26c37fe95e53869eb0bfcb64c734608357082a internal/host/units/carlos-instance-seed@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;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 8ec7960829f6a0a5b205ee618544cbf48bfa1094aff468fcf4977a1a41443d6f
+@legacy aa845d0b3b71ef56e9a3c303b3a714245e22cab7cd218713404342045b728ca1 internal/host/units/carlos-instance-sidecar@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;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 cdfcc361fbc119e1bb1343957bbd897faa1dd7a8868d6203f6ebff887e8f83d1
+@legacy e28294c0ce566b2153dca3d9b5ee83bccea3dde9bf241a40fec31b2d30b7c946 internal/host/units/carlos-instance-tty@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5, new: the binary tty template, carlos-instance-cmd@.service outside six named lines held by TestTTYTemplateEqualsCmdOutsideTheNamedLines: Description (tty), ExecStart/ExecStopPost instance-exec/instance-exit tty %I (the same root binary as every template), StandardInput=file:/run/carlos/logs/%I.tty.sock replacing the cmd StandardOutput socket (PID 1 opens it as root on the nosymfollow logs mount, as the cmd streams), StandardOutput=journal, StandardError=journal, and BindReadOnlyPaths sources tty-app/tty-live under /run/carlos-control/exe/%I (root-only exe layout, as cmd-app/cmd-live). Same namespace block byte for byte, runs as carlos. Task 6: POST /tty (handleOneShot(RoleTTY), claimAwareLegacy) starts it, after the role lock, the loaded-state refusal and refuseStagedExe; the tty-app/tty-live sources are laid out by ensureCmdExeAt(RoleTTY) and removed by removeCmdExe(RoleTTY) at /stop role=tty and /sweep;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 0f979d198da97b01ac360cc1ecaa8ff1163e16dce9071cd2e419944af8738768
+@legacy 42bfffe12d4bd699d45e6714b6b876e35ee297a86f4edead68d4cac342772eea internal/host/units/carlos-instance@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: one namespace-block line added after TemporaryFileSystem=/dev/mqueue:ro, TemporaryFileSystem=/dev/pts:ro (with its comment): PID 1 mounts an empty read-only tmpfs over the private /dev/pts, hiding the host devpts PrivateDevices= binds in; no bind source, Exec line, user or path read by root added; the block stays byte-identical across the binary templates (TestInstanceTemplatesShareOneNamespace);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 ce578195b1e412403b3787a56c0e54fe4ad9ce053a7b5a76dfd967850e844791
+@legacy 64810b1a4f182f57aa116a876a87160f89dc3fff560d9ab8dee7959b5285c671 internal/instanceexec/probe.go productionProbeEnv legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-2;basis=the binary probe's env gains boxAddrs (instancectl.BoxAddrsPath, /opt/carlos/box-addrs), which boxAddrClosed (a decision row) reads inside the probe unit, and mmapWX (realMmapWX, an anonymous mapping); the same one direct site;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5 (PF-8): the binary probe env sets devPts=/dev/pts and openPtmx (open /dev/ptmx O_RDWR|O_NOCTTY and close at once), the fields the rootfs probe env already set; read by the new pts-private line inside the probe unit (as carlos, in the namespace); fix round 1: also reads its own environment, CARLOS_PROBE_PTS_PRIVATE (exactly "1" enforces pts-private; otherwise the line is reported unverified), which the probe unit sets; the same direct site, no new root read;rev3=census-ruling-instance-syscall-filter;basis=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 data-literal@67 6567b5c0cbfb6590eacbaac2f868fa27bdefe586efb1ed999942d0661e188887
+@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/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
+internal/host/units/carlos-instance-gen@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;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 c8e264952f10b7996616d511b07ccaa3ded8e08b62cf1641c170d623a911202a
+internal/host/units/carlos-instance-probe.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-2;basis=one more BindReadOnlyPaths= line, so PID 1 opens one more bind source: /run/carlos-control/exe/_probe/box-addrs, bound to /opt/carlos/box-addrs, root's list of the box's own addresses, which RunProbe writes before every run (#367) in the root-only directory the unit already binds from; no tenant, app or agent input names or writes it;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, so the probe proves what the tenants get (its new pts-private line); fix round 1 (Astra P2, roll order): one line outside the namespace block, Environment=CARLOS_PROBE_PTS_PRIVATE=1, a constant the unit sets for its own process (the probe, as carlos, in the namespace); it names no path, adds no bind source or Exec line, and root reads nothing new;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, inside the shared namespace block; plus one line outside it, Environment=CARLOS_PROBE_SYSCALL_FILTER=1, a constant the unit sets for its own process (the probe, as carlos); it names no path file:external@0 af13bfd4563c31fe228b3ba71674861e96bc7f2054c1e6f6ab0734c4acfcca50
+internal/host/units/carlos-instance-rootfs-cmd@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=a rootfs unit template (embedded in the carlos binary, installed under /etc/systemd/system by root's unit install as the other templates are, applied by PID 1 as root; its process runs as user carlos);basis=root-input (J4, as carlos-instance-cmd@.service, accepted at census-ruling-carlos-run): new (rootfs Plan 2 Task 4): the rootfs cmd unit (oneshot, TimeoutStartSec=6h5m, the cmd log sockets), binding /run/carlos-control/exe/%I/rootfs/cmd/. The template carries the binary template's hardening block restated for an image root (ProtectSystem=strict, the /data, /run/carlos and /opt/carlos tmpfs mounts read-only, PrivateDevices=, PrivateIPC=, ProtectControlGroups=strict, PrivatePIDs=, RestrictNamespaces=, NoNewPrivileges=, an empty CapabilityBoundingSet=, the IPAddressDeny= list, MemoryDenyWriteExecute=yes) plus RootImage= with RootImageOptions=ro,nosuid,nodev; what PID 1 mounts for it: the image, a link root's ensureRootfsExe made under /run/carlos-control/exe (root's, never in any instance's namespace) to the image validateStagedImage checked; root's launch.json and resolv.conf copy from the same root-only directory, read-only; the platform binary, read-only; the instance's own two directories. Provenance: the RootImage= path is fixed and root-controlled (a link root made to the image validateStagedImage checked), but the image's contents are tenant-built: PID 1 and the kernel mount a tenant-produced squashfs (read-only, nosuid, nodev) as the unit's root, after root has checked its bytes against root's own staged manifest; that mount is the new authority this template carries. The tenant also writes its own two directories; it names no path PID 1 or root opens;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 restated rootfs block (byte-identical across the rootfs units) file:external@0 d47e1a325ac56bbb28774f0467a025d8461cb2dcdc9d20a0c2ae501e76c22d94
+internal/host/units/carlos-instance-rootfs-gen@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=a rootfs unit template (embedded in the carlos binary, installed under /etc/systemd/system by root's unit install as the other templates are, applied by PID 1 as root; its process runs as user carlos);basis=root-input (J4, as carlos-instance-gen@.service): new (rootfs Plan 2 Task 4): a rootfs generation's template, the run template without Slice=, StandardOutput=, the instance's binds and RootImage=, which only root's per-start drop-in (RootfsGenDropIn) supplies, so the template alone mounts and runs nothing. The template carries the binary template's hardening block restated for an image root (ProtectSystem=strict, the /data, /run/carlos and /opt/carlos tmpfs mounts read-only, PrivateDevices=, PrivateIPC=, ProtectControlGroups=strict, PrivatePIDs=, RestrictNamespaces=, NoNewPrivileges=, an empty CapabilityBoundingSet=, the IPAddressDeny= list, MemoryDenyWriteExecute=yes) plus RootImageOptions=ro,nosuid,nodev, with no RootImage= of its own (root's per-start drop-in names the image); what PID 1 mounts for it: the image, a link root's ensureRootfsExe made under /run/carlos-control/exe (root's, never in any instance's namespace) to the image validateStagedImage checked; root's launch.json and resolv.conf copy from the same root-only directory, read-only; the platform binary, read-only; the instance's own two directories. Provenance: the RootImage= path is fixed and root-controlled (a link root made to the image validateStagedImage checked), but the image's contents are tenant-built: PID 1 and the kernel mount a tenant-produced squashfs (read-only, nosuid, nodev) as the unit's root, after root has checked its bytes against root's own staged manifest; that mount is the new authority this template carries. The tenant also writes its own two directories; it names no path PID 1 or root opens;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 restated rootfs block (byte-identical across the rootfs units) file:external@0 2c0a84a863fe53c8553d400ef87fdd950b13bcdd89eea69e102dfee605695177
+internal/host/units/carlos-instance-rootfs-probe.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=the rootfs probe's unit (embedded in the carlos binary, installed by root's unit install, applied by PID 1 as root; its process, carlos instance-probe --rootfs, runs as user carlos);basis=root-input (J4, as carlos-instance-probe.service): new (rootfs Plan 2 Task 7): a oneshot on carlos-instances.slice with the same restated block, RootImage= the probe image root builds itself (BuildProbeImage, under /run/carlos-control/probe), the probe's own _probe directories, root's launch.json, resolv.conf copy and box-addrs list read-only from /run/carlos-control/exe/_probe/rootfs/run/, and StandardOutput=truncate:/run/carlos-control/rootfs-probe.out, which PID 1 writes and root reads (runRootfsProbe); no tenant image, file or name reaches 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, inside the rootfs block; plus one line outside it, Environment=CARLOS_PROBE_SYSCALL_FILTER=1, a constant the unit sets for its own process (the probe, as carlos); it names no path file:external@0 68ed83bb550112a6ebfc22b2eaad0fd0b9f405613f07d75b640e52e296e63eed
+internal/host/units/carlos-instance-rootfs-tty@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5, new: the rootfs tty template, carlos-instance-rootfs-cmd@.service outside named lines held by TestRootfsTTYTemplateEqualsRootfsCmdOutsideTheNamedLines: Description (tty), ExecStart/ExecStopPost instance-exec/instance-exit --rootfs tty %I, StandardInput=file:/run/carlos/logs/%I.tty.sock with StandardOutput/StandardError=journal, and RootImage plus the two BindReadOnlyPaths sources under /run/carlos-control/exe/%I/rootfs/tty/ (root-only exe layout) instead of rootfs/cmd/. The rootfs namespace block byte for byte (TestRootfsTemplatesShareOneNamespace), runs as carlos, binds only the instance own and root paths (TestRootfsTemplatesBindOnlyTheInstancesOwnAndRoots). Task 6: POST /tty runtime=rootfs (startRootfsCmd with RoleTTY) starts it through Plan 2's rootfs one-shot path (preflight, validateStagedImage, ensureRootfsExe under rootfs/tty/, jit drop-in and owed reload, post-start MemoryDenyWriteExecute check); its files go only through removeRootfsUnitFiles (stopRootfs and cleanCmdExe with RoleTTY, the sweep);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 restated rootfs block (byte-identical across the rootfs units) file:external@0 64552fe1728fca085a4d3b455d82ff7075b8378fa148235e61775a87028d0fb3
+internal/host/units/carlos-instance-rootfs-worker@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=a rootfs unit template (embedded in the carlos binary, installed under /etc/systemd/system by root's unit install as the other templates are, applied by PID 1 as root; its process runs as user carlos);basis=root-input (J4, as carlos-instance-gen@.service): new (rootfs Plan 2 Task 4): a rootfs worker's template, the run template without Slice=, StandardOutput=, the instance's binds and RootImage=, which only root's per-start drop-in (WorkerDropIn) supplies. The template carries the binary template's hardening block restated for an image root (ProtectSystem=strict, the /data, /run/carlos and /opt/carlos tmpfs mounts read-only, PrivateDevices=, PrivateIPC=, ProtectControlGroups=strict, PrivatePIDs=, RestrictNamespaces=, NoNewPrivileges=, an empty CapabilityBoundingSet=, the IPAddressDeny= list, MemoryDenyWriteExecute=yes) plus RootImageOptions=ro,nosuid,nodev, with no RootImage= of its own (root's per-start drop-in names the image); what PID 1 mounts for it: the image, a link root's ensureRootfsExe made under /run/carlos-control/exe (root's, never in any instance's namespace) to the image validateStagedImage checked; root's launch.json and resolv.conf copy from the same root-only directory, read-only; the platform binary, read-only; the instance's own two directories. Provenance: the RootImage= path is fixed and root-controlled (a link root made to the image validateStagedImage checked), but the image's contents are tenant-built: PID 1 and the kernel mount a tenant-produced squashfs (read-only, nosuid, nodev) as the unit's root, after root has checked its bytes against root's own staged manifest; that mount is the new authority this template carries. The tenant also writes its own two directories; it names no path PID 1 or root opens;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 restated rootfs block (byte-identical across the rootfs units) file:external@0 fcde2ad9fa1e0d547f76e3b1eade7381bcc68d78863508541f70c3dd63b82258
+internal/host/units/carlos-instance-rootfs@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=a rootfs unit template (embedded in the carlos binary, installed under /etc/systemd/system by root's unit install as the other templates are, applied by PID 1 as root; its process runs as user carlos);basis=root-input (J4, as carlos-instance@.service): new (rootfs Plan 2 Task 4): the run unit of a rootfs instance (ExecStart= the trampoline with --rootfs run, ExecStopPost= instance-exit --rootfs run), Slice=carlos-instances-%i.slice, binding /run/carlos-control/exe/%I/rootfs/run/. The template carries the binary template's hardening block restated for an image root (ProtectSystem=strict, the /data, /run/carlos and /opt/carlos tmpfs mounts read-only, PrivateDevices=, PrivateIPC=, ProtectControlGroups=strict, PrivatePIDs=, RestrictNamespaces=, NoNewPrivileges=, an empty CapabilityBoundingSet=, the IPAddressDeny= list, MemoryDenyWriteExecute=yes) plus RootImage= with RootImageOptions=ro,nosuid,nodev; what PID 1 mounts for it: the image, a link root's ensureRootfsExe made under /run/carlos-control/exe (root's, never in any instance's namespace) to the image validateStagedImage checked; root's launch.json and resolv.conf copy from the same root-only directory, read-only; the platform binary, read-only; the instance's own two directories. Provenance: the RootImage= path is fixed and root-controlled (a link root made to the image validateStagedImage checked), but the image's contents are tenant-built: PID 1 and the kernel mount a tenant-produced squashfs (read-only, nosuid, nodev) as the unit's root, after root has checked its bytes against root's own staged manifest; that mount is the new authority this template carries. The tenant also writes its own two directories; it names no path PID 1 or root opens;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 restated rootfs block (byte-identical across the rootfs units) file:external@0 c26adc1d3576d59bfe40be9aa7e1fced41672473e5440796002b2dd9b8758efa
+internal/host/units/carlos-instance-seed@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;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 8ec7960829f6a0a5b205ee618544cbf48bfa1094aff468fcf4977a1a41443d6f
+internal/host/units/carlos-instance-sidecar@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;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 cdfcc361fbc119e1bb1343957bbd897faa1dd7a8868d6203f6ebff887e8f83d1
+internal/host/units/carlos-instance-tty@.service external legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5, new: the binary tty template, carlos-instance-cmd@.service outside six named lines held by TestTTYTemplateEqualsCmdOutsideTheNamedLines: Description (tty), ExecStart/ExecStopPost instance-exec/instance-exit tty %I (the same root binary as every template), StandardInput=file:/run/carlos/logs/%I.tty.sock replacing the cmd StandardOutput socket (PID 1 opens it as root on the nosymfollow logs mount, as the cmd streams), StandardOutput=journal, StandardError=journal, and BindReadOnlyPaths sources tty-app/tty-live under /run/carlos-control/exe/%I (root-only exe layout, as cmd-app/cmd-live). Same namespace block byte for byte, runs as carlos. Task 6: POST /tty (handleOneShot(RoleTTY), claimAwareLegacy) starts it, after the role lock, the loaded-state refusal and refuseStagedExe; the tty-app/tty-live sources are laid out by ensureCmdExeAt(RoleTTY) and removed by removeCmdExe(RoleTTY) at /stop role=tty and /sweep;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 0f979d198da97b01ac360cc1ecaa8ff1163e16dce9071cd2e419944af8738768
+internal/host/units/carlos-instance@.service external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5: one namespace-block line added after TemporaryFileSystem=/dev/mqueue:ro, TemporaryFileSystem=/dev/pts:ro (with its comment): PID 1 mounts an empty read-only tmpfs over the private /dev/pts, hiding the host devpts PrivateDevices= binds in; no bind source, Exec line, user or path read by root added; the block stays byte-identical across the binary templates (TestInstanceTemplatesShareOneNamespace);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 ce578195b1e412403b3787a56c0e54fe4ad9ce053a7b5a76dfd967850e844791
+internal/instanceexec/probe.go productionProbeEnv legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-rootfs-apps-2;basis=the binary probe's env gains boxAddrs (instancectl.BoxAddrsPath, /opt/carlos/box-addrs), which boxAddrClosed (a decision row) reads inside the probe unit, and mmapWX (realMmapWX, an anonymous mapping); the same one direct site;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 5 (PF-8): the binary probe env sets devPts=/dev/pts and openPtmx (open /dev/ptmx O_RDWR|O_NOCTTY and close at once), the fields the rootfs probe env already set; read by the new pts-private line inside the probe unit (as carlos, in the namespace); fix round 1: also reads its own environment, CARLOS_PROBE_PTS_PRIVATE (exactly "1" enforces pts-private; otherwise the line is reported unverified), which the probe unit sets; the same direct site, no new root read;rev3=census-ruling-instance-syscall-filter;basis=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 data-literal@67 6567b5c0cbfb6590eacbaac2f868fa27bdefe586efb1ed999942d0661e188887
+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/units 0f3b763de100e60301993cd4ae1dabae776ac8448387b11944a241943df93d36
+@coverage internal/instancectl f9a40e824a188205317b84c8381d42c2825bc51e36e5f42aa96932f9d906f49a
+@coverage internal/instanceexec 119cb0b74c3f1f4990cb983c142c4e94dc04bc1c2dc645410ec6a01138388930