carlos / platform Public

rootfs netlink: review round 1 fixes and the docs line (#1419)

Fable R1 and Astra R1, both READY AFTER FIXES, no P1:
- The five tenant units pass --netlink-scope; a carlos from before #1419
  exits on the unknown flag, so AF_NETLINK never reaches an unscoped
  tenant (Fable P2-1).
- TestEveryRootfsLaunchIsScoped: execRootfsLaunch is only called inside
  rootfsStart(ScopeNetlinkRoute, ...) (Fable P2-2, Astra P2-2).
- The filter refuses socketpair(AF_NETLINK, ...) (Fable P3-1).
- A BPF interpreter test runs the program for amd64 and arm64 numbers,
  high-word arguments, x32 and foreign arches (Astra P2-1); the kernel
  test checks a second locked thread for TSYNC and compares inet/unix
  to an unscoped baseline (Astra P2-2, Fable P3-4).
- Probe: netlink-route makes glibc getifaddrs's RTM_GETLINK and
  RTM_GETADDR dumps (Astra P2-3); netlink-readonly deletes an address
  that does not exist and wants EPERM (Fable P3-3).
- The unit comment says what route lets a tenant read (Fable P3-2).

Docs: RFS-4-C156 on the Rootfs page's Network section (Luna pass under
Paul's delegation, one fact corrected). Census overlay re-proposed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev a8c20f675805eb3920217cfbbdb45faec43afa4c parent d57f46a
22 files changed, +437 −103
  • approved_rootfs_copy_test.go +4 −2
  • docs/site/rootfs.md +2 −0
  • docs/superpowers/notes/census-proposal-rootfs-netlink-route-1419.md +7 −7
  • docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md +7 −2
  • internal/host/units/carlos-instance-rootfs-cmd@.service +8 −2
  • internal/host/units/carlos-instance-rootfs-gen@.service +8 −2
  • internal/host/units/carlos-instance-rootfs-probe.service +4 −1
  • internal/host/units/carlos-instance-rootfs-tty@.service +8 −2
  • internal/host/units/carlos-instance-rootfs-worker@.service +8 −2
  • internal/host/units/carlos-instance-rootfs@.service +8 −2
  • internal/host/units_rootfs_test.go +7 −7
  • internal/instanceexec/exec.go +7 −0
  • internal/instanceexec/exec_rootfs_scope_test.go +82 −0
  • internal/instanceexec/families_test.go +1 −1
  • internal/instanceexec/netlink_route_linux.go +87 −16
  • internal/instanceexec/netlink_route_linux_test.go +150 −34
  • internal/instanceexec/probe_rootfs.go +13 −4
  • internal/instanceexec/probe_rootfs_linux.go +1 −0
  • internal/instanceexec/probe_rootfs_other.go +1 −0
  • internal/instanceexec/probe_rootfs_test.go +7 −2
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-rootfs-netlink-route-1419.tsv +16 −16

CI cancelled — superseded by a newer push — run details

CI log
=== gate ===
go: downloading go1.26.10 (linux/arm64)
go version go1.26.10 linux/arm64
opentofu: arm64, tofu 1.13.9, aws 6.73.0, archive 2.8.1
  tofu: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/tofu_1.13.9_linux_arm64.tar.gz
  tofu: downloaded, digest verified
  aws: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/terraform-provider-aws_6.73.0_linux_arm64.zip
  aws: downloaded, digest verified
  archive: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/terraform-provider-archive_2.8.1_linux_arm64.zip
  archive: downloaded, digest verified
  installed in /tmp/carlos-opentofu-jhzRjC
.amadan/test-gate.sh
go: downloading github.com/aws/aws-sdk-go-v2 v1.44.0
go: downloading github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.68.0
go: downloading github.com/aws/aws-sdk-go-v2/service/s3 v1.105.0
go: downloading github.com/aws/smithy-go v1.28.1
go: downloading github.com/aws/aws-sdk-go-v2/service/costexplorer v1.67.5
go: downloading github.com/benbjohnson/litestream v0.5.14
go: downloading github.com/superfly/ltx v0.5.1
go: downloading golang.org/x/net v0.62.0
go: downloading modernc.org/sqlite v1.55.0
go: downloading golang.org/x/crypto v0.58.0
go: downloading github.com/aws/aws-sdk-go-v2/service/ec2 v1.324.0
go: downloading github.com/aws/aws-sdk-go-v2/service/iam v1.58.2
go: downloading github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.37.0
go: downloading golang.org/x/sys v0.49.0
go: downloading github.com/aws/aws-sdk-go-v2/config v1.32.6
go: downloading golang.org/x/mod v0.41.0
go: downloading github.com/pion/logging v0.2.4
go: downloading github.com/pion/stun/v3 v3.1.5
go: downloading github.com/pion/turn/v4 v4.1.4
go: downloading github.com/pion/dtls/v3 v3.1.4
go: downloading github.com/pion/transport/v4 v4.0.2
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading github.com/klauspost/compress v1.20.2
go: downloading github.com/wlynxg/anet v0.0.5
go: downloading golang.org/x/sync v0.24.0
go: downloading github.com/prometheus/client_golang v1.17.0
go: downloading github.com/lmittmann/tint v1.1.3
go: downloading github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.20.18
go: downloading golang.org/x/text v0.43.0
go: downloading github.com/prometheus/client_model v0.5.0
go: downloading github.com/prometheus/common v0.45.0
go: downloading google.golang.org/protobuf v1.36.10
go: downloading github.com/beorn7/perks v1.0.1
go: downloading github.com/cespare/xxhash/v2 v2.3.0
go: downloading github.com/prometheus/procfs v0.12.0
go: downloading github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.23
go: downloading github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.31
go: downloading github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0
go: downloading github.com/klauspost/compress v1.20.2
go: downloading modernc.org/sqlite v1.55.0
go: downloading golang.org/x/crypto/x509roots/fallback v0.0.0-20260209214922-2f26647a795e
go: downloading github.com/aws/aws-sdk-go-v2/service/ecs v1.91.0
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading modernc.org/libc v1.74.1
go: downloading modernc.org/libc v1.74.1
go: downloading github.com/dustin/go-humanize v1.0.1
go: downloading github.com/google/uuid v1.6.0
go: downloading modernc.org/mathutil v1.7.1
go: downloading modernc.org/mathutil v1.7.1
go: downloading github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec

amadan: job cancelled — a newer push superseded it

Intent

Human

<task-notification> <task-id>bc27tsoaj</task-id> <tool-use-id>toolu_01TPZLC8gfVepXLG5Q8v5pUP</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/07c1c3c2-c3f5-4715-929e-caf930c5532c/tasks/bc27tsoaj.output</output-file> <status>completed</status> <summary>Background command "Run Fable review round 1" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>bs8d7fl7x</task-id> <tool-use-id>toolu_01UqGYbKqZB48CwLTs8X7LDQ</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/07c1c3c2-c3f5-4715-929e-caf930c5532c/tasks/bs8d7fl7x.output</output-file> <status>completed</status> <summary>Background command "Re-run Fable review round 1 via stdin" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>b2jp0z57i</task-id> <tool-use-id>toolu_012a7YqX6J857fFGoPEGyYSR</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/07c1c3c2-c3f5-4715-929e-caf930c5532c/tasks/b2jp0z57i.output</output-file> <status>completed</status> <summary>Background command "Wait for Astra report file" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>bv9uztatn</task-id> <tool-use-id>toolu_01CHH7sFwDVvqdC8xjpeN6DX</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/07c1c3c2-c3f5-4715-929e-caf930c5532c/tasks/bv9uztatn.output</output-file> <status>completed</status> <summary>Background command "Run Astra review round 1" completed (exit code 0)</summary> </task-notification>

Attributed to this commit: 37.0 g CO₂e (4,274,522 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on rootfs-netlink-route-1419, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.

diff --git a/approved_rootfs_copy_test.go b/approved_rootfs_copy_test.go
index de55a3986..c8b988523 100644
--- a/approved_rootfs_copy_test.go
+++ b/approved_rootfs_copy_test.go
@@ -21,7 +21,7 @@ import (
const rootfsCopyRecordPath = "docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md"
// Canonical ids only: two digits from C01 to C99, three digits from C100
-// (Plan 4 runs to RFS-4-C146; RFS-4-C147 is the rootfs-default-home follow-up, RFS-4-C155 the /etc/hosts one). No leading zero on a three-digit id, no C00.
+// (Plan 4 runs to RFS-4-C146; RFS-4-C147 is the rootfs-default-home follow-up, RFS-4-C155 the /etc/hosts one, RFS-4-C156 the netlink one). No leading zero on a three-digit id, no C00.
var rootfsCopyIDPattern = regexp.MustCompile(`^RFS-[1-6]-C(0[1-9]|[1-9][0-9]{1,2})$`)
// rootfsCopyIDs is the deck's inventory, pinned as a literal list in the
@@ -85,7 +85,7 @@ var rootfsCopyIDs = []string{
"RFS-4-C45", "RFS-4-C46", "RFS-4-C47", "RFS-4-C147", "RFS-4-C155", "RFS-4-C48",
"RFS-4-C49", "RFS-4-C50", "RFS-4-C51", "RFS-4-C52",
"RFS-4-C53", "RFS-4-C54", "RFS-4-C55", "RFS-4-C56",
- "RFS-4-C57", "RFS-4-C58", "RFS-4-C59", "RFS-4-C60",
+ "RFS-4-C57", "RFS-4-C156", "RFS-4-C58", "RFS-4-C59", "RFS-4-C60",
"RFS-4-C61", "RFS-4-C62", "RFS-4-C63", "RFS-4-C64",
"RFS-4-C65", "RFS-4-C66", "RFS-4-C67", "RFS-4-C68",
"RFS-4-C69", "RFS-4-C70", "RFS-4-C71", "RFS-4-C72",
@@ -256,6 +256,8 @@ var rootfsCopyBuilt = []string{
"RFS-4-C147",
// rootfs-etc-hosts-1349 (2026-11-22): carlos ship adds /etc/hosts (docs/site/rootfs.md)
"RFS-4-C155",
+ // rootfs-netlink-route-1419 (2026-11-25): rootfs processes read NETLINK_ROUTE (docs/site/rootfs.md)
+ "RFS-4-C156",
// rails-guide-run-console (2026-11-06): Commands and consoles on the
// Rootfs page and the Rails guide's pointer; RFS-4-C100 struck
"RFS-4-C148", "RFS-4-C149", "RFS-4-C150", "RFS-4-C151", "RFS-4-C152", "RFS-4-C153", "RFS-4-C154",
diff --git a/docs/site/rootfs.md b/docs/site/rootfs.md
index d77ea92a8..5d55476d0 100644
--- a/docs/site/rootfs.md
+++ b/docs/site/rootfs.md
@@ -77,6 +77,8 @@ carlos ship --check warns when a process runs Node, Bun or Deno and the release
An instance can reach public addresses, such as an object store or a managed database's public endpoint. It cannot reach a private address unless a system operator allows it for the app with carlos apps set --egress-allow, and it never reaches the box it runs on or the cloud's metadata service.
+A process can read the box's network setup, such as its interfaces, addresses and routes, but cannot change it. So getifaddrs works, and with it Ruby's Socket.ip_address_list and Resolv, Node's os.networkInterfaces and Go's net.Interfaces. Other netlink sockets are refused.
+
## The visitor's address
Requests reach the web process with the visitor's address as the last entry of X-Forwarded-For. The platform writes that header itself and removes anything the visitor sent, so the last entry is always the address the platform saw. This also holds on a fleet box, where the request came in through the hub.
diff --git a/docs/superpowers/notes/census-proposal-rootfs-netlink-route-1419.md b/docs/superpowers/notes/census-proposal-rootfs-netlink-route-1419.md
index 486ee911e..be184ebc0 100644
--- a/docs/superpowers/notes/census-proposal-rootfs-netlink-route-1419.md
+++ b/docs/superpowers/notes/census-proposal-rootfs-netlink-route-1419.md
@@ -4,12 +4,12 @@ Ruling `census-ruling-rootfs-netlink-route-1419`. The independent reviewer appro
| unit | change | read sites | what changed |
|---|---|---|---|
-| `internal/host/units/carlos-instance-rootfs-cmd@.service` `external` | body | unchanged (1) | the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added |
-| `internal/host/units/carlos-instance-rootfs-gen@.service` `external` | body | unchanged (1) | the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added |
-| `internal/host/units/carlos-instance-rootfs-probe.service` `external` | body | unchanged (1) | the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added |
-| `internal/host/units/carlos-instance-rootfs-tty@.service` `external` | body | unchanged (1) | the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added |
-| `internal/host/units/carlos-instance-rootfs-worker@.service` `external` | body | unchanged (1) | the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added |
-| `internal/host/units/carlos-instance-rootfs@.service` `external` | body | unchanged (1) | the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added |
+| `internal/host/units/carlos-instance-rootfs-cmd@.service` `external` | body | unchanged (1) | the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added. Round-1 fix: the five tenant units' ExecStart= add --netlink-scope, a constant flag instance-exec accepts with --rootfs (a pre-#1419 binary exits on it); the block comment says what route lets a tenant read |
+| `internal/host/units/carlos-instance-rootfs-gen@.service` `external` | body | unchanged (1) | the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added. Round-1 fix: the five tenant units' ExecStart= add --netlink-scope, a constant flag instance-exec accepts with --rootfs (a pre-#1419 binary exits on it); the block comment says what route lets a tenant read |
+| `internal/host/units/carlos-instance-rootfs-probe.service` `external` | body | unchanged (1) | the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added. Round-1 fix: the five tenant units' ExecStart= add --netlink-scope, a constant flag instance-exec accepts with --rootfs (a pre-#1419 binary exits on it); the block comment says what route lets a tenant read |
+| `internal/host/units/carlos-instance-rootfs-tty@.service` `external` | body | unchanged (1) | the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added. Round-1 fix: the five tenant units' ExecStart= add --netlink-scope, a constant flag instance-exec accepts with --rootfs (a pre-#1419 binary exits on it); the block comment says what route lets a tenant read |
+| `internal/host/units/carlos-instance-rootfs-worker@.service` `external` | body | unchanged (1) | the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added. Round-1 fix: the five tenant units' ExecStart= add --netlink-scope, a constant flag instance-exec accepts with --rootfs (a pre-#1419 binary exits on it); the block comment says what route lets a tenant read |
+| `internal/host/units/carlos-instance-rootfs@.service` `external` | body | unchanged (1) | the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added. Round-1 fix: the five tenant units' ExecStart= add --netlink-scope, a constant flag instance-exec accepts with --rootfs (a pre-#1419 binary exits on it); the block comment says what route lets a tenant read |
Envelopes re-pinned: `internal/host/units`, `internal/instanceexec`.
@@ -28,6 +28,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- new `internal/instanceexec/netlink_route_linux.go:ScopeNetlinkRoute`: reads +file:Syscall; written legacy, accepted-legacy, frozen
-Seal: `8b8e269938a575bfaeb8f0c9a5be508b4b22a10b7b5bd19d74fa511e5f15a302` → `4048988d196e11420812abdf8dd7686c0e20b3eebb290f8c15ef0c419099fd64`.
+Seal: `8b8e269938a575bfaeb8f0c9a5be508b4b22a10b7b5bd19d74fa511e5f15a302` → `0d02e63b6a67aab196e13324393148ab8faccbd4331af3eadb1ab52ff5b42bb1`.
Overlay: `internal/provision/testdata/plan14-root-reads-rootfs-netlink-route-1419.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md b/docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md
index 8e3461e13..ba8aa0839 100644
--- a/docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md
+++ b/docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md
@@ -301,6 +301,7 @@ From the plan: Placeholders: `<app>` an app; `<fleet>` a fleet name; `<region>`
| RFS-4-C55 | docs/site/rootfs.md (fact, R11) | Memory is never writable and executable at once, unless the release is shipped with carlos ship --jit. A JIT compiler needs that: Node, Bun and Deno, the JVM, Ruby's YJIT and PHP's opcache JIT. Ruby, PHP and Python run well without one. | approved |
| RFS-4-C56 | docs/site/rootfs.md | Network | approved |
| RFS-4-C57 | docs/site/rootfs.md | An instance can reach public addresses, such as an object store or a managed database's public endpoint. It cannot reach a private address unless a system operator allows it for the app with carlos apps set --egress-allow, and it never reaches the box it runs on or the cloud's metadata service. | approved |
+| RFS-4-C156 | docs/site/rootfs.md (fact, rootfs-netlink-route-1419) | A process can read the box's network setup, such as its interfaces, addresses and routes, but cannot change it. So getifaddrs works, and with it Ruby's Socket.ip_address_list and Resolv, Node's os.networkInterfaces and Go's net.Interfaces. Other netlink sockets are refused. | approved |
| RFS-4-C148 | docs/site/rootfs.md (rails-guide-run-console) | Commands and consoles | approved |
| RFS-4-C149 | docs/site/rootfs.md (rails-guide-run-console) | carlos run runs a one-off command on an instance: a data fix, a rake task, an artisan or manage.py command. It runs inside the instance's image, in web's working_dir, with web's environment and the same database. Its output comes back to your terminal, and carlos exits with the command's own status. | approved |
| RFS-4-C150 | docs/site/rootfs.md (rails-guide-run-console) | A command with a slash in it, like bin/rails, is found from web's working_dir. A bare name, like php, is found along the image's PATH. Commands are not run through a shell, so for a pipe or a variable, run sh -c with the line in quotes. | approved |
@@ -610,6 +611,10 @@ RFS-4-C155 (2026-11-22, #1349: carlos ship adds /etc/hosts) was approved
by a Luna copy pass under Paul's delegation; its revision was applied,
then ", or a link to one" added when Astra R1 kept a symlinked hosts
file's target.
+RFS-4-C156 (2026-11-25, #1419: rootfs processes may read NETLINK_ROUTE)
+was reviewed by a Luna pass under Paul's delegation; its revision was
+applied with one fact corrected (getifaddrs lists interfaces and
+addresses, not routes).
Recounted from the rows on 2026-10-30 (Plan 6 amendment, Astra R1 P2-7);
the earlier counts had not followed Plans 1 and 4's later rows.
@@ -617,7 +622,7 @@ the earlier counts had not followed Plans 1 and 4's later rows.
- Plan 1: 99 live, 0 struck, 99 rows
- Plan 2: 12 live, 0 struck, 12 rows
- Plan 3: 32 live, 3 struck, 35 rows
-- Plan 4: 151 live, 3 struck, 154 rows (RFS-4-C100 struck and RFS-4-C148 to C154 added on 2026-11-06; RFS-4-C155 added on 2026-11-22)
+- Plan 4: 152 live, 3 struck, 155 rows (RFS-4-C100 struck and RFS-4-C148 to C154 added on 2026-11-06; RFS-4-C155 added on 2026-11-22; RFS-4-C156 on 2026-11-25)
- Plan 5: 44 live, 0 struck, 44 rows
- Plan 6: 75 live, 0 struck, 75 rows (RFS-6-C47 revised and RFS-6-C65 added and approved on 2026-10-30; RFS-6-C66 to C75 added and approved on 2026-10-31)
-- Total: 413 live, 6 struck, 419 rows
+- Total: 414 live, 6 struck, 420 rows
diff --git a/internal/host/units/carlos-instance-rootfs-cmd@.service b/internal/host/units/carlos-instance-rootfs-cmd@.service
index 9ef1ababa..1adf28518 100644
--- a/internal/host/units/carlos-instance-rootfs-cmd@.service
+++ b/internal/host/units/carlos-instance-rootfs-cmd@.service
@@ -27,7 +27,10 @@ RemainAfterExit=yes
TimeoutStartSec=6h5m
# --rootfs before the role, in ExecStart= and ExecStopPost= alike, as in
# carlos-instance-rootfs@.service.
-ExecStart=/opt/carlos/carlos instance-exec --rootfs cmd %I
+# --netlink-scope: the trampoline scopes netlink to NETLINK_ROUTE before the
+# tenant starts (#1419). A carlos from before #1419 does not know the flag
+# and exits at once, so this unit's AF_NETLINK never reaches an unscoped tenant.
+ExecStart=/opt/carlos/carlos instance-exec --rootfs --netlink-scope cmd %I
# The advisory exit record, as for the other templates. Not "+" (codex R3-2).
ExecStopPost=/opt/carlos/carlos instance-exit --rootfs cmd %I
User=carlos
@@ -191,7 +194,10 @@ CapabilityBoundingSet=
# instance-exec --rootfs and the rootfs probe install a seccomp filter that
# answers every other netlink protocol EAFNOSUPPORT (probe netlink-others).
# Route is read-only here: changing links, addresses or routes takes
-# CAP_NET_ADMIN, and the capability set is empty.
+# CAP_NET_ADMIN, and the capability set is empty (probe netlink-readonly).
+# It does let a tenant read and watch the box's links, addresses, routes,
+# neighbours and tc, so the box must never name a network object (an
+# interface, an altname, a tc handle) after a tenant.
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX AF_NETLINK
# Abstract unix sockets live in the network namespace, which instances
# share with the box because they need outbound TCP, and the line above
diff --git a/internal/host/units/carlos-instance-rootfs-gen@.service b/internal/host/units/carlos-instance-rootfs-gen@.service
index 34a614e27..abb01634f 100644
--- a/internal/host/units/carlos-instance-rootfs-gen@.service
+++ b/internal/host/units/carlos-instance-rootfs-gen@.service
@@ -24,7 +24,10 @@ Before=carlos-edge-drain.service
Type=simple
# --rootfs before the role, in ExecStart= and ExecStopPost= alike, as in
# carlos-instance-rootfs@.service.
-ExecStart=/opt/carlos/carlos instance-exec --rootfs run %I
+# --netlink-scope: the trampoline scopes netlink to NETLINK_ROUTE before the
+# tenant starts (#1419). A carlos from before #1419 does not know the flag
+# and exits at once, so this unit's AF_NETLINK never reaches an unscoped tenant.
+ExecStart=/opt/carlos/carlos instance-exec --rootfs --netlink-scope run %I
# The tenant runs in its own data directory (#256 D). %I here is
# <id>:<n>, not the host's id, so the real directory comes from the
# generation's runtime drop-in, which overrides this line. This one only
@@ -171,7 +174,10 @@ CapabilityBoundingSet=
# instance-exec --rootfs and the rootfs probe install a seccomp filter that
# answers every other netlink protocol EAFNOSUPPORT (probe netlink-others).
# Route is read-only here: changing links, addresses or routes takes
-# CAP_NET_ADMIN, and the capability set is empty.
+# CAP_NET_ADMIN, and the capability set is empty (probe netlink-readonly).
+# It does let a tenant read and watch the box's links, addresses, routes,
+# neighbours and tc, so the box must never name a network object (an
+# interface, an altname, a tc handle) after a tenant.
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX AF_NETLINK
# Abstract unix sockets live in the network namespace, which instances
# share with the box because they need outbound TCP, and the line above
diff --git a/internal/host/units/carlos-instance-rootfs-probe.service b/internal/host/units/carlos-instance-rootfs-probe.service
index 7c06102db..fad6de6c0 100644
--- a/internal/host/units/carlos-instance-rootfs-probe.service
+++ b/internal/host/units/carlos-instance-rootfs-probe.service
@@ -166,7 +166,10 @@ CapabilityBoundingSet=
# instance-exec --rootfs and the rootfs probe install a seccomp filter that
# answers every other netlink protocol EAFNOSUPPORT (probe netlink-others).
# Route is read-only here: changing links, addresses or routes takes
-# CAP_NET_ADMIN, and the capability set is empty.
+# CAP_NET_ADMIN, and the capability set is empty (probe netlink-readonly).
+# It does let a tenant read and watch the box's links, addresses, routes,
+# neighbours and tc, so the box must never name a network object (an
+# interface, an altname, a tc handle) after a tenant.
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX AF_NETLINK
# Abstract unix sockets live in the network namespace, which instances
# share with the box because they need outbound TCP, and the line above
diff --git a/internal/host/units/carlos-instance-rootfs-tty@.service b/internal/host/units/carlos-instance-rootfs-tty@.service
index e0002318d..202f435a2 100644
--- a/internal/host/units/carlos-instance-rootfs-tty@.service
+++ b/internal/host/units/carlos-instance-rootfs-tty@.service
@@ -26,7 +26,10 @@ RemainAfterExit=yes
TimeoutStartSec=6h5m
# --rootfs before the role, in ExecStart= and ExecStopPost= alike, as in
# carlos-instance-rootfs@.service.
-ExecStart=/opt/carlos/carlos instance-exec --rootfs tty %I
+# --netlink-scope: the trampoline scopes netlink to NETLINK_ROUTE before the
+# tenant starts (#1419). A carlos from before #1419 does not know the flag
+# and exits at once, so this unit's AF_NETLINK never reaches an unscoped tenant.
+ExecStart=/opt/carlos/carlos instance-exec --rootfs --netlink-scope tty %I
# The advisory exit record, as for the other templates. Not "+" (codex R3-2).
ExecStopPost=/opt/carlos/carlos instance-exit --rootfs tty %I
User=carlos
@@ -195,7 +198,10 @@ CapabilityBoundingSet=
# instance-exec --rootfs and the rootfs probe install a seccomp filter that
# answers every other netlink protocol EAFNOSUPPORT (probe netlink-others).
# Route is read-only here: changing links, addresses or routes takes
-# CAP_NET_ADMIN, and the capability set is empty.
+# CAP_NET_ADMIN, and the capability set is empty (probe netlink-readonly).
+# It does let a tenant read and watch the box's links, addresses, routes,
+# neighbours and tc, so the box must never name a network object (an
+# interface, an altname, a tc handle) after a tenant.
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX AF_NETLINK
# Abstract unix sockets live in the network namespace, which instances
# share with the box because they need outbound TCP, and the line above
diff --git a/internal/host/units/carlos-instance-rootfs-worker@.service b/internal/host/units/carlos-instance-rootfs-worker@.service
index d55546eef..bb06682e4 100644
--- a/internal/host/units/carlos-instance-rootfs-worker@.service
+++ b/internal/host/units/carlos-instance-rootfs-worker@.service
@@ -28,7 +28,10 @@ Type=simple
# --rootfs before the role, in ExecStart= and ExecStopPost= alike: worker
# is a role the trampoline and instance-exit take only with it (there is
# no binary worker unit).
-ExecStart=/opt/carlos/carlos instance-exec --rootfs worker %I
+# --netlink-scope: the trampoline scopes netlink to NETLINK_ROUTE before the
+# tenant starts (#1419). A carlos from before #1419 does not know the flag
+# and exits at once, so this unit's AF_NETLINK never reaches an unscoped tenant.
+ExecStart=/opt/carlos/carlos instance-exec --rootfs --netlink-scope worker %I
# The worker runs in the instance's own data directory, the one the
# instance's database is in (#256 D). %I here is <id>:<worker>, not the
# host's id, so the real directory comes from the worker's runtime
@@ -183,7 +186,10 @@ CapabilityBoundingSet=
# instance-exec --rootfs and the rootfs probe install a seccomp filter that
# answers every other netlink protocol EAFNOSUPPORT (probe netlink-others).
# Route is read-only here: changing links, addresses or routes takes
-# CAP_NET_ADMIN, and the capability set is empty.
+# CAP_NET_ADMIN, and the capability set is empty (probe netlink-readonly).
+# It does let a tenant read and watch the box's links, addresses, routes,
+# neighbours and tc, so the box must never name a network object (an
+# interface, an altname, a tc handle) after a tenant.
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX AF_NETLINK
# Abstract unix sockets live in the network namespace, which instances
# share with the box because they need outbound TCP, and the line above
diff --git a/internal/host/units/carlos-instance-rootfs@.service b/internal/host/units/carlos-instance-rootfs@.service
index fa03125de..19605856d 100644
--- a/internal/host/units/carlos-instance-rootfs@.service
+++ b/internal/host/units/carlos-instance-rootfs@.service
@@ -25,7 +25,10 @@ Type=simple
# trampoline takes the rootfs launch shape (root's launch file names the
# command, the tenant's names only the environment; rootfs apps design
# §5.2), and instance-exit takes the rootfs roles only with it.
-ExecStart=/opt/carlos/carlos instance-exec --rootfs run %I
+# --netlink-scope: the trampoline scopes netlink to NETLINK_ROUTE before the
+# tenant starts (#1419). A carlos from before #1419 does not know the flag
+# and exits at once, so this unit's AF_NETLINK never reaches an unscoped tenant.
+ExecStart=/opt/carlos/carlos instance-exec --rootfs --netlink-scope run %I
# Runs inside the same namespace, as carlos, after this invocation's
# processes have been signalled: leaves an ADVISORY exit record in the
# instance's own run directory (isolated-exec design §6.5). Not "+": the
@@ -213,7 +216,10 @@ CapabilityBoundingSet=
# instance-exec --rootfs and the rootfs probe install a seccomp filter that
# answers every other netlink protocol EAFNOSUPPORT (probe netlink-others).
# Route is read-only here: changing links, addresses or routes takes
-# CAP_NET_ADMIN, and the capability set is empty.
+# CAP_NET_ADMIN, and the capability set is empty (probe netlink-readonly).
+# It does let a tenant read and watch the box's links, addresses, routes,
+# neighbours and tc, so the box must never name a network object (an
+# interface, an altname, a tc handle) after a tenant.
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX AF_NETLINK
# Abstract unix sockets live in the network namespace, which instances
# share with the box because they need outbound TCP, and the line above
diff --git a/internal/host/units_rootfs_test.go b/internal/host/units_rootfs_test.go
index 164636f75..da570b8f2 100644
--- a/internal/host/units_rootfs_test.go
+++ b/internal/host/units_rootfs_test.go
@@ -223,18 +223,18 @@ func TestRootfsTemplatesPerUnitLines(t *testing.T) {
"After=carlos-edge.service data-instances.mount run-carlos-instances.mount run-carlos-logs.mount",
"KillMode=mixed", "TimeoutStopSec=20", "TasksMax=256", "OOMScoreAdjust=500", "OOMPolicy=kill", "User=carlos", "Group=carlos"}
for name, wants := range map[string][]string{
- "carlos-instance-rootfs@.service": append([]string{"Type=simple", "ExecStart=/opt/carlos/carlos instance-exec --rootfs run %I", "ExecStopPost=/opt/carlos/carlos instance-exit --rootfs run %I",
+ "carlos-instance-rootfs@.service": append([]string{"Type=simple", "ExecStart=/opt/carlos/carlos instance-exec --rootfs --netlink-scope run %I", "ExecStopPost=/opt/carlos/carlos instance-exit --rootfs run %I",
"RootImage=/run/carlos-control/exe/%I/rootfs/run/image",
"BindReadOnlyPaths=/run/carlos-control/exe/%I/rootfs/run/launch.json:/opt/carlos/launch.json /run/carlos-control/exe/%I/rootfs/run/resolv.conf:/etc/resolv.conf",
"BindPaths=/data/instances/%I /run/carlos/instances/%I", "ReadWritePaths=/data/instances/%I /run/carlos/instances/%I", "WorkingDirectory=/data/instances/%I", "StandardOutput=file:/run/carlos/logs/%I.run.sock",
"Slice=carlos-instances-%i.slice", "Restart=no", "SuccessExitStatus=129 130 141 143"}, common...),
- "carlos-instance-rootfs-gen@.service": append([]string{"Type=simple", "ExecStart=/opt/carlos/carlos instance-exec --rootfs run %I", "ExecStopPost=/opt/carlos/carlos instance-exit --rootfs run %I", "WorkingDirectory=/data/instances", "SuccessExitStatus=129 130 141 143", "Restart=no"}, common...),
- "carlos-instance-rootfs-worker@.service": append([]string{"Type=simple", "ExecStart=/opt/carlos/carlos instance-exec --rootfs worker %I", "ExecStopPost=/opt/carlos/carlos instance-exit --rootfs worker %I", "WorkingDirectory=/data/instances", "SuccessExitStatus=129 130 141 143", "Restart=no"}, common...),
+ "carlos-instance-rootfs-gen@.service": append([]string{"Type=simple", "ExecStart=/opt/carlos/carlos instance-exec --rootfs --netlink-scope run %I", "ExecStopPost=/opt/carlos/carlos instance-exit --rootfs run %I", "WorkingDirectory=/data/instances", "SuccessExitStatus=129 130 141 143", "Restart=no"}, common...),
+ "carlos-instance-rootfs-worker@.service": append([]string{"Type=simple", "ExecStart=/opt/carlos/carlos instance-exec --rootfs --netlink-scope worker %I", "ExecStopPost=/opt/carlos/carlos instance-exit --rootfs worker %I", "WorkingDirectory=/data/instances", "SuccessExitStatus=129 130 141 143", "Restart=no"}, common...),
// The command has exactly the instance's reach (C5): the same
// slice, whose parent carlos-instances.slice carries the only
// box-address fence (#367), the same two directories and the
// cmd pair of root's files.
- "carlos-instance-rootfs-cmd@.service": append([]string{"Type=oneshot", "RemainAfterExit=yes", "TimeoutStartSec=6h5m", "ExecStart=/opt/carlos/carlos instance-exec --rootfs cmd %I", "ExecStopPost=/opt/carlos/carlos instance-exit --rootfs cmd %I",
+ "carlos-instance-rootfs-cmd@.service": append([]string{"Type=oneshot", "RemainAfterExit=yes", "TimeoutStartSec=6h5m", "ExecStart=/opt/carlos/carlos instance-exec --rootfs --netlink-scope cmd %I", "ExecStopPost=/opt/carlos/carlos instance-exit --rootfs cmd %I",
"RootImage=/run/carlos-control/exe/%I/rootfs/cmd/image",
"BindReadOnlyPaths=/run/carlos-control/exe/%I/rootfs/cmd/launch.json:/opt/carlos/launch.json /run/carlos-control/exe/%I/rootfs/cmd/resolv.conf:/etc/resolv.conf",
"BindPaths=/data/instances/%I /run/carlos/instances/%I", "ReadWritePaths=/data/instances/%I /run/carlos/instances/%I", "Slice=carlos-instances-%i.slice",
@@ -242,7 +242,7 @@ func TestRootfsTemplatesPerUnitLines(t *testing.T) {
// One interactive session (rootfs Plan 6): the rootfs cmd unit's
// reach, stdin from the agent's socket, and the tty set of root's
// files.
- "carlos-instance-rootfs-tty@.service": append([]string{"Type=oneshot", "RemainAfterExit=yes", "TimeoutStartSec=6h5m", "ExecStart=/opt/carlos/carlos instance-exec --rootfs tty %I", "ExecStopPost=/opt/carlos/carlos instance-exit --rootfs tty %I",
+ "carlos-instance-rootfs-tty@.service": append([]string{"Type=oneshot", "RemainAfterExit=yes", "TimeoutStartSec=6h5m", "ExecStart=/opt/carlos/carlos instance-exec --rootfs --netlink-scope tty %I", "ExecStopPost=/opt/carlos/carlos instance-exit --rootfs tty %I",
"RootImage=/run/carlos-control/exe/%I/rootfs/tty/image",
"BindReadOnlyPaths=/run/carlos-control/exe/%I/rootfs/tty/launch.json:/opt/carlos/launch.json /run/carlos-control/exe/%I/rootfs/tty/resolv.conf:/etc/resolv.conf",
"BindPaths=/data/instances/%I /run/carlos/instances/%I", "ReadWritePaths=/data/instances/%I /run/carlos/instances/%I", "Slice=carlos-instances-%i.slice",
@@ -302,7 +302,7 @@ func TestRootfsCmdTemplateEqualsRootfsOutsideTheNamedLines(t *testing.T) {
swap := map[string]string{
"Description=carlos rootfs instance %I": "Description=carlos rootfs instance %I (cmd)",
"Type=simple": "Type=oneshot",
- "ExecStart=/opt/carlos/carlos instance-exec --rootfs run %I": "ExecStart=/opt/carlos/carlos instance-exec --rootfs cmd %I",
+ "ExecStart=/opt/carlos/carlos instance-exec --rootfs --netlink-scope run %I": "ExecStart=/opt/carlos/carlos instance-exec --rootfs --netlink-scope cmd %I",
"ExecStopPost=/opt/carlos/carlos instance-exit --rootfs run %I": "ExecStopPost=/opt/carlos/carlos instance-exit --rootfs cmd %I",
"StandardOutput=file:/run/carlos/logs/%I.run.sock": "StandardOutput=file:/run/carlos/logs/%I.cmd.sock",
"StandardError=inherit": "StandardError=file:/run/carlos/logs/%I.cmd-err.sock",
@@ -371,7 +371,7 @@ func TestRootfsTTYTemplateEqualsRootfsCmdOutsideTheNamedLines(t *testing.T) {
t.Parallel()
equalOutsideTheNamedLines(t, "carlos-instance-rootfs-cmd@.service", "carlos-instance-rootfs-tty@.service", map[string][]string{
"Description=carlos rootfs instance %I (cmd)": {"Description=carlos rootfs instance %I (tty)"},
- "ExecStart=/opt/carlos/carlos instance-exec --rootfs cmd %I": {"ExecStart=/opt/carlos/carlos instance-exec --rootfs tty %I"},
+ "ExecStart=/opt/carlos/carlos instance-exec --rootfs --netlink-scope cmd %I": {"ExecStart=/opt/carlos/carlos instance-exec --rootfs --netlink-scope tty %I"},
"ExecStopPost=/opt/carlos/carlos instance-exit --rootfs cmd %I": {"ExecStopPost=/opt/carlos/carlos instance-exit --rootfs tty %I"},
"StandardOutput=file:/run/carlos/logs/%I.cmd.sock": {"StandardInput=file:/run/carlos/logs/%I.tty.sock", "StandardOutput=journal"},
"StandardError=file:/run/carlos/logs/%I.cmd-err.sock": {"StandardError=journal"},
diff --git a/internal/instanceexec/exec.go b/internal/instanceexec/exec.go
index 81332f97b..6bbb5eeaa 100644
--- a/internal/instanceexec/exec.go
+++ b/internal/instanceexec/exec.go
@@ -111,6 +111,11 @@ func parseExecArgs(args []string) (execCommand, error) {
fs.Usage = cliflag.Usage(fs, "usage: carlos instance-exec [--rootfs] <run|seed|sidecar|cmd|worker|tty> <instance-id>")
claim := fs.String("claim-reservation", "", "root launch reservation")
rootfs := fs.Bool("rootfs", false, "rootfs launch: root's launch file names the command")
+ // Every rootfs launch is scoped whether or not the flag is given; the
+ // rootfs units pass it so that a carlos from before #1419, which does
+ // not know it, refuses to start instead of running a tenant unscoped
+ // under the units' AF_NETLINK.
+ netlinkScope := fs.Bool("netlink-scope", false, "rootfs launch: scope netlink to NETLINK_ROUTE (always on with --rootfs)")
sandbox := fs.String("sandbox", "", "guest sandbox mode")
_ = fs.Parse(args)
if fs.NArg() != 2 {
@@ -123,6 +128,8 @@ func parseExecArgs(args []string) (execCommand, error) {
return execCommand{}, fmt.Errorf("instance-exec: role %q is not run, seed, sidecar or cmd", fs.Arg(0))
case role == instancectl.RoleWorker && !*rootfs:
return execCommand{}, fmt.Errorf("instance-exec: role %q is not run, seed, sidecar or cmd (worker needs --rootfs)", fs.Arg(0))
+ case *netlinkScope && !*rootfs:
+ return execCommand{}, errors.New("instance-exec: --netlink-scope needs --rootfs")
}
c := execCommand{role: role, inst: fs.Arg(1), rootfs: *rootfs, claim: *claim}
var err error
diff --git a/internal/instanceexec/exec_rootfs_scope_test.go b/internal/instanceexec/exec_rootfs_scope_test.go
index e4ee8ca18..e7f4de10f 100644
--- a/internal/instanceexec/exec_rootfs_scope_test.go
+++ b/internal/instanceexec/exec_rootfs_scope_test.go
@@ -2,6 +2,11 @@ package instanceexec
import (
"errors"
+ "go/ast"
+ "go/parser"
+ "go/token"
+ "path/filepath"
+ "strings"
"testing"
)
@@ -23,3 +28,80 @@ func TestRootfsStartScopesNetlinkFirst(t *testing.T) {
t.Errorf("err = %v, want a rootfs launch refusal", err)
}
}
+
+// The rootfs units pass --netlink-scope (#1419 review, Fable P2-1): this
+// carlos takes it with --rootfs only.
+func TestNetlinkScopeFlag(t *testing.T) {
+ if c, err := parseExecArgs([]string{"--rootfs", "--netlink-scope", "run", "shop.example.com:1"}); err != nil || !c.rootfs {
+ t.Errorf("--rootfs --netlink-scope: %+v, %v", c, err)
+ }
+ if _, err := parseExecArgs([]string{"--netlink-scope", "run", "shop.example.com:1"}); err == nil {
+ t.Error("--netlink-scope was taken without --rootfs")
+ }
+}
+
+// Fable P2-1/P2-2: every rootfs launch goes through rootfsStart with
+// ScopeNetlinkRoute as its scope. execRootfsLaunch is called only inside
+// a function literal passed to rootfsStart(ScopeNetlinkRoute, ...), so a
+// refactor that launches a rootfs tenant without the scope fails here.
+func TestEveryRootfsLaunchIsScoped(t *testing.T) {
+ files, err := filepath.Glob("*.go")
+ if err != nil {
+ t.Fatal(err)
+ }
+ calls := 0
+ for _, file := range files {
+ if strings.HasSuffix(file, "_test.go") {
+ continue
+ }
+ f, err := parser.ParseFile(token.NewFileSet(), file, nil, parser.SkipObjectResolution)
+ if err != nil {
+ t.Fatal(err)
+ }
+ var stack []ast.Node
+ ast.Inspect(f, func(n ast.Node) bool {
+ if n == nil {
+ stack = stack[:len(stack)-1]
+ return true
+ }
+ stack = append(stack, n)
+ call, ok := n.(*ast.CallExpr)
+ if !ok {
+ return true
+ }
+ if id, ok := call.Fun.(*ast.Ident); !ok || id.Name != "execRootfsLaunch" {
+ return true
+ }
+ calls++
+ if !insideScopedStart(stack) {
+ t.Errorf("%s calls execRootfsLaunch outside rootfsStart(ScopeNetlinkRoute, func ...)", file)
+ }
+ return true
+ })
+ }
+ if calls == 0 {
+ t.Error("found no call of execRootfsLaunch; the guard is looking in the wrong place")
+ }
+}
+
+// insideScopedStart reports whether the innermost function literal on
+// stack is an argument of rootfsStart(ScopeNetlinkRoute, ...).
+func insideScopedStart(stack []ast.Node) bool {
+ for i := len(stack) - 1; i > 0; i-- {
+ lit, ok := stack[i].(*ast.FuncLit)
+ if !ok {
+ continue
+ }
+ call, ok := stack[i-1].(*ast.CallExpr)
+ if !ok {
+ return false
+ }
+ fn, ok := call.Fun.(*ast.Ident)
+ if !ok || fn.Name != "rootfsStart" || len(call.Args) != 2 || call.Args[1] != ast.Expr(lit) {
+ return false
+ }
+ scope, ok := call.Args[0].(*ast.Ident)
+ return ok && scope.Name == "ScopeNetlinkRoute"
+ }
+ return false
+}
diff --git a/internal/instanceexec/families_test.go b/internal/instanceexec/families_test.go
index a5f75f1cc..98a2587c9 100644
--- a/internal/instanceexec/families_test.go
+++ b/internal/instanceexec/families_test.go
@@ -133,7 +133,7 @@ func TestOnlyRootfsPathsReachNetlink(t *testing.T) {
t.Fatal(err)
}
ast.Inspect(f, func(n ast.Node) bool {
- if id, ok := n.(*ast.Ident); ok && (id.Name == "netlinkAddrDump" || id.Name == "netlinkSocketOpen") {
+ if id, ok := n.(*ast.Ident); ok && (id.Name == "netlinkAddrDump" || id.Name == "netlinkSocketOpen" || id.Name == "netlinkDeleteRefused") {
t.Errorf("%s names %s; only the rootfs probe's wiring may", file, id.Name)
}
return true
diff --git a/internal/instanceexec/netlink_route_linux.go b/internal/instanceexec/netlink_route_linux.go
index c5aabca4f..22c0829b5 100644
--- a/internal/instanceexec/netlink_route_linux.go
+++ b/internal/instanceexec/netlink_route_linux.go
@@ -4,6 +4,7 @@ package instanceexec
import (
"errors"
+ "fmt"
"runtime"
"syscall"
"unsafe"
@@ -31,7 +32,7 @@ func ScopeNetlinkRoute() error {
default:
return errors.New("netlink scope: no seccomp architecture for " + runtime.GOARCH)
}
- filter := netlinkRouteFilter(arch)
+ filter := netlinkRouteFilter(arch, unix.SYS_SOCKET, unix.SYS_SOCKETPAIR)
if err := unix.Prctl(unix.PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0); err != nil {
return err
}
@@ -47,10 +48,15 @@ func ScopeNetlinkRoute() error {
return nil
}
-// netlinkRouteFilter is ScopeNetlinkRoute's program for arch. Arguments are
-// read as their low 32 bits (offsets 16 and 32 on these little-endian
-// architectures), as the kernel reads socket(2)'s int family and protocol.
-func netlinkRouteFilter(arch uint32) []unix.SockFilter {
+// netlinkRouteFilter is ScopeNetlinkRoute's program for arch, whose
+// socket(2) and socketpair(2) numbers are sysSocket and sysSocketpair.
+// socketpair(AF_NETLINK, ...) is refused whatever the protocol: netlink
+// never supports it, but the kernel creates (and for an unknown protocol
+// tries to load) both protocol sockets before it says so.
+// Arguments are read as their low 32 bits (offsets 16 and 32 on these
+// little-endian architectures), as the kernel reads the int family and
+// protocol.
+func netlinkRouteFilter(arch, sysSocket, sysSocketpair uint32) []unix.SockFilter {
ret := func(k uint32) unix.SockFilter { return unix.SockFilter{Code: unix.BPF_RET | unix.BPF_K, K: k} }
allow := ret(unix.SECCOMP_RET_ALLOW)
return []unix.SockFilter{
@@ -65,21 +71,32 @@ func netlinkRouteFilter(arch uint32) []unix.SockFilter {
// rather than let a second socket number past the check below.
/* 4 */ {Code: unix.BPF_JMP | unix.BPF_JSET | unix.BPF_K, Jf: 1, K: 0x40000000},
/* 5 */ ret(unix.SECCOMP_RET_ERRNO | uint32(unix.ENOSYS)),
- /* 6 */ {Code: unix.BPF_JMP | unix.BPF_JEQ | unix.BPF_K, Jf: 5, K: unix.SYS_SOCKET},
- /* 7 */ {Code: unix.BPF_LD | unix.BPF_W | unix.BPF_ABS, K: 16},
- /* 8 */ {Code: unix.BPF_JMP | unix.BPF_JEQ | unix.BPF_K, Jf: 3, K: unix.AF_NETLINK},
- /* 9 */ {Code: unix.BPF_LD | unix.BPF_W | unix.BPF_ABS, K: 32},
- /* 10 */ {Code: unix.BPF_JMP | unix.BPF_JEQ | unix.BPF_K, Jt: 1, K: unix.NETLINK_ROUTE},
- /* 11 */ ret(unix.SECCOMP_RET_ERRNO | uint32(unix.EAFNOSUPPORT)),
- /* 12 */ allow,
+ /* 6 */ {Code: unix.BPF_JMP | unix.BPF_JEQ | unix.BPF_K, Jt: 3, K: sysSocket},
+ /* 7 */ {Code: unix.BPF_JMP | unix.BPF_JEQ | unix.BPF_K, Jf: 7, K: sysSocketpair},
+ // socketpair: any netlink pair is refused.
+ /* 8 */ {Code: unix.BPF_LD | unix.BPF_W | unix.BPF_ABS, K: 16},
+ /* 9 */ {Code: unix.BPF_JMP | unix.BPF_JEQ | unix.BPF_K, Jt: 4, Jf: 5, K: unix.AF_NETLINK},
+ // socket: a netlink socket only of NETLINK_ROUTE.
+ /* 10 */ {Code: unix.BPF_LD | unix.BPF_W | unix.BPF_ABS, K: 16},
+ /* 11 */ {Code: unix.BPF_JMP | unix.BPF_JEQ | unix.BPF_K, Jf: 3, K: unix.AF_NETLINK},
+ /* 12 */ {Code: unix.BPF_LD | unix.BPF_W | unix.BPF_ABS, K: 32},
+ /* 13 */ {Code: unix.BPF_JMP | unix.BPF_JEQ | unix.BPF_K, Jt: 1, K: unix.NETLINK_ROUTE},
+ /* 14 */ ret(unix.SECCOMP_RET_ERRNO | uint32(unix.EAFNOSUPPORT)),
+ /* 15 */ allow,
}
}
-// netlinkAddrDump asks for the box's addresses as getifaddrs does (an
-// RTM_GETADDR dump over NETLINK_ROUTE). Only the rootfs probe calls it.
+// netlinkAddrDump makes glibc getifaddrs's two requests over
+// NETLINK_ROUTE: an RTM_GETLINK dump, then an RTM_GETADDR dump (glibc
+// getifaddrs_internal). Only the rootfs probe calls it.
func netlinkAddrDump() error {
- _, err := syscall.NetlinkRIB(syscall.RTM_GETADDR, syscall.AF_UNSPEC)
- return err
+ if _, err := syscall.NetlinkRIB(syscall.RTM_GETLINK, syscall.AF_UNSPEC); err != nil {
+ return fmt.Errorf("RTM_GETLINK dump: %w", err)
+ }
+ if _, err := syscall.NetlinkRIB(syscall.RTM_GETADDR, syscall.AF_UNSPEC); err != nil {
+ return fmt.Errorf("RTM_GETADDR dump: %w", err)
+ }
+ return nil
}
// netlinkSocketOpen opens and closes one netlink socket of proto. Only
@@ -91,3 +108,57 @@ func netlinkSocketOpen(proto int) error {
}
return unix.Close(fd)
}
+
+// netlinkDeleteRefused asks the kernel to delete an address that does not
+// exist (127.0.0.2/32 on lo, index 1) and answers the kernel's error.
+// rtnetlink checks CAP_NET_ADMIN before it looks for the address, so a
+// process without it gets EPERM, and one with it gets an error for the
+// missing address: either way nothing on the box changes. Only the rootfs
+// probe calls it (netlink-readonly).
+func netlinkDeleteRefused() error {
+ fd, err := unix.Socket(unix.AF_NETLINK, unix.SOCK_RAW|unix.SOCK_CLOEXEC, unix.NETLINK_ROUTE)
+ if err != nil {
+ return err
+ }
+ defer unix.Close(fd)
+ if err := unix.SetsockoptTimeval(fd, unix.SOL_SOCKET, unix.SO_RCVTIMEO, &unix.Timeval{Sec: 2}); err != nil {
+ return err
+ }
+ // nlmsghdr (16) + ifaddrmsg (8) + IFA_LOCAL rtattr (4 + 4).
+ const total = unix.SizeofNlMsghdr + unix.SizeofIfAddrmsg + 8
+ msg := make([]byte, total)
+ nlh := (*unix.NlMsghdr)(unsafe.Pointer(&msg[0]))
+ nlh.Len = total
+ nlh.Type = unix.RTM_DELADDR
+ nlh.Flags = unix.NLM_F_REQUEST | unix.NLM_F_ACK
+ nlh.Seq = 1
+ ifa := (*unix.IfAddrmsg)(unsafe.Pointer(&msg[unix.SizeofNlMsghdr]))
+ ifa.Family = unix.AF_INET
+ ifa.Prefixlen = 32
+ ifa.Index = 1
+ attr := msg[unix.SizeofNlMsghdr+unix.SizeofIfAddrmsg:]
+ *(*uint16)(unsafe.Pointer(&attr[0])) = 8
+ *(*uint16)(unsafe.Pointer(&attr[2])) = unix.IFA_LOCAL
+ copy(attr[4:], []byte{127, 0, 0, 2})
+ if err := unix.Sendto(fd, msg, 0, &unix.SockaddrNetlink{Family: unix.AF_NETLINK}); err != nil {
+ return err
+ }
+ buf := make([]byte, 4096)
+ n, _, err := unix.Recvfrom(fd, buf, 0)
+ if err != nil {
+ return err
+ }
+ msgs, err := syscall.ParseNetlinkMessage(buf[:n])
+ if err != nil {
+ return err
+ }
+ for _, m := range msgs {
+ if m.Header.Type == unix.NLMSG_ERROR && len(m.Data) >= 4 {
+ if code := *(*int32)(unsafe.Pointer(&m.Data[0])); code != 0 {
+ return syscall.Errno(-code)
+ }
+ return nil
+ }
+ }
+ return errors.New("netlink: no acknowledgement")
+}
diff --git a/internal/instanceexec/netlink_route_linux_test.go b/internal/instanceexec/netlink_route_linux_test.go
index 74b569b23..4e5bc0b46 100644
--- a/internal/instanceexec/netlink_route_linux_test.go
+++ b/internal/instanceexec/netlink_route_linux_test.go
@@ -6,6 +6,7 @@ import (
"fmt"
"os"
"os/exec"
+ "runtime"
"strings"
"syscall"
"testing"
@@ -25,13 +26,30 @@ func TestNetlinkScopeHelper(t *testing.T) {
if stage == "" {
t.Skip("helper process only")
}
+ // A second OS thread, started and parked before the scope, opens a
+ // sock_diag socket after it: TSYNC must have reached it.
+ ready, scoped, done := make(chan struct{}), make(chan struct{}), make(chan string)
+ go func() {
+ runtime.LockOSThread()
+ close(ready)
+ <-scoped
+ fd, err := unix.Socket(unix.AF_NETLINK, unix.SOCK_RAW|unix.SOCK_CLOEXEC, unix.NETLINK_SOCK_DIAG)
+ if err != nil {
+ done <- strings.ReplaceAll(err.(syscall.Errno).Error(), " ", "_")
+ return
+ }
+ unix.Close(fd)
+ done <- "open"
+ }()
+ <-ready
if stage == "scope" {
if err := ScopeNetlinkRoute(); err != nil {
fmt.Println("scope", err)
os.Exit(3)
}
}
- fmt.Println(netlinkSocketReport())
+ close(scoped)
+ fmt.Println(netlinkSocketReport() + " thread=" + <-done)
if stage == "scope" {
// Exec this binary again: the filter must survive execve.
cmd := exec.Command(os.Args[0], "-test.run=^TestNetlinkScopeHelper$")
@@ -52,7 +70,7 @@ func netlinkSocketReport() string {
open := func(family, typ, proto int) string {
fd, err := unix.Socket(family, typ|unix.SOCK_CLOEXEC, proto)
if err != nil {
- return err.(syscall.Errno).Error()
+ return strings.ReplaceAll(err.(syscall.Errno).Error(), " ", "_")
}
unix.Close(fd)
return "open"
@@ -64,6 +82,19 @@ func netlinkSocketReport() string {
}
// A protocol with high bits set is the kernel's int: still not route.
fmt.Fprintf(&b, " phigh=%s", open(unix.AF_NETLINK, unix.SOCK_RAW, 0x10004))
+ pair := func(proto int) string {
+ _, err := unix.Socketpair(unix.AF_NETLINK, unix.SOCK_RAW|unix.SOCK_CLOEXEC, proto)
+ if err != nil {
+ return strings.ReplaceAll(err.(syscall.Errno).Error(), " ", "_")
+ }
+ return "open"
+ }
+ fmt.Fprintf(&b, " pair0=%s pair4=%s", pair(0), pair(4))
+ del := "nil"
+ if err := netlinkDeleteRefused(); err != nil {
+ del = err.Error()
+ }
+ fmt.Fprintf(&b, " delete=%s", strings.ReplaceAll(del, " ", "_"))
fmt.Fprintf(&b, " inet=%s unix=%s", open(unix.AF_INET, unix.SOCK_DGRAM, 0), open(unix.AF_UNIX, unix.SOCK_STREAM, 0))
return b.String()
}
@@ -79,58 +110,143 @@ func runNetlinkHelper(t *testing.T, stage string) string {
return string(out)
}
+// fields parses a helper line into name -> result.
+func netlinkFields(line string) map[string]string {
+ f := map[string]string{}
+ for _, kv := range strings.Fields(line) {
+ k, v, _ := strings.Cut(kv, "=")
+ f[k] = v
+ }
+ return f
+}
+
// #1419: after ScopeNetlinkRoute a process opens NETLINK_ROUTE sockets
// and no other netlink protocol (EAFNOSUPPORT, what a unit without
-// AF_NETLINK answers), inet and unix are untouched, and an exec'd child
-// keeps the scope.
+// AF_NETLINK answers), socketpair is refused the same way, a change over
+// route is refused (EPERM, this test runs without CAP_NET_ADMIN), inet
+// and unix answer as they did before the scope, and an exec'd child keeps
+// all of it.
func TestScopeNetlinkRouteNarrowsNetlinkToRoute(t *testing.T) {
- before := runNetlinkHelper(t, "plain")
- if !strings.Contains(before, "route=open") {
- t.Skipf("this environment refuses NETLINK_ROUTE already: %s", before)
+ if os.Geteuid() == 0 {
+ t.Skip("as root the delete check would reach the kernel's address lookup")
+ }
+ before := netlinkFields(strings.TrimSpace(runNetlinkHelper(t, "plain")))
+ if before["route"] != "open" {
+ t.Skipf("this environment refuses NETLINK_ROUTE already: %v", before)
}
out := runNetlinkHelper(t, "scope")
lines := strings.Split(strings.TrimSpace(out), "\n")
if len(lines) != 2 || !strings.HasPrefix(lines[1], "inherited ") {
t.Fatalf("helper output:\n%s", out)
}
- eaf := syscall.EAFNOSUPPORT.Error()
+ eaf := strings.ReplaceAll(syscall.EAFNOSUPPORT.Error(), " ", "_")
for i, line := range []string{lines[0], strings.TrimPrefix(lines[1], "inherited ")} {
- for _, want := range []string{"route=open", "route-dgram=open", "inet=open", "unix=open"} {
- if !strings.Contains(line, want) {
- t.Errorf("line %d lacks %s: %s", i, want, line)
+ f := netlinkFields(line)
+ for k, want := range map[string]string{
+ "route": "open", "route-dgram": "open", "phigh": eaf, "pair4": eaf, "pair0": eaf,
+ "thread": eaf,
+ "delete": strings.ReplaceAll(syscall.EPERM.Error(), " ", "_"),
+ "inet": before["inet"], "unix": before["unix"],
+ } {
+ if f[k] != want {
+ t.Errorf("line %d: %s=%s, want %s", i, k, f[k], want)
}
}
for p := 1; p < 32; p++ {
- if !strings.Contains(line, fmt.Sprintf(" p%d=%s ", p, eaf)) {
- t.Errorf("line %d: netlink protocol %d not refused with %q: %s", i, p, eaf, line)
+ if k := fmt.Sprintf("p%d", p); f[k] != eaf {
+ t.Errorf("line %d: netlink protocol %d = %s, want %s", i, p, f[k], eaf)
}
}
- if !strings.Contains(line, " phigh="+eaf+" ") {
- t.Errorf("line %d: protocol 0x10004 not refused: %s", i, line)
- }
}
}
-// The filter ends in ALLOW (the unit's own filters still apply), and a
-// nonnative or x32 call is refused by it too (ENOSYS, never a kill).
-func TestNetlinkRouteFilterRefusesForeignArchitectures(t *testing.T) {
- f := netlinkRouteFilter(unix.AUDIT_ARCH_X86_64)
- if len(f) == 0 || f[len(f)-1].Code != unix.BPF_RET|unix.BPF_K || f[len(f)-1].K != unix.SECCOMP_RET_ALLOW {
- t.Fatalf("filter does not end in ALLOW: %+v", f)
- }
- enosys, x32 := 0, false
- for _, s := range f {
- if s.Code == unix.BPF_RET|unix.BPF_K && s.K == unix.SECCOMP_RET_KILL_PROCESS {
- t.Error("the filter kills")
+// runFilter is classic BPF as seccomp runs it, for the four instruction
+// kinds netlinkRouteFilter uses, over a little-endian seccomp_data of nr,
+// arch and the full 64-bit args 0 and 2 (low words at 16 and 32, high
+// words at 20 and 36).
+func runFilter(t *testing.T, prog []unix.SockFilter, nr, arch uint32, arg0, arg2 uint64) uint32 {
+ t.Helper()
+ data := map[uint32]uint32{0: nr, 4: arch, 16: uint32(arg0), 20: uint32(arg0 >> 32), 32: uint32(arg2), 36: uint32(arg2 >> 32)}
+ var a uint32
+ for pc := 0; pc < len(prog); pc++ {
+ ins := prog[pc]
+ switch ins.Code {
+ case unix.BPF_LD | unix.BPF_W | unix.BPF_ABS:
+ v, ok := data[ins.K]
+ if !ok {
+ t.Fatalf("load of offset %d", ins.K)
+ }
+ a = v
+ case unix.BPF_JMP | unix.BPF_JEQ | unix.BPF_K:
+ if a == ins.K {
+ pc += int(ins.Jt)
+ } else {
+ pc += int(ins.Jf)
+ }
+ case unix.BPF_JMP | unix.BPF_JSET | unix.BPF_K:
+ if a&ins.K != 0 {
+ pc += int(ins.Jt)
+ } else {
+ pc += int(ins.Jf)
+ }
+ case unix.BPF_RET | unix.BPF_K:
+ return ins.K
+ default:
+ t.Fatalf("instruction %d: code %#x", pc, ins.Code)
}
- if s.Code == unix.BPF_RET|unix.BPF_K && s.K == unix.SECCOMP_RET_ERRNO|uint32(unix.ENOSYS) {
- enosys++
+ }
+ t.Fatal("ran off the end")
+ return 0
+}
+
+// The program, run for both architectures' syscall numbers (amd64 socket
+// 41, socketpair 53; arm64 198, 199): only netlink sockets of another
+// protocol are refused, a nonnative or x32 call is ENOSYS, never a kill,
+// and every other call falls through to ALLOW (the unit's own filters
+// still apply).
+func TestNetlinkRouteFilterProgram(t *testing.T) {
+ refuse := unix.SECCOMP_RET_ERRNO | uint32(unix.EAFNOSUPPORT)
+ enosys := unix.SECCOMP_RET_ERRNO | uint32(unix.ENOSYS)
+ allow := uint32(unix.SECCOMP_RET_ALLOW)
+ for _, a := range []struct {
+ name string
+ arch, sock, pair, rd uint32
+ }{
+ {"amd64", unix.AUDIT_ARCH_X86_64, 41, 53, 0},
+ {"arm64", unix.AUDIT_ARCH_AARCH64, 198, 199, 63},
+ } {
+ prog := netlinkRouteFilter(a.arch, a.sock, a.pair)
+ for _, c := range []struct {
+ name string
+ nr, arch uint32
+ a0, a2 uint64
+ want uint32
+ }{
+ {"route socket", a.sock, a.arch, unix.AF_NETLINK, 0, allow},
+ {"sock_diag socket", a.sock, a.arch, unix.AF_NETLINK, 4, refuse},
+ {"uevent socket", a.sock, a.arch, unix.AF_NETLINK, 15, refuse},
+ {"high-bit protocol", a.sock, a.arch, unix.AF_NETLINK, 0x10004, refuse},
+ {"sock_diag socketpair", a.pair, a.arch, unix.AF_NETLINK, 4, refuse},
+ {"route socketpair", a.pair, a.arch, unix.AF_NETLINK, 0, refuse},
+ // The kernel reads int family and protocol, the low words.
+ {"high word on the family", a.sock, a.arch, 1<<32 | unix.AF_NETLINK, 4, refuse},
+ {"high word on sock_diag", a.sock, a.arch, unix.AF_NETLINK, 1<<32 | 4, refuse},
+ {"high word only (the kernel's route)", a.sock, a.arch, unix.AF_NETLINK, 1 << 32, allow},
+ {"high word on inet", a.sock, a.arch, 1<<32 | unix.AF_INET, 4, allow},
+ {"inet socket", a.sock, a.arch, unix.AF_INET, 4, allow},
+ {"unix socketpair", a.pair, a.arch, unix.AF_UNIX, 0, allow},
+ {"another call", a.rd, a.arch, unix.AF_NETLINK, 4, allow},
+ {"nonnative", a.sock, unix.AUDIT_ARCH_I386, unix.AF_NETLINK, 4, enosys},
+ {"x32", a.sock | 0x40000000, a.arch, unix.AF_NETLINK, 4, enosys},
+ } {
+ if got := runFilter(t, prog, c.nr, c.arch, c.a0, c.a2); got != c.want {
+ t.Errorf("%s %s: %#x, want %#x", a.name, c.name, got, c.want)
+ }
}
- if s.Code == unix.BPF_JMP|unix.BPF_JSET|unix.BPF_K && s.K == 0x40000000 {
- x32 = true
+ for _, s := range prog {
+ if s.Code == unix.BPF_RET|unix.BPF_K && s.K == unix.SECCOMP_RET_KILL_PROCESS {
+ t.Errorf("%s: the filter kills", a.name)
+ }
}
}
- if enosys != 2 || !x32 {
- t.Errorf("filter lacks the architecture guard (ENOSYS returns %d, x32 %v)", enosys, x32)
- }
}
diff --git a/internal/instanceexec/probe_rootfs.go b/internal/instanceexec/probe_rootfs.go
index 78cc7a56f..e1e9f0196 100644
--- a/internal/instanceexec/probe_rootfs.go
+++ b/internal/instanceexec/probe_rootfs.go
@@ -35,10 +35,14 @@ type rootfsProbeEnv struct {
mkfile func(path string) error
// The netlink scope a rootfs tenant runs under (#1419): scopeNetlink
// installs it on the probe itself, netlinkDump is getifaddrs's
- // RTM_GETADDR dump, netlinkOpen opens one netlink socket of a protocol.
+ // RTM_GETLINK and RTM_GETADDR dumps, netlinkOpen opens one netlink
+ // socket of a protocol.
scopeNetlink func() error
netlinkDump func() error
netlinkOpen func(proto int) error
+ // netlinkWrite asks rtnetlink for a change that cannot alter the box
+ // (deleting an address that does not exist); it must answer EPERM.
+ netlinkWrite func() error
}
// The mounts an image root may have (mountsAllowlisted). Every mount
@@ -131,14 +135,14 @@ func runRootfsChecks(e rootfsProbeEnv) instancectl.ProbeReport {
return v.report()
}
-// netlinkChecks are #1419's two lines: getifaddrs's dump works over
-// NETLINK_ROUTE, and every other netlink protocol (1 to 31, the kernel's
+// netlinkChecks are #1419's lines: getifaddrs's dump works over
+// NETLINK_ROUTE, a change over it is refused, and every other netlink protocol (1 to 31, the kernel's
// MAX_LINKS) is refused with EAFNOSUPPORT, the scope's answer. A
// protocol the kernel itself does not know would answer EPROTONOSUPPORT
// without the scope, so only EAFNOSUPPORT proves it.
func netlinkChecks(e rootfsProbeEnv, v *verdicts) {
err := e.netlinkDump()
- v.pass("netlink-route", fmt.Sprintf("RTM_GETADDR dump: %v", err), err == nil)
+ v.pass("netlink-route", fmt.Sprint(err), err == nil)
var bad []string
for p := 1; p < 32; p++ {
switch err := e.netlinkOpen(p); {
@@ -149,6 +153,11 @@ func netlinkChecks(e rootfsProbeEnv, v *verdicts) {
}
}
v.pass("netlink-others", strings.Join(bad, "; "), len(bad) == 0)
+ // Route is read-only only while the process has no CAP_NET_ADMIN
+ // (#1419 review, Fable P3-3): a drop-in that handed it back would show
+ // here.
+ werr := e.netlinkWrite()
+ v.pass("netlink-readonly", fmt.Sprintf("RTM_DELADDR: %v, want %v", werr, syscall.EPERM), errors.Is(werr, syscall.EPERM))
}
// mountEntry is one line of /proc/self/mountinfo: the mount point, the
diff --git a/internal/instanceexec/probe_rootfs_linux.go b/internal/instanceexec/probe_rootfs_linux.go
index ab5c50c5d..0f58bc2f4 100644
--- a/internal/instanceexec/probe_rootfs_linux.go
+++ b/internal/instanceexec/probe_rootfs_linux.go
@@ -30,6 +30,7 @@ func productionRootfsProbeEnv() rootfsProbeEnv {
scopeNetlink: ScopeNetlinkRoute,
netlinkDump: netlinkAddrDump,
netlinkOpen: netlinkSocketOpen,
+ netlinkWrite: netlinkDeleteRefused,
}
}
diff --git a/internal/instanceexec/probe_rootfs_other.go b/internal/instanceexec/probe_rootfs_other.go
index 5b07ad748..06e6685d9 100644
--- a/internal/instanceexec/probe_rootfs_other.go
+++ b/internal/instanceexec/probe_rootfs_other.go
@@ -21,5 +21,6 @@ func productionRootfsProbeEnv() rootfsProbeEnv {
scopeNetlink: ScopeNetlinkRoute,
netlinkDump: func() error { return errors.ErrUnsupported },
netlinkOpen: func(int) error { return errors.ErrUnsupported },
+ netlinkWrite: func() error { return errors.ErrUnsupported },
}
}
diff --git a/internal/instanceexec/probe_rootfs_test.go b/internal/instanceexec/probe_rootfs_test.go
index d326ddce0..7960b0ba9 100644
--- a/internal/instanceexec/probe_rootfs_test.go
+++ b/internal/instanceexec/probe_rootfs_test.go
@@ -5,6 +5,7 @@ package instanceexec
import (
"encoding/json"
"errors"
+ "fmt"
"os"
"os/exec"
"path/filepath"
@@ -115,6 +116,7 @@ func goodRootfsEnv(t *testing.T) rootfsProbeEnv {
// other protocol is the filter's EAFNOSUPPORT.
scopeNetlink: func() error { return nil },
netlinkDump: func() error { return nil },
+ netlinkWrite: func() error { return syscall.EPERM },
netlinkOpen: func(proto int) error {
if proto == 0 {
return nil
@@ -205,7 +207,7 @@ func TestRootfsProbePassesInsideAnImageRoot(t *testing.T) {
}
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",
- "netlink-scope", "netlink-route", "netlink-others"} {
+ "netlink-scope", "netlink-route", "netlink-others", "netlink-readonly"} {
if v := verdict(r, c); v != "ok" {
t.Errorf("%s = %s: %s", c, v, detail(r, c))
}
@@ -718,7 +720,9 @@ func TestRootfsProbeNetlinkLines(t *testing.T) {
want string
}{
{"scope not installed", func(e *rootfsProbeEnv) { e.scopeNetlink = func() error { return errors.New("seccomp: EINVAL") } }, "netlink-scope", "seccomp: EINVAL"},
- {"route dump fails", func(e *rootfsProbeEnv) { e.netlinkDump = func() error { return syscall.EAFNOSUPPORT } }, "netlink-route", "address family not supported"},
+ {"route dump fails", func(e *rootfsProbeEnv) {
+ e.netlinkDump = func() error { return fmt.Errorf("RTM_GETLINK dump: %w", syscall.EAFNOSUPPORT) }
+ }, "netlink-route", "RTM_GETLINK dump: address family not supported"},
{"sock_diag opens", func(e *rootfsProbeEnv) {
e.netlinkOpen = func(p int) error {
if p == 0 || p == unix.NETLINK_SOCK_DIAG {
@@ -738,6 +742,7 @@ func TestRootfsProbeNetlinkLines(t *testing.T) {
return syscall.EAFNOSUPPORT
}
}, "netlink-others", "protocol 30: protocol not supported"},
+ {"a change is not refused", func(e *rootfsProbeEnv) { e.netlinkWrite = func() error { return syscall.EADDRNOTAVAIL } }, "netlink-readonly", "cannot assign requested address"},
}
for _, c := range cases {
t.Run(c.name, func(t *testing.T) {
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 34467c0d1..8420ecc0d 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -294,4 +294,4 @@ plan14-root-reads-release-copy-across-consoles.tsv 892cf87db700600490e3ec9e944f9
plan14-root-reads-rootfs-etc-hosts-1349.tsv 892cf87db700600490e3ec9e944f9dbe7151e43bc5471090634f1735bcb9a7bd
plan14-root-reads-managed-fleets-2b2.tsv 4bb3547d064b71134612e74b3b8269e16356d2832a8e579ace150349e55c6a27
plan14-root-reads-store-write-credential.tsv 8b8e269938a575bfaeb8f0c9a5be508b4b22a10b7b5bd19d74fa511e5f15a302
-plan14-root-reads-rootfs-netlink-route-1419.tsv 4048988d196e11420812abdf8dd7686c0e20b3eebb290f8c15ef0c419099fd64
+plan14-root-reads-rootfs-netlink-route-1419.tsv 0d02e63b6a67aab196e13324393148ab8faccbd4331af3eadb1ab52ff5b42bb1
diff --git a/internal/provision/testdata/plan14-root-reads-rootfs-netlink-route-1419.tsv b/internal/provision/testdata/plan14-root-reads-rootfs-netlink-route-1419.tsv
index 73f00f2a0..04a4ac8a6 100644
--- a/internal/provision/testdata/plan14-root-reads-rootfs-netlink-route-1419.tsv
+++ b/internal/provision/testdata/plan14-root-reads-rootfs-netlink-route-1419.tsv
@@ -1,19 +1,19 @@
# Census overlay rootfs-netlink-route-1419, written by census-propose (#369). census-ruling-rootfs-netlink-route-1419, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-rootfs-netlink-route-1419.md.
# 6 body, 0 sites, 2 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
# 1 new dispositions: 0 reads re-frozen at their disposition with the claim, 1 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other.
-@legacy 74a87e7144a37a8fcc2b81dee92b1ba1f65c16611aff2820ffcb129b166f9e42 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);rev3=census-ruling-w6-ingress-drain;basis=adds Before=carlos-edge-drain.service (with a comment). Ordering only; no read added.;rev3=census-ruling-rootfs-netlink-route-1419;basis=the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added file:external@0 f9386489aea37bfe41f7fd37a60024bb4eb30a78f3f5ce0ebce2aeee6ebadd4d
-@legacy 430f8d7acb19d66406d1d81638811f82151f10a2b08034f92197f584c3230de6 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);rev3=census-ruling-w6-ingress-drain;basis=adds Before=carlos-edge-drain.service (with a comment). Ordering only; no read added.;rev3=census-ruling-rootfs-netlink-route-1419;basis=the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added file:external@0 89ab602b24b8429b55b8fdda53f6d5f2392b96b32912b47bd799c722ab211332
-@legacy 6adcd0c61352bfe01df171a3143d9943b46da51dfb5b611456d6e005a118028e 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;rev3=census-ruling-rootfs-netlink-route-1419;basis=the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added file:external@0 851de49c196f7f2d0e8c87f73781b0b8d4d9449e32b53d5680503398717404b0
-@legacy 0b4adf629bb1fd1dcc6af1edc6d3632b4ef8dc6be7392e6776a1a118cadefe2d 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);rev3=census-ruling-w6-ingress-drain;basis=adds Before=carlos-edge-drain.service (with a comment). Ordering only; no read added.;rev3=census-ruling-rootfs-netlink-route-1419;basis=the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added file:external@0 b0f07d655ec7328600b8e7f594cd84aa902557bd83bb88aa40d3f6d3b51726a2
-@legacy 7d2c66fea7dd4c7ebaf961ffb14df0b31792820454a105dfc010ea97ee8e1b69 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);rev3=census-ruling-w6-ingress-drain;basis=adds Before=carlos-edge-drain.service (with a comment). Ordering only; no read added.;rev3=census-ruling-rootfs-netlink-route-1419;basis=the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added file:external@0 7e62b7af07f10d697412a83a8fa47259c114648473a6735962cbcd2a0480ba9d
-@legacy 58306718bfa29365f969e88061944508bd124f6b76d9e4ce01e09ee23cc32e5f 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);rev3=census-ruling-w6-ingress-drain;basis=adds Before=carlos-edge-drain.service (with a comment). Ordering only; no read added.;rev3=census-ruling-rootfs-netlink-route-1419;basis=the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added file:external@0 ce9a4f051788921acad19eee2e1c288dd510ee6680d4abc4a10808f365bde04f
-@legacy 022279fbb7015aa8fdfb79b4c3038a209e7abfe83f23d281b072807509daf124 internal/instanceexec/netlink_route_linux.go ScopeNetlinkRoute legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-netlink-route-1419;basis=new (#1419): installs a seccomp filter on its own process (carlos, inside a rootfs unit, every thread via TSYNC) answering socket(AF_NETLINK, any type, protocol other than NETLINK_ROUTE) with EAFNOSUPPORT; nonnative and x32 calls ENOSYS. Its one read is the seccomp syscall; it opens no path and takes no tenant input; it only narrows what the unit allows. Not run by root file:Syscall@489 314913d060abbb2718e5e95ad73caecfe6254584eb7c1f00482abc95623b2aea
-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);rev3=census-ruling-w6-ingress-drain;basis=adds Before=carlos-edge-drain.service (with a comment). Ordering only; no read added.;rev3=census-ruling-rootfs-netlink-route-1419;basis=the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added file:external@0 f9386489aea37bfe41f7fd37a60024bb4eb30a78f3f5ce0ebce2aeee6ebadd4d
-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);rev3=census-ruling-w6-ingress-drain;basis=adds Before=carlos-edge-drain.service (with a comment). Ordering only; no read added.;rev3=census-ruling-rootfs-netlink-route-1419;basis=the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added file:external@0 89ab602b24b8429b55b8fdda53f6d5f2392b96b32912b47bd799c722ab211332
-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;rev3=census-ruling-rootfs-netlink-route-1419;basis=the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added file:external@0 851de49c196f7f2d0e8c87f73781b0b8d4d9449e32b53d5680503398717404b0
-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);rev3=census-ruling-w6-ingress-drain;basis=adds Before=carlos-edge-drain.service (with a comment). Ordering only; no read added.;rev3=census-ruling-rootfs-netlink-route-1419;basis=the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added file:external@0 b0f07d655ec7328600b8e7f594cd84aa902557bd83bb88aa40d3f6d3b51726a2
-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);rev3=census-ruling-w6-ingress-drain;basis=adds Before=carlos-edge-drain.service (with a comment). Ordering only; no read added.;rev3=census-ruling-rootfs-netlink-route-1419;basis=the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added file:external@0 7e62b7af07f10d697412a83a8fa47259c114648473a6735962cbcd2a0480ba9d
-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);rev3=census-ruling-w6-ingress-drain;basis=adds Before=carlos-edge-drain.service (with a comment). Ordering only; no read added.;rev3=census-ruling-rootfs-netlink-route-1419;basis=the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added file:external@0 ce9a4f051788921acad19eee2e1c288dd510ee6680d4abc4a10808f365bde04f
-internal/instanceexec/netlink_route_linux.go ScopeNetlinkRoute legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-netlink-route-1419;basis=new (#1419): installs a seccomp filter on its own process (carlos, inside a rootfs unit, every thread via TSYNC) answering socket(AF_NETLINK, any type, protocol other than NETLINK_ROUTE) with EAFNOSUPPORT; nonnative and x32 calls ENOSYS. Its one read is the seccomp syscall; it opens no path and takes no tenant input; it only narrows what the unit allows. Not run by root file:Syscall@489 314913d060abbb2718e5e95ad73caecfe6254584eb7c1f00482abc95623b2aea
-@coverage internal/host/units 4bc973ae33dae9b688ef0ec444b5a4a27f9144050dd0c2ae86b3669bfb0ae415
-@coverage internal/instanceexec 919420f7ef9a48cef00225a032d7038ef1527fc50445c1ed21516dc0763a3aac
+@legacy b7f53cc6aa019c1e3edec3c5c23d026475d21e0c9f4cb2b1068e955d06b6db74 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);rev3=census-ruling-w6-ingress-drain;basis=adds Before=carlos-edge-drain.service (with a comment). Ordering only; no read added.;rev3=census-ruling-rootfs-netlink-route-1419;basis=the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added. Round-1 fix: the five tenant units' ExecStart= add --netlink-scope, a constant flag instance-exec accepts with --rootfs (a pre-#1419 binary exits on it); the block comment says what route lets a tenant read file:external@0 6a400c1ac2cb62e923593fb509ffd2b6f9bae4a6ff4436a80811b2971167f2e4
+@legacy 34550ec7c821dfbb93eae25d91f247326f47d2b1925cecb7603d2073ab1f8b7f 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);rev3=census-ruling-w6-ingress-drain;basis=adds Before=carlos-edge-drain.service (with a comment). Ordering only; no read added.;rev3=census-ruling-rootfs-netlink-route-1419;basis=the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added. Round-1 fix: the five tenant units' ExecStart= add --netlink-scope, a constant flag instance-exec accepts with --rootfs (a pre-#1419 binary exits on it); the block comment says what route lets a tenant read file:external@0 084918373f50eb37c8ad323cbff87c9a5d327c0d713c4bbc09ba2701c8b12aba
+@legacy 1d15a70ee71ece7d791507b11ca92a6c3b1e216138372160f2c232bf5f6381af 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;rev3=census-ruling-rootfs-netlink-route-1419;basis=the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added. Round-1 fix: the five tenant units' ExecStart= add --netlink-scope, a constant flag instance-exec accepts with --rootfs (a pre-#1419 binary exits on it); the block comment says what route lets a tenant read file:external@0 d16141b1ad33781e33ad61384c14f6b7764daa222dd27c4bfb06d1a45d3c0425
+@legacy 126c796b12a3ec3078ae0ce7441aa458ed30c3c7ad33fe960b360af6e96f9090 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);rev3=census-ruling-w6-ingress-drain;basis=adds Before=carlos-edge-drain.service (with a comment). Ordering only; no read added.;rev3=census-ruling-rootfs-netlink-route-1419;basis=the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added. Round-1 fix: the five tenant units' ExecStart= add --netlink-scope, a constant flag instance-exec accepts with --rootfs (a pre-#1419 binary exits on it); the block comment says what route lets a tenant read file:external@0 157482e343556817fd4a4d1b571d4bd5b3fce1d55c9610f24a4ef4a43dd44a25
+@legacy c9069c49657d2a7bc666aed876e10b34ebff592f3bc098e6db291620826f5516 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);rev3=census-ruling-w6-ingress-drain;basis=adds Before=carlos-edge-drain.service (with a comment). Ordering only; no read added.;rev3=census-ruling-rootfs-netlink-route-1419;basis=the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added. Round-1 fix: the five tenant units' ExecStart= add --netlink-scope, a constant flag instance-exec accepts with --rootfs (a pre-#1419 binary exits on it); the block comment says what route lets a tenant read file:external@0 f6484843ed12db291646fcce9d935b5cdc0be8cc00160c3e2d58ad4b4dfd8c2e
+@legacy e44594c8b6b05bf6be771d2874db8acd79a8f39ae67375da2af7697b5a316582 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);rev3=census-ruling-w6-ingress-drain;basis=adds Before=carlos-edge-drain.service (with a comment). Ordering only; no read added.;rev3=census-ruling-rootfs-netlink-route-1419;basis=the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added. Round-1 fix: the five tenant units' ExecStart= add --netlink-scope, a constant flag instance-exec accepts with --rootfs (a pre-#1419 binary exits on it); the block comment says what route lets a tenant read file:external@0 4459dcc0c3b3a7fc1b75194769f9ce46ffa598d844a1547b487704f76620daf9
+@legacy 39724b3733fab1aa435b945da65a694873fa1c908a14038cf137d4eccfe595cd internal/instanceexec/netlink_route_linux.go ScopeNetlinkRoute legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-netlink-route-1419;basis=new (#1419): installs a seccomp filter on its own process (carlos, inside a rootfs unit, every thread via TSYNC) answering socket(AF_NETLINK, any type, protocol other than NETLINK_ROUTE) with EAFNOSUPPORT; nonnative and x32 calls ENOSYS. Its one read is the seccomp syscall; it opens no path and takes no tenant input; it only narrows what the unit allows. Not run by root. Round-1 fix: socketpair(AF_NETLINK, ...) is refused too file:Syscall@527 2a49962af9cb77dc3ef4e34514f951ae03d001c1466cfae3a749eb4e1b6d4ebc
+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);rev3=census-ruling-w6-ingress-drain;basis=adds Before=carlos-edge-drain.service (with a comment). Ordering only; no read added.;rev3=census-ruling-rootfs-netlink-route-1419;basis=the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added. Round-1 fix: the five tenant units' ExecStart= add --netlink-scope, a constant flag instance-exec accepts with --rootfs (a pre-#1419 binary exits on it); the block comment says what route lets a tenant read file:external@0 6a400c1ac2cb62e923593fb509ffd2b6f9bae4a6ff4436a80811b2971167f2e4
+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);rev3=census-ruling-w6-ingress-drain;basis=adds Before=carlos-edge-drain.service (with a comment). Ordering only; no read added.;rev3=census-ruling-rootfs-netlink-route-1419;basis=the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added. Round-1 fix: the five tenant units' ExecStart= add --netlink-scope, a constant flag instance-exec accepts with --rootfs (a pre-#1419 binary exits on it); the block comment says what route lets a tenant read file:external@0 084918373f50eb37c8ad323cbff87c9a5d327c0d713c4bbc09ba2701c8b12aba
+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;rev3=census-ruling-rootfs-netlink-route-1419;basis=the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added. Round-1 fix: the five tenant units' ExecStart= add --netlink-scope, a constant flag instance-exec accepts with --rootfs (a pre-#1419 binary exits on it); the block comment says what route lets a tenant read file:external@0 d16141b1ad33781e33ad61384c14f6b7764daa222dd27c4bfb06d1a45d3c0425
+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);rev3=census-ruling-w6-ingress-drain;basis=adds Before=carlos-edge-drain.service (with a comment). Ordering only; no read added.;rev3=census-ruling-rootfs-netlink-route-1419;basis=the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added. Round-1 fix: the five tenant units' ExecStart= add --netlink-scope, a constant flag instance-exec accepts with --rootfs (a pre-#1419 binary exits on it); the block comment says what route lets a tenant read file:external@0 157482e343556817fd4a4d1b571d4bd5b3fce1d55c9610f24a4ef4a43dd44a25
+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);rev3=census-ruling-w6-ingress-drain;basis=adds Before=carlos-edge-drain.service (with a comment). Ordering only; no read added.;rev3=census-ruling-rootfs-netlink-route-1419;basis=the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added. Round-1 fix: the five tenant units' ExecStart= add --netlink-scope, a constant flag instance-exec accepts with --rootfs (a pre-#1419 binary exits on it); the block comment says what route lets a tenant read file:external@0 f6484843ed12db291646fcce9d935b5cdc0be8cc00160c3e2d58ad4b4dfd8c2e
+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);rev3=census-ruling-w6-ingress-drain;basis=adds Before=carlos-edge-drain.service (with a comment). Ordering only; no read added.;rev3=census-ruling-rootfs-netlink-route-1419;basis=the restated rootfs block's RestrictAddressFamilies= gains AF_NETLINK (#1419), with a comment, byte-identical across the six rootfs units; applied by PID 1 to the unit's own process as carlos (empty CapabilityBoundingSet=, NoNewPrivileges=), narrowed to NETLINK_ROUTE by instance-exec --rootfs and the rootfs probe's seccomp scope. No bind source, Exec line, user, mount or path read by root added. Round-1 fix: the five tenant units' ExecStart= add --netlink-scope, a constant flag instance-exec accepts with --rootfs (a pre-#1419 binary exits on it); the block comment says what route lets a tenant read file:external@0 4459dcc0c3b3a7fc1b75194769f9ce46ffa598d844a1547b487704f76620daf9
+internal/instanceexec/netlink_route_linux.go ScopeNetlinkRoute legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-netlink-route-1419;basis=new (#1419): installs a seccomp filter on its own process (carlos, inside a rootfs unit, every thread via TSYNC) answering socket(AF_NETLINK, any type, protocol other than NETLINK_ROUTE) with EAFNOSUPPORT; nonnative and x32 calls ENOSYS. Its one read is the seccomp syscall; it opens no path and takes no tenant input; it only narrows what the unit allows. Not run by root. Round-1 fix: socketpair(AF_NETLINK, ...) is refused too file:Syscall@527 2a49962af9cb77dc3ef4e34514f951ae03d001c1466cfae3a749eb4e1b6d4ebc
+@coverage internal/host/units 8e2d527d528d57f1a1970c6789d6f443dc2efcba64b8a243e10f72d02bae5c00
+@coverage internal/instanceexec 23e7c54396aff424ddb2d7249357ac26691b3368e5a525eced27dec6a04655e7