gvisor demos: task 4 fix round 1 (authority test can fail)
Co-Authored-By: Astra (gpt-6-astra) via codex
6 files changed,
+150
−22
docs/superpowers/notes/census-proposal-gvisor-demos.md+2 −2internal/instancectl/ocibundle.go+17 −4internal/instancectl/ocibundle_test.go+124 −10internal/instancectl/server.go+3 −2internal/provision/testdata/plan14-root-reads-chain.tsv+1 −1internal/provision/testdata/plan14-root-reads-gvisor-demos.tsv+3 −3
CI failed — run details
Intent
diff --git a/docs/superpowers/notes/census-proposal-gvisor-demos.md b/docs/superpowers/notes/census-proposal-gvisor-demos.md| index 693cd54cb..d7abd53f5 100644 |
| --- a/docs/superpowers/notes/census-proposal-gvisor-demos.md |
| +++ b/docs/superpowers/notes/census-proposal-gvisor-demos.md |
| @@ -19,7 +19,7 @@ Ruling `census-ruling-gvisor-demos`. The independent reviewer approves or reject |
| | `internal/instancectl/rootfs.go` `Server.runRootfsProbe` | body | unchanged (1) | Refuse sandbox configuration or readiness errors before preparing or starting the native rootfs probe. Existing image read unchanged. | |
| | `internal/instancectl/server.go` `Server.RunProbe` | body | unchanged (1) | Refuse sandbox configuration or readiness errors before fixture reads and native probe dispatch. Existing probe read unchanged. | |
| | `internal/instancectl/server.go` `runWithClaim` | body | unchanged (4) | Retain sandbox modes and error; bind host-provided baseline and runtime callbacks without importing host templates. Existing reads unchanged. | |
| -| `internal/instancectl/server.go` `type Server` | body | unchanged (1) | Retain Task 1 mode/error/readiness fields; add baseline and runtime callbacks. No new direct read. Retain per-host validated staged descriptors and the root-selected probe nonce for Task 4 bundle reconstruction; no new direct read. | |
| +| `internal/instancectl/server.go` `type Server` | body | unchanged (1) | Retain Task 1 mode/error/readiness fields, baseline/runtime callbacks, Task 4 per-host validated staged descriptors and root-selected probe nonce. Fix round 1 adds a private writer-operation seam assigned only in package tests, after the unchanged GVisorID admission check; production defaults still call the same checked constructor, WriteRootfs, WriteBundle and verifier. No new direct read or request-controlled callback. | |
| | `system.go` `runSystem` | body | unchanged (0) | Dispatch fixed runsc-ensure and exec-sandbox-allows-prev system applets; no direct reads. | |
| | `system.go` `systemVerb` | body | unchanged (0) | Recognize two root sandbox applets; no direct reads. | |
| | `internal/host/systemapply.go` `systemApplier.stageCandidate` | sites | -file:OpenFile | Pass the already-open regular file fstat size to bounded preflight. Allocate payload once at exactly that size, use ReadFull then confirm EOF; hash and scan those same bytes before staging. Root-owned staged target is still checked before execution. Preserve staging on floor refusal for apply/install-channel. | |
| @@ -88,6 +88,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the |
| - new `internal/instancectl/ocibundle.go:readCarlosUser`: reads +file:ReadAll; written legacy, accepted-legacy, frozen |
| - new `internal/instanceexec/sandbox_linux.go:gvisorProbeChecks`: reads +data-literal, +file:ReadFile; written legacy, accepted-legacy, frozen |
| -Seal: `b970bb28c5a633d2572a1da549030e9258cfdabb6322ddffdd0ebf41b56c464c` → `a95443313bc57395b554a627681ddb5e03a970fa5ff43771ba276be0e886785e`. |
| +Seal: `b970bb28c5a633d2572a1da549030e9258cfdabb6322ddffdd0ebf41b56c464c` → `9b769d88ce32a7c9621a2b7af6192c33bdb5bc456ffb227dac46eec64939920e`. |
| Overlay: `internal/provision/testdata/plan14-root-reads-gvisor-demos.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`. |
diff --git a/internal/instancectl/ocibundle.go b/internal/instancectl/ocibundle.go| index 0ff7d3d04..2dd5a65f4 100644 |
| --- a/internal/instancectl/ocibundle.go |
| +++ b/internal/instancectl/ocibundle.go |
| @@ -114,6 +114,15 @@ func (s *Server) gvisorBundleLayout(host string, role Role, gen uint64) ([]byte, |
| return gvisorBundlePlan(host, role, gen, gvisorInputs{User: user, NOFILE: nofile, App: app, Live: live, Nonce: s.gvisorProbeNonce}) |
| } |
| +// Only package tests supply these operations, to observe writes without root. |
| +// Production always uses the checked constructor, writers and verifier below. |
| +type gvisorBundleOps struct { |
| + layout func(string, Role, uint64) ([]byte, execsandbox.MountLayout, error) |
| + writeRootfs func(string, execsandbox.MountLayout) error |
| + writeBundle func(string, []byte) error |
| + verify func(string, Role, uint64) error |
| +} |
| + |
| // Callers hold the original-run fence and prove the old invocation idle before |
| // writing. Cleanup belongs to that fence's stop proof, never to this writer. |
| func (s *Server) writeGVisorBundle(host string, role Role, gen uint64) (id string, raw []byte, err error) { |
| @@ -121,18 +130,22 @@ func (s *Server) writeGVisorBundle(host string, role Role, gen uint64) (id strin |
| if err != nil { |
| return "", nil, err |
| } |
| + ops := gvisorBundleOps{layout: s.gvisorBundleLayout, writeRootfs: execsandbox.WriteRootfs, writeBundle: execsandbox.WriteBundle, verify: s.verifyGVisorBundle} |
| + if s.gvisorBundleTestOps != nil { |
| + ops = *s.gvisorBundleTestOps |
| + } |
| var layout execsandbox.MountLayout |
| - raw, layout, err = s.gvisorBundleLayout(host, role, gen) |
| + raw, layout, err = ops.layout(host, role, gen) |
| if err != nil { |
| return "", nil, err |
| } |
| - if err = execsandbox.WriteRootfs(id, layout); err != nil { |
| + if err = ops.writeRootfs(id, layout); err != nil { |
| return "", nil, err |
| } |
| - if err = execsandbox.WriteBundle(id, raw); err != nil { |
| + if err = ops.writeBundle(id, raw); err != nil { |
| return "", nil, err |
| } |
| - if err = s.verifyGVisorBundle(host, role, gen); err != nil { |
| + if err = ops.verify(host, role, gen); err != nil { |
| return "", nil, err |
| } |
| return id, raw, nil |
diff --git a/internal/instancectl/ocibundle_test.go b/internal/instancectl/ocibundle_test.go| index b3c5c427d..6e08629ac 100644 |
| --- a/internal/instancectl/ocibundle_test.go |
| +++ b/internal/instancectl/ocibundle_test.go |
| @@ -4,6 +4,7 @@ import ( |
| "bytes" |
| "context" |
| "encoding/json" |
| + "errors" |
| "os" |
| "path/filepath" |
| "reflect" |
| @@ -76,19 +77,132 @@ func TestGVisorBundle(t *testing.T) { |
| } |
| func TestGVisorBundleAuthority(t *testing.T) { |
| - for _, tc := range []struct { |
| - host string |
| - role Role |
| - gen uint64 |
| - }{{"../bad", RoleRun, 0}, {"_probe", RoleRun, 0}, {"demo.example", RoleRun, 1}, {"demo.example", RoleSeed, 0}, {"demo.example", roleProbe, 0}, {"_probe", roleProbe, 1}, {"", RoleRun, 0}} { |
| - s := &Server{ExeRoot: filepath.Join(t.TempDir(), "must-not-exist")} |
| - if _, _, err := s.writeGVisorBundle(tc.host, tc.role, tc.gen); err == nil { |
| - t.Fatalf("accepted %+v", tc) |
| + t.Run("valid-control", func(t *testing.T) { |
| + s, roots := gvisorAuthorityFixture(t) |
| + id, raw, err := s.writeGVisorBundle("demo.example", RoleRun, 0) |
| + if err != nil || id != "run-demo.example" || len(raw) == 0 { |
| + t.Fatalf("valid writer: id=%q err=%v", id, err) |
| + } |
| + for _, root := range roots { |
| + entries, err := os.ReadDir(root) |
| + if err != nil || len(entries) != 1 || entries[0].Name() != id { |
| + t.Fatalf("writer did not reach target root %s: %v, %v", root, entries, err) |
| + } |
| } |
| - if _, err := os.Lstat(s.ExeRoot); !os.IsNotExist(err) { |
| - t.Fatal("invalid request touched disk", err) |
| + }) |
| + for _, tc := range []struct { |
| + name, host string |
| + role Role |
| + gen uint64 |
| + }{ |
| + {"generation", "demo.example", RoleRun, 1}, |
| + {"seed", "demo.example", RoleSeed, 0}, |
| + {"sidecar", "demo.example", RoleSidecar, 0}, |
| + {"command", "demo.example", RoleCmd, 0}, |
| + {"tty", "demo.example", RoleTTY, 0}, |
| + {"worker", "demo.example", RoleWorker, 0}, |
| + {"unknown-role", "demo.example", Role("other"), 0}, |
| + {"empty-role", "demo.example", Role(""), 0}, |
| + {"probe-as-run", "_probe", RoleRun, 0}, |
| + {"probe-wrong-host", "demo.example", roleProbe, 0}, |
| + {"probe-generation", "_probe", roleProbe, 1}, |
| + {"traversal-host", "../bad", RoleRun, 0}, |
| + {"empty-host", "", RoleRun, 0}, |
| + {"slash-host", "demo.example/path", RoleRun, 0}, |
| + {"nul-host", "demo.example\x00", RoleRun, 0}, |
| + {"space-host", "demo example", RoleRun, 0}, |
| + } { |
| + t.Run("refused/"+tc.name, func(t *testing.T) { |
| + s, roots := gvisorAuthorityFixture(t) |
| + if _, err := GVisorID(tc.host, tc.role, tc.gen); !errors.Is(err, execsandbox.ErrUnsupported) { |
| + t.Errorf("GVisorID refusal: got %v, want ErrUnsupported", err) |
| + } |
| + if _, _, err := s.writeGVisorBundle(tc.host, tc.role, tc.gen); !errors.Is(err, execsandbox.ErrUnsupported) { |
| + t.Errorf("writeGVisorBundle refusal: got %v, want ErrUnsupported", err) |
| + } |
| + for name, root := range roots { |
| + entries, err := os.ReadDir(root) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if len(entries) != 0 { |
| + t.Errorf("%s target changed: %v", name, entries) |
| + } |
| + } |
| + }) |
| + } |
| +} |
| + |
| +// The post-admission inputs stay valid even for a refused request. This isolates |
| +// the first authority gate: later validation cannot make its regression pass. |
| +// Filesystem callbacks replace only privileged I/O, and write to the very roots |
| +// each assertion inspects. The valid control proves both callbacks write there. |
| +func gvisorAuthorityFixture(t *testing.T) (*Server, map[string]string) { |
| + t.Helper() |
| + root := t.TempDir() |
| + s := &Server{ExeRoot: filepath.Join(root, "exe")} |
| + app := filepath.Join(root, "app") |
| + if err := os.WriteFile(app, []byte("fixture executable"), 0755); err != nil { |
| + t.Fatal(err) |
| + } |
| + if err := ensureExe(s.ExeRoot, "demo.example", app, "demo.example"); err != nil { |
| + t.Fatal(err) |
| + } |
| + roots := map[string]string{"bundle": filepath.Join(root, "oci"), "rootfs": filepath.Join(root, "oci-rootfs")} |
| + for _, p := range roots { |
| + if err := os.Mkdir(p, 0700); err != nil { |
| + t.Fatal(err) |
| } |
| } |
| + in := gvisorInputs{User: execsandbox.User{UID: 1000, GID: 1000}, NOFILE: execsandbox.Rlimit{Type: "RLIMIT_NOFILE", Soft: 1024, Hard: 524288}, App: app, Live: filepath.Join(s.ExeRoot, "demo.example", "live")} |
| + raw, layout, err := gvisorBundlePlan("demo.example", RoleRun, 0, in) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + s.gvisorBundleTestOps = &gvisorBundleOps{ |
| + layout: func(string, Role, uint64) ([]byte, execsandbox.MountLayout, error) { return raw, layout, nil }, |
| + writeRootfs: func(id string, p execsandbox.MountLayout) error { |
| + if !execsandbox.ValidID(id) { |
| + t.Fatalf("unsafe fixture id: %q", id) |
| + } |
| + for _, entry := range p.Skeleton { |
| + target := filepath.Join(roots["rootfs"], id, entry.Path) |
| + if entry.File { |
| + if err := os.WriteFile(target, nil, 0444); err != nil { |
| + return err |
| + } |
| + } else if err := os.MkdirAll(target, 0755); err != nil { |
| + return err |
| + } |
| + } |
| + return nil |
| + }, |
| + writeBundle: func(id string, b []byte) error { |
| + if !execsandbox.ValidID(id) { |
| + t.Fatalf("unsafe fixture id: %q", id) |
| + } |
| + dir := filepath.Join(roots["bundle"], id) |
| + if err := os.Mkdir(dir, 0700); err != nil { |
| + return err |
| + } |
| + return os.WriteFile(filepath.Join(dir, "config.json"), b, 0600) |
| + }, |
| + verify: func(host string, role Role, gen uint64) error { |
| + id, err := GVisorID(host, role, gen) |
| + if err != nil { |
| + return err |
| + } |
| + got, err := os.ReadFile(filepath.Join(roots["bundle"], id, "config.json")) |
| + if err != nil { |
| + return err |
| + } |
| + return execsandbox.CompareBundle(got, raw) |
| + }, |
| + } |
| + return s, roots |
| +} |
| + |
| +func TestGVisorBundleIdentity(t *testing.T) { |
| if GVisorUnitName("demo-test.example") != `carlos-instance-gvisor@demo\x2dtest.example.service` || GVisorUnitName("../bad") != "" { |
| t.Fatal("unit name") |
| } |
diff --git a/internal/instancectl/server.go b/internal/instancectl/server.go| index 81a1afd16..71a1ff040 100644 |
| --- a/internal/instancectl/server.go |
| +++ b/internal/instancectl/server.go |
| @@ -43,8 +43,9 @@ import ( |
| // source; nothing from a request reaches systemctl as a string. |
| type Server struct { |
| // Rechecked on bundle construction; starts retain these under the host fence. |
| - gvisorStaged sync.Map |
| - gvisorProbeNonce string |
| + gvisorStaged sync.Map |
| + gvisorProbeNonce string |
| + gvisorBundleTestOps *gvisorBundleOps |
| SandboxConfigured execsandbox.Configured |
| SandboxEffective execsandbox.Effective |
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv| index e8a0de342..5fb1bd141 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-chain.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-chain.tsv |
| @@ -128,4 +128,4 @@ plan14-root-reads-fix-activator-backoff-flake.tsv feba66806ddfcbdfaf369d72413bb1 |
| plan14-root-reads-region-ha-dr5.tsv f19eb78c1da1475cbf8e11a3d6c394d828aa1c8f88ae24469fe8d473581b934b |
| plan14-root-reads-instance-syscall-filter.tsv b970bb28c5a633d2572a1da549030e9258cfdabb6322ddffdd0ebf41b56c464c |
| plan14-root-reads-instance-restore-658-cli.tsv b970bb28c5a633d2572a1da549030e9258cfdabb6322ddffdd0ebf41b56c464c |
| -plan14-root-reads-gvisor-demos.tsv a95443313bc57395b554a627681ddb5e03a970fa5ff43771ba276be0e886785e |
| +plan14-root-reads-gvisor-demos.tsv 9b769d88ce32a7c9621a2b7af6192c33bdb5bc456ffb227dac46eec64939920e |
diff --git a/internal/provision/testdata/plan14-root-reads-gvisor-demos.tsv b/internal/provision/testdata/plan14-root-reads-gvisor-demos.tsv| index c1f7b5b2d..60410218e 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-gvisor-demos.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-gvisor-demos.tsv |
| @@ -8,7 +8,7 @@ |
| @legacy 5fd7a23e052a152316c75b4c833012f4ac059e747fa492da80bf6e1706058039 internal/instancectl/demo_policy.go Server.demoHandler legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=R26: HostDemo and the demo start/purge lock run only in demo mode. Ordinary starts do not read HostDemo or gain its read-error refusal. Demo-mode missing/non-demo/held-row and read-error refusals remain.;rev3=census-ruling-gvisor-demos;basis=Retain authenticated claim cleanup routes on demo-plus-claims sandbox refusal when a ClaimStop handler exists; sandbox admission still rejects claim launches, and claimAwareLegacy rejects legacy mutations. Existing registry reads unchanged. file:Query@485,file:Query@525,registry:Status@703,whole:Route@658 b52ba1d3b35ed5195d5009ec59c180abd32262bd716ddbac4e1de245f1173d2e |
| @legacy 05b7a387b7ff2a6a99259dde4f508f308afaf7cfff9a08c2ddc648169578c082 internal/instancectl/rootfs.go Server.runRootfsProbe legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=instance control (/opt/carlos/carlos instance-control, carlos-instance-control.service, root);basis=root-input (J2,J4, as Server.RunProbe): new (rootfs Plan 2 Task 7): builds the probe image once per service start, hashes it (fileSHA256), lays out the _probe rootfs exe layout and its box-addrs, starts carlos-instance-rootfs-probe.service and ReadFiles its report from /run/carlos-control/rootfs-probe.out, which PID 1 writes from the probe's stdout; the probe runs the platform binary from root's own probe image, no tenant code; the report only decides readiness, and without an ok root-image line it is never ready, whatever it says;rev3=census-ruling-agent-start-demo-1;basis=Reads DemoBox and refuses before preparing or launching a rootfs probe; ordinary probe behavior unchanged.;rev3=census-ruling-gvisor-demos;basis=Refuse sandbox configuration or readiness errors before preparing or starting the native rootfs probe. Existing image read unchanged. file:ReadFile@2005 6ad27d7fe661eba457ea01736b8c482e27fd3d1a64ed80e8afefa8ffe4e9f386 |
| @legacy 7129928a96c588d2dcaf6e93b8c5e5f6977f2519ccb60f1af361f7b1c57602ee internal/instancectl/server.go Server.RunProbe legacy accepted-legacy accepted-legacy;rev3=J2,J4;basis=root-input;rev3=census-ruling-rootfs-apps-2;basis=after the resolver allow it applies the box-address deny (denyLocalAddrs: set-property IPAddressDeny on carlos-instances.slice from localPrefixes, which reads /proc/net/fib_trie and /proc/net/if_inet6 as LocalAddrs already did), writes the probe's box-addrs under its own exe layout (writeFileExcl, a decision row), and after the binary probe runs the rootfs probe (runRootfsProbe, a decision row); its own direct read, probe.out, is unchanged;rev3=census-ruling-region-ha-p3b;basis=Take shared root hairpin lease for the entire probe so deny refresh and hairpin mutation cannot race it. Indirect reads validate root boot snapshot, root state/fence and interface inventory; existing probe.out direct read remains and lock/config errors fail readiness.;rev3=census-ruling-gvisor-demos;basis=Refuse sandbox configuration or readiness errors before fixture reads and native probe dispatch. Existing probe read unchanged. file:ReadFile@2608 2a0e32e04c6e0c5f25021c62f760f72429fa5e91d7597fcc4b09b7fdf5790b34 |
| -@legacy d9a4af73ae74fd61e028c47d796a277efb91a64f223e17d1e4d3036e24587466 internal/instancectl/server.go type Server legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=Re-digested at the pre-land merge: the body includes main's own change under census ruling 292, with no further change from this branch. Census ruling 292 reclassified this declaration accepted-legacy (J2,J4) for root's per-host ordering of legacy run starts against stops; this ruling kept the row as main classed it. Its own addition is the cmd start's poll and wait bounds and its per-host lock map: field declarations only;rev3=census-ruling-rootfs-apps-2;basis=new fields: HostRuntime, ProbeImage, ProbeImageFile, RootfsProbeOut, DenyEvery, the deny's lastDeny and denyMu, the rootfs probe's report and lock, the jit reload counters and imageDigests; genStarting counts binary generation starts per unit; rootfsLocksMu and rootfsLocks, one lock entry per rootfs unit name being started or removed right now, held by a start from its layout through systemctl start and its own cleanup and by a removal from its proof through the raw removal, a removal refusing while it is taken, a waiting start giving up when its request ends, an entry dropped with its last holder or waiter (fixes E6, L2, L3); rootfsProvenHook, a test hook run between the proof and the raw removal; field declarations only; no read added;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 and #329 plan 3 Task 5: the declaration gains sliceLocks (one mutex per host slice, taken by /size and /parent) and Egress (the asserter every start path calls), and its comment names the egress allow (plan 3's ControlDropInDir field was deleted in ef38e13b, the P1 EROFS fix); the same one site, the Statfs field, offset moved; no read added.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 6: comments only: the one-shot pacing fields cover /cmd and /tty, and cmdLocks is now keyed by (role, host) (oneShotKey, PF-7) so a session's start never waits behind a command's; field declarations unchanged; the same one site, no read added;rev3=census-ruling-agent-start-demo-1;basis=Adds fixed demo configuration, registry views, derived runtime root, synchronization and purge guard.;rev3=census-ruling-region-ha-p3b;basis=Add hairpinActive boolean alongside lastDeny under existing deny synchronization. Field declaration only; existing Statfs selector unchanged, no new read or externally supplied authority.;rev3=census-ruling-region-ha-p3b2-rolls;basis=adds one field holding the current hairpin exit watcher, guarded by the root hairpin flock; no new read;rev3=census-ruling-agent-start-demo-3;basis=Retain the snapshot supervisor in instance-control state; no new request-selected path. Census read-site delta: unchanged (1).;rev3=census-ruling-gvisor-demos;basis=Retain Task 1 mode/error/readiness fields; add baseline and runtime callbacks. No new direct read. Retain per-host validated staged descriptors and the root-selected probe nonce for Task 4 bundle reconstruction; no new direct read. file:Statfs@4335 a716011c72906d5c345685c71e54157754d633e6292cbd462875f4986ed66067 |
| +@legacy 888bd7fc55c775fe924516afbe17bdd3f1234a210edd65ec750f79ea6d646917 internal/instancectl/server.go type Server legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=Re-digested at the pre-land merge: the body includes main's own change under census ruling 292, with no further change from this branch. Census ruling 292 reclassified this declaration accepted-legacy (J2,J4) for root's per-host ordering of legacy run starts against stops; this ruling kept the row as main classed it. Its own addition is the cmd start's poll and wait bounds and its per-host lock map: field declarations only;rev3=census-ruling-rootfs-apps-2;basis=new fields: HostRuntime, ProbeImage, ProbeImageFile, RootfsProbeOut, DenyEvery, the deny's lastDeny and denyMu, the rootfs probe's report and lock, the jit reload counters and imageDigests; genStarting counts binary generation starts per unit; rootfsLocksMu and rootfsLocks, one lock entry per rootfs unit name being started or removed right now, held by a start from its layout through systemctl start and its own cleanup and by a removal from its proof through the raw removal, a removal refusing while it is taken, a waiting start giving up when its request ends, an entry dropped with its last holder or waiter (fixes E6, L2, L3); rootfsProvenHook, a test hook run between the proof and the raw removal; field declarations only; no read added;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 and #329 plan 3 Task 5: the declaration gains sliceLocks (one mutex per host slice, taken by /size and /parent) and Egress (the asserter every start path calls), and its comment names the egress allow (plan 3's ControlDropInDir field was deleted in ef38e13b, the P1 EROFS fix); the same one site, the Statfs field, offset moved; no read added.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 6: comments only: the one-shot pacing fields cover /cmd and /tty, and cmdLocks is now keyed by (role, host) (oneShotKey, PF-7) so a session's start never waits behind a command's; field declarations unchanged; the same one site, no read added;rev3=census-ruling-agent-start-demo-1;basis=Adds fixed demo configuration, registry views, derived runtime root, synchronization and purge guard.;rev3=census-ruling-region-ha-p3b;basis=Add hairpinActive boolean alongside lastDeny under existing deny synchronization. Field declaration only; existing Statfs selector unchanged, no new read or externally supplied authority.;rev3=census-ruling-region-ha-p3b2-rolls;basis=adds one field holding the current hairpin exit watcher, guarded by the root hairpin flock; no new read;rev3=census-ruling-agent-start-demo-3;basis=Retain the snapshot supervisor in instance-control state; no new request-selected path. Census read-site delta: unchanged (1).;rev3=census-ruling-gvisor-demos;basis=Retain Task 1 mode/error/readiness fields, baseline/runtime callbacks, Task 4 per-host validated staged descriptors and root-selected probe nonce. Fix round 1 adds a private writer-operation seam assigned only in package tests, after the unchanged GVisorID admission check; production defaults still call the same checked constructor, WriteRootfs, WriteBundle and verifier. No new direct read or request-controlled callback. file:Statfs@4379 2279039b35f70216a08cc8686230aa8b74945bc06094ddb2f2b777a436fcc144 |
| @legacy 4fb49c7ba8d52c022c0748d216f18a99d973c0a5a858e790446558f2eff9500c internal/execsandbox/file_linux.go checkRunscDir legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Open and fstat root-owned no-follow runtime directories; require 0755. Paths selected by compiled pin or root-owned installation temp. file:Stat@137 39283ba464884471a3085ea8bbb9260eb7b82c7300444aff12680cbee6018a05 |
| @legacy 3a6e0c0d7ef5c570e3b1d1d803ac705cd45c84fb9b50868a9582446548a9e956 internal/execsandbox/file_linux.go openCheckedDir legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Walk absolute clean path from root with O_DIRECTORY/O_NOFOLLOW; fstat each ancestor for root ownership and no non-root write bits. No agent-selected path in production. file:Open@197,file:Openat@458,file:Stat@687 8b45bad16e2732bd7fdfc69a8beb7f4961936cedd7f36ad4d957b02df3e2dddf |
| @legacy 518c5527298ee264e142c0d5e9ed806175417c5f87108b6d73b48f5f120899a7 internal/execsandbox/file_linux.go openCheckedFile legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Open leaf relative to checked root-owned parent with O_NOFOLLOW/O_NONBLOCK; fstat regular/single-link/root-owned/mode/size metadata before reading. No symlink traversal. file:Openat@297,file:Stat@524 fedd812d2fa99959f5b58a51ab767935396e922009eae3b5d1f93afd1f872be9 |
| @@ -60,7 +60,7 @@ internal/instancectl/demo_policy.go Server.demoHandler legacy accepted-legacy ac |
| internal/instancectl/rootfs.go Server.runRootfsProbe legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=instance control (/opt/carlos/carlos instance-control, carlos-instance-control.service, root);basis=root-input (J2,J4, as Server.RunProbe): new (rootfs Plan 2 Task 7): builds the probe image once per service start, hashes it (fileSHA256), lays out the _probe rootfs exe layout and its box-addrs, starts carlos-instance-rootfs-probe.service and ReadFiles its report from /run/carlos-control/rootfs-probe.out, which PID 1 writes from the probe's stdout; the probe runs the platform binary from root's own probe image, no tenant code; the report only decides readiness, and without an ok root-image line it is never ready, whatever it says;rev3=census-ruling-agent-start-demo-1;basis=Reads DemoBox and refuses before preparing or launching a rootfs probe; ordinary probe behavior unchanged.;rev3=census-ruling-gvisor-demos;basis=Refuse sandbox configuration or readiness errors before preparing or starting the native rootfs probe. Existing image read unchanged. file:ReadFile@2005 6ad27d7fe661eba457ea01736b8c482e27fd3d1a64ed80e8afefa8ffe4e9f386 |
| internal/instancectl/server.go Server.RunProbe legacy accepted-legacy accepted-legacy;rev3=J2,J4;basis=root-input;rev3=census-ruling-rootfs-apps-2;basis=after the resolver allow it applies the box-address deny (denyLocalAddrs: set-property IPAddressDeny on carlos-instances.slice from localPrefixes, which reads /proc/net/fib_trie and /proc/net/if_inet6 as LocalAddrs already did), writes the probe's box-addrs under its own exe layout (writeFileExcl, a decision row), and after the binary probe runs the rootfs probe (runRootfsProbe, a decision row); its own direct read, probe.out, is unchanged;rev3=census-ruling-region-ha-p3b;basis=Take shared root hairpin lease for the entire probe so deny refresh and hairpin mutation cannot race it. Indirect reads validate root boot snapshot, root state/fence and interface inventory; existing probe.out direct read remains and lock/config errors fail readiness.;rev3=census-ruling-gvisor-demos;basis=Refuse sandbox configuration or readiness errors before fixture reads and native probe dispatch. Existing probe read unchanged. file:ReadFile@2608 2a0e32e04c6e0c5f25021c62f760f72429fa5e91d7597fcc4b09b7fdf5790b34 |
| internal/instancectl/server.go runWithClaim authority C,D,G Claim instance controller adds held-release RPC dispatch within existing launch/participation execution boundary.;rev3=census-ruling-rootfs-apps-2;basis=takes a RegistryView (HostApp and HostRuntime) for the bare hostApp, and the production Server literal gains HostRuntime, ProbeImage: BuildProbeImage, ProbeImageFile: ProbeImagePath, RootfsProbeOut under /run/carlos-control and DenyEvery: 10s; this body reads nothing new itself; the readers it wires (instanceRegistryHostRuntime, BuildProbeImage, the rootfs probe's output) are decision rows;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 4 and #329 plan 3 Task 5: takes the egress asserter as a parameter, sets it on the production Server literal (Egress) and starts its 30 s Loop beside probeLoop and diskLoop; the literal also names the fixture check ProbeFixturesOK (renamed in plan 2 Task 14). It sets no control drop-in directory: plan 3's ControlDropInDir default (/run/systemd/system.control) was deleted with removeGenControlDropIn in ef38e13b (the P1 EROFS fix), so instance control names systemd's control directory only to read it (TrustedDropinReader). The same four sites (the two exec.CommandContext closures, statfsBytes, the data literal), offsets moved; no read added.;rev3=census-ruling-agent-start-demo-1;basis=Wires root-owned demo config and existing fixed paths into the service.;rev3=census-ruling-region-ha-p3b;basis=Resume root-owned hairpin state before probes/control service work; verify current systemd agent identity and kernel fence/addresses, restore pidfd watch or revoke stale state. Same direct exec/statfs/data sites; indirect inputs are protected root snapshot/state and kernel evidence, never receipt data.;rev3=census-ruling-agent-start-demo-3;basis=Construct the demo snapshot supervisor for configured demo boxes; startup cleanup gates builder readiness. Census read-site delta: unchanged (4).;rev3=census-ruling-gvisor-demos;basis=Retain sandbox modes and error; bind host-provided baseline and runtime callbacks without importing host templates. Existing reads unchanged. data-literal@2323,file:CommandContext@1076,file:CommandContext@1254,file:Statfs@2344 6d9c80b9038fe17e9b1e71188557d0c9e93a5ba6efeaa9566f85bfce1207403b |
| -internal/instancectl/server.go type Server legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=Re-digested at the pre-land merge: the body includes main's own change under census ruling 292, with no further change from this branch. Census ruling 292 reclassified this declaration accepted-legacy (J2,J4) for root's per-host ordering of legacy run starts against stops; this ruling kept the row as main classed it. Its own addition is the cmd start's poll and wait bounds and its per-host lock map: field declarations only;rev3=census-ruling-rootfs-apps-2;basis=new fields: HostRuntime, ProbeImage, ProbeImageFile, RootfsProbeOut, DenyEvery, the deny's lastDeny and denyMu, the rootfs probe's report and lock, the jit reload counters and imageDigests; genStarting counts binary generation starts per unit; rootfsLocksMu and rootfsLocks, one lock entry per rootfs unit name being started or removed right now, held by a start from its layout through systemctl start and its own cleanup and by a removal from its proof through the raw removal, a removal refusing while it is taken, a waiting start giving up when its request ends, an entry dropped with its last holder or waiter (fixes E6, L2, L3); rootfsProvenHook, a test hook run between the proof and the raw removal; field declarations only; no read added;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 and #329 plan 3 Task 5: the declaration gains sliceLocks (one mutex per host slice, taken by /size and /parent) and Egress (the asserter every start path calls), and its comment names the egress allow (plan 3's ControlDropInDir field was deleted in ef38e13b, the P1 EROFS fix); the same one site, the Statfs field, offset moved; no read added.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 6: comments only: the one-shot pacing fields cover /cmd and /tty, and cmdLocks is now keyed by (role, host) (oneShotKey, PF-7) so a session's start never waits behind a command's; field declarations unchanged; the same one site, no read added;rev3=census-ruling-agent-start-demo-1;basis=Adds fixed demo configuration, registry views, derived runtime root, synchronization and purge guard.;rev3=census-ruling-region-ha-p3b;basis=Add hairpinActive boolean alongside lastDeny under existing deny synchronization. Field declaration only; existing Statfs selector unchanged, no new read or externally supplied authority.;rev3=census-ruling-region-ha-p3b2-rolls;basis=adds one field holding the current hairpin exit watcher, guarded by the root hairpin flock; no new read;rev3=census-ruling-agent-start-demo-3;basis=Retain the snapshot supervisor in instance-control state; no new request-selected path. Census read-site delta: unchanged (1).;rev3=census-ruling-gvisor-demos;basis=Retain Task 1 mode/error/readiness fields; add baseline and runtime callbacks. No new direct read. Retain per-host validated staged descriptors and the root-selected probe nonce for Task 4 bundle reconstruction; no new direct read. file:Statfs@4335 a716011c72906d5c345685c71e54157754d633e6292cbd462875f4986ed66067 |
| +internal/instancectl/server.go type Server legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=Re-digested at the pre-land merge: the body includes main's own change under census ruling 292, with no further change from this branch. Census ruling 292 reclassified this declaration accepted-legacy (J2,J4) for root's per-host ordering of legacy run starts against stops; this ruling kept the row as main classed it. Its own addition is the cmd start's poll and wait bounds and its per-host lock map: field declarations only;rev3=census-ruling-rootfs-apps-2;basis=new fields: HostRuntime, ProbeImage, ProbeImageFile, RootfsProbeOut, DenyEvery, the deny's lastDeny and denyMu, the rootfs probe's report and lock, the jit reload counters and imageDigests; genStarting counts binary generation starts per unit; rootfsLocksMu and rootfsLocks, one lock entry per rootfs unit name being started or removed right now, held by a start from its layout through systemctl start and its own cleanup and by a removal from its proof through the raw removal, a removal refusing while it is taken, a waiting start giving up when its request ends, an entry dropped with its last holder or waiter (fixes E6, L2, L3); rootfsProvenHook, a test hook run between the proof and the raw removal; field declarations only; no read added;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 and #329 plan 3 Task 5: the declaration gains sliceLocks (one mutex per host slice, taken by /size and /parent) and Egress (the asserter every start path calls), and its comment names the egress allow (plan 3's ControlDropInDir field was deleted in ef38e13b, the P1 EROFS fix); the same one site, the Statfs field, offset moved; no read added.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 6: comments only: the one-shot pacing fields cover /cmd and /tty, and cmdLocks is now keyed by (role, host) (oneShotKey, PF-7) so a session's start never waits behind a command's; field declarations unchanged; the same one site, no read added;rev3=census-ruling-agent-start-demo-1;basis=Adds fixed demo configuration, registry views, derived runtime root, synchronization and purge guard.;rev3=census-ruling-region-ha-p3b;basis=Add hairpinActive boolean alongside lastDeny under existing deny synchronization. Field declaration only; existing Statfs selector unchanged, no new read or externally supplied authority.;rev3=census-ruling-region-ha-p3b2-rolls;basis=adds one field holding the current hairpin exit watcher, guarded by the root hairpin flock; no new read;rev3=census-ruling-agent-start-demo-3;basis=Retain the snapshot supervisor in instance-control state; no new request-selected path. Census read-site delta: unchanged (1).;rev3=census-ruling-gvisor-demos;basis=Retain Task 1 mode/error/readiness fields, baseline/runtime callbacks, Task 4 per-host validated staged descriptors and root-selected probe nonce. Fix round 1 adds a private writer-operation seam assigned only in package tests, after the unchanged GVisorID admission check; production defaults still call the same checked constructor, WriteRootfs, WriteBundle and verifier. No new direct read or request-controlled callback. file:Statfs@4379 2279039b35f70216a08cc8686230aa8b74945bc06094ddb2f2b777a436fcc144 |
| system.go runSystem authority B,C,D,F,G,J4 rev3=census-ruling-self-serve-moves-1;identity=explicit operator CLI uid 0;basis=adds the lifetimes family to the system dispatch (carlos system lifetimes cutover, a console door call as the operator); every existing command branch unchanged;rev3=census-ruling-claims-cleanup-r2;basis=claims cleanup R2: drops the claims case (host.RunSystemClaims, deleted); every other branch unchanged; no read added;rev3=census-ruling-nearest-region-a;basis=adds the hosts-used family to the system dispatch (carlos system hosts-used status, one GET of a console door as the operator); every existing command branch unchanged; no read added;rev3=census-ruling-region-ha-p1a;basis=explicit operator CLI and root units, uid 0: drops the "join" case (host.RunSystemJoin, deleted with internal/host/joinroot.go, its only caller) and its line in the usage text; every other branch unchanged; no read added;rev3=census-ruling-named-unit-delivery-114;basis=the system verb dispatch gains named-units, routed to host.RunSystemNamedUnits; no read of its own;rev3=census-ruling-design-pdf-service;basis=add dispatch for carlos system pdf; no new reads;rev3=census-ruling-managed-fleets-2a;basis=Adds managed-fleets operator CLI dispatch; no direct read added; existing root command branches unchanged.;rev3=census-ruling-agent-start-demo-2;basis=system.go:62-66 adds the demos family dispatch to the console-only operator client (system_demos.go:19, system_demos_api.go:23); no direct read added and other root commands are unchanged.;rev3=census-ruling-region-ha-p3b2;basis=Dispatches carlos system group-maintenance {status|permit|revoke|prepare|apply|rollback} to internal/host; no read of its own.;rev3=census-ruling-gvisor-demos;basis=Dispatch fixed runsc-ensure and exec-sandbox-allows-prev system applets; no direct reads. b2d431b47f8d15cd017b8fd7507865f099465973c9f1eef8e5cc0ee6e3d1f588 |
| system.go systemVerb authority B,C,D,F,G,J4 rev3=census-ruling-self-serve-moves-1;identity=explicit operator CLI uid 0;basis=adds the lifetimes family to the system dispatch (carlos system lifetimes cutover, a console door call as the operator); every existing command branch unchanged;rev3=census-ruling-claims-cleanup-r2;basis=claims cleanup R2: drops "claims" from the verb list, so it now falls to the unknown-verb message; no read added;rev3=census-ruling-nearest-region-a;basis=adds "hosts-used" to the verb list, routed to runSystemHostsUsedVerb; no read added;rev3=census-ruling-region-ha-p1a;basis=explicit operator CLI and root units, uid 0: drops "join" from the verb list, so `carlos system join` now falls to the unknown-verb message; no read added;rev3=census-ruling-named-unit-delivery-114;basis=the known-verb list gains named-units; no read of its own;rev3=census-ruling-design-pdf-service;basis=add recognition for carlos system pdf; no new reads;rev3=census-ruling-managed-fleets-2a;basis=Recognizes managed-fleets as a CLI family; no read added.;rev3=census-ruling-agent-start-demo-2;basis=system.go:43-57 recognizes demos; parsing only, no direct read added.;rev3=census-ruling-region-ha-p3b2;basis=Recognizes group-maintenance as a system verb; parsing only.;rev3=census-ruling-gvisor-demos;basis=Recognize two root sandbox applets; no direct reads. 05f652ae4aa1ba135b6bb0358be5570fe13c74e385609124a66d9947ad1f906b |
| internal/execsandbox/file_linux.go checkRunscDir legacy accepted-legacy accepted-legacy;rev3=census-ruling-gvisor-demos;basis=Open and fstat root-owned no-follow runtime directories; require 0755. Paths selected by compiled pin or root-owned installation temp. file:Stat@137 39283ba464884471a3085ea8bbb9260eb7b82c7300444aff12680cbee6018a05 |
| @@ -103,5 +103,5 @@ internal/host/systemapply.go systemApplier.stageCandidate legacy accepted-legacy |
| @coverage internal/execsandbox 2e94d03c097be203102790e999973c03a941fab38e9bac326f0b1570758d1d14 |
| @coverage internal/host ac30199a6dab2d9e57234bbfd8a6f9d377115cdf16cbdd0ef612fa0418e9fb1d |
| @coverage internal/host/units 93402572d2fc9c32b563820a36d565afa2ed951637bde9561fe2e845137a6524 |
| -@coverage internal/instancectl 1b49f783028887e95b215a129b18b4fa308ec685e4f253cd21d19135f0d58714 |
| +@coverage internal/instancectl c39418dcaee954f3a118c762febe64ca80788eeb6db909a474b47ce12f7708d5 |
| @coverage internal/instanceexec 451a4cb9a8fc078f883afab1c361678185c332a1e294c24420ab4ae2fb3face9 |