notes

Phase B.2: shrinking what a broken progenitor can do

Name: provisional.

An appendix to notes/trusted-init.md, which summarizes it.

B.1 settled what bytes the progenitor is. B.2 is the other half: what a compromised progenitor can still reach.

The pre-B.2 progenitor (system_initializer, hello's init role) holds a large untyped budget for its entire life, because it stays the system's process builder. Every process in the system is therefore one bug in the progenitor away from being built wrong. The answer is not to make the progenitor more careful; it is to make it hold less, and to make it hold it for less time.

The tree

Four small portable programs (components/src/root_supervisor.rs, spawner.rs, sub_server_supervisor.rs, first_attempt_crasher.rs, sharing crates/supervision_contract):

  root_supervisor   the root untyped + the initrd + a report endpoint       (briefly)
    |
    +-- spawner   one program image, one budget (WRITE), no initrd  (can build only that program)
    |
    +-- sub_server_supervisor    a request channel + a fault endpoint, NO memory   (cannot build anything)
            |
            +-- first_attempt_crasher   a report endpoint           (the supervised sub-server)

  then: root_supervisor deletes its untyped and becomes a RECEIVE loop on its own supervision endpoint.

Each split is chosen so that the authority is the smallest thing that still does the job:

Restart policy is userspace code, and stays there

sub_server_supervisor is the policy: bounded retries (two), a clean exit read as "finished" rather than "crashed", a give-up when the budget runs out. It reaps the corpse through the spawner before rebuilding, because §26's corpse is dead-until-reaped. None of that is in the kernel, and the kernel's whole contribution is one five-word message. That is DECISIONS §26 working as designed: the kernel is the only witness to a death, so it reports; everything after the report is somebody's opinion.

Note which side of the split reaping falls on: the supervisor decides whether to reap and rebuild, the spawner is what can. Policy and authority, separated by an IPC boundary.

What is proven, both ISAs

system_tests/src/user/authority_tests.rs:

"Without the progenitor's involvement" is an authority argument, not a timing one. The progenitor cannot retype a page by then, and a process that cannot retype a page cannot have built the replacement. Scheduling order is not the evidence; the empty capability slot is.

The bug this work found

The supervision-tree tests enter more processes per run than anything before them. That surfaced a pre-existing race in the exception-return path on both architectures. Staging SPSR_EL1/ELR_EL1 (and sepc/sstatus) for the eret is not atomic with respect to a nested exception. So an interrupt in a two-instruction window could return a brand-new process to its entry point at EL1. Fixed by masking interrupts at the top of the restore. Full account in notes/exceptions.md; it is written up there rather than here because it is an exception-path fact, not a progenitor fact.

Two design forks found and deliberately not built through

  1. Reaping requires the same right as building. MemoryRegion::DESTROY needs WRITE on the region, and so does RETYPE. So a root supervisor that could restart a dead tier-one server is a root supervisor that can build processes, which is exactly the authority we set out to give away. root_supervisor therefore chooses to be unable to build, and its policy for a dead tier-one server is "report and stop", the fail-closed floor pushed as high and as small as it goes. Splitting a reap-only right out of WRITE (a rights bit, or a distinct Untyped::REAP) would let a root supervisor recover without regaining construction authority. That is a kernel surface change and a rights-model change, so it is an architect's call, not a thing to slip in.
  2. A supervisor cannot turn a tid into a handle. The death message names the dead thread by tid (§26 (the fault endpoint), item 5), and nothing turned a tid into something a builder holds. The options were Tcb::NAME, per-child fault endpoints, or the builder reporting the tid.

Both are answered. Fork one by §32 (a supervisor may collect a corpse without being able to build one) and §148 (a supervisor restarts by asking)'s spawner pattern. Fork two by §148 as amended 2026-10-04: the death message carries the builder's label, and sub_server_supervisor tells two children apart by it. See milestone 105 (the two forks).

The spawner and the supervisor as they stand

components/src/spawner.rs builds; components/src/sub_server_supervisor.rs decides. What each holds, and what it gives up, follows from §32 (a supervisor may collect a corpse without being able to build one) and §148 as amended 2026-10-04.