Repository navigation
diskserver refuses no session for being the running ROOT; the loader names and types the booted slot - #955
Conversation
The owner decided (2026-10-20) that explicit grants alone govern access to the partition the machine runs from. diskserver's `--running <guid>` flag made it refuse every session to that partition `Held`, on top of the grant its connector was minted with. Delete the flag, its parse, the `running` field and argument through `Service` and `admitted`, the log line naming the partition, and its unit-test assertions; the supervisor no longer reads the inventory to tell the block service the loaded ROOT, so `storage_endowment` now serves file servers only and loses its `program` parameter. Ordinary authorization is unchanged: a connection with no grant reaches nothing, a grant admits only its unique GUID or kind, and a session whose grant does not write answers every write `ReadOnly`. No grant the supervisor mints writes the running ROOT: file servers get DATA by kind, the log and boot volume by unique GUID; the slot reader lists ROOTs by kind read-only; the updater's write grants name only the idle slot, which `toyos_update::slots::grant` refuses to be the running one's. The issue that asked for the refusal is now a rejected record. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The slot table names a slot's ROOT by unique GUID alone, and the loader read whatever partition carried that GUID. Block grants reach partitions by type: the DATA file server's grant, which writes, admits every TOYOS-DATA partition. With diskserver no longer refusing the running ROOT (the previous commit), a ROOT typed DATA would be writable through that grant. The loader now holds the located partition's GPT type to TOYOS-ROOT before reading a byte of the slot, and refuses the slot by name otherwise, handing the kernel the new refusal word `type`. The decision is `toyos_update::policy::typed`, host-tested beside the loader's other slot decisions; a mutation that accepts any type fails the test. The running slot's volume issue now closes with the deletion of the kernel's USB storage path (the small-kernel track's step 10), after which grants alone govern every partition, rather than with a new kernel hold. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e policy tests EXIT=0; mutation typed-accepts-any EXIT=101 then restored; --ci host EXIT=1 (only build/llvm.rs SDKROOT test, #952/#953); --build-only EXIT=0; nvme_disk_boots EXIT=0 Paths masked.
…7a6a578cd9b542 The previous commit message abbreviated it wrongly as 8587da6e7a.
Review of #955 at
|
`slots::grant` learned the running slot's volume from the slot table, which
the updater it grants to writes. A table pairing a decoy volume with the
running ROOT as one slot, and the booted volume with the idle ROOT as the
other, was granted the booted volume for writing on the next boot: a holder
widening its own next grant. The previous commits' message overstated this
as closed ("the updater's write grants name only the idle slot"); that held
for ROOT and not for the volume.
The loader now hands the kernel the chosen slot's volume GUID
(`KernelArgs::slot_volume_guid`, appended at offset 1488, so `LAYOUT`
changes), the kernel names it in the inventory as `Role::Slot` beside
`Role::Root`, and `slots::grant` takes it and refuses an idle slot naming
either the booted volume or the running ROOT, `Stray::Running`, judging the
running slot by the loader's word alone. Both supervisor branches, the
kernel-claim one and the block-service one, pass it; a boot whose inventory
names no slot volume grants nothing.
`Role::Boot`'s doc called it the running slot's volume; it is the
partition firmware loaded the loader from (the ESP), and the manifests'
comments on the boot file server said the same; both are corrected.
The ROOT type check is inlined in the loader's `verify` as review
suggested: `policy::typed` and its test go, `Refusal::Type` stays.
`issues/the-running-slots-volume-is-claimable.md` keeps only its
kernel-claim half, which closes with the kernel's USB storage at step 10.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-update+toyos-abi unit EXIT=0; mutation grant-trusts-table EXIT=101 then restored; --ci host EXIT=0; --build-only EXIT=0; nvme_disk_boots EXIT=0
Follow-up review of #955 at
|
The test images' comments on the file servers called the boot role "the running slot's volume", as the shipping manifests did before the previous commit; it is the ESP. kernel/src/gpt.rs's header named three loader partitions; it names four now that Role::Slot is one, and no file server serves the slot volume. The supervisor's slot_grant doc is rewrapped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nt-only round; --build-only EXIT=0
|
Re-review blocker addressed in b157714. The commit changes only comments.
Compile check: |
|
Orchestrator: the round-3 review's comment-only blocker is resolved at b157714 (checked the diff ce4f91a..b157714: eight test manifests, |
Pull request was closed
Problem and result
diskserver's
--running <guid>flag, passed by the supervisor with the ROOT the loader read, made diskserver refuse every session to that partitionHeld, on top of the grant its connector was minted with. The owner decided (2026-10-20, answer C): delete the flag and its refusal path; explicit grants alone govern access to the system partition, with ordinary authorization and read/write restrictions preserved. Automatic rollback is not part of the argument; the update policy is fix-forward.Two gaps in "grants alone" are closed here, both ruled into this PR by the coordinator:
TOYOS_ROOT.slots::grantlearned the running slot's volume from the slot table, and the updater it grants to writes that table. Suppose a table pairs a decoy volume with the running ROOT as one slot, and pairs the booted volume with the idle ROOT as the other. The updater was then granted the booted volume for writing on the next boot. Now the loader names the booted slot's volume in the kernel inventory, as it names ROOT, andslots::grantjudges the running slot by the loader's naming alone.Correction to commit 3fd6d46's message. It says "the updater's write grants name only the idle slot, which
slots::grantrefuses to be the running one's". That held for ROOT, not for the volume, until ce4f91a. The message stays as written, since history is not rewritten; this paragraph and ce4f91a's message correct it.Changes
system/diskserver/src/main.rs): removes theRUNNINGflag and its parsing, therunningstate throughService::newandadmitted, the log line, the header paragraph and the two refusal assertions. Authorization tests are unchanged.system/supervisor/src/main.rs):storage_endowmentno longer reads the inventory for a block service and serves only file servers. Its unusedprogramparameter is gone.slot_grantreadsRole::SlotbesideRole::Rootand passes it toslots::granton both branches:claimed_slotsfor disks the kernel drives, and the block-service branch. If the inventory names no slot volume, nothing is granted.sdk/abi):KernelArgs::slot_volume_guidis appended at offset 1488. The size becomes 1504, soLAYOUTchanges and the kernel refuses a mismatched loader by name.inventory::Role::Slotis added, encoded as 3.Role::Boot's doc said "the running slot's volume". It is actually the partition firmware loaded the loader from, the ESP. The doc is corrected, and so are the comments on the boot file server inimages/*.tomland all eighttests/images/*case.tomlfiles.kernel/src/gpt.rs's header now names the loader's four partitions (b157714).kernel/src/gpt.rs): namesRole::Slotfromslot_volume_guid, as it namesRole::Root.lib/inspectprints it asloaded.slot.Chosencarries the slot's volume GUID intoKernelArgs.verifychecks the located ROOT's GPT type againstTOYOS_ROOTright afterlocateand before reading any of the slot. A mismatch logsSlot X: ROOT's partition is typed <guid>, not TOYOS-ROOT, returnsRefusal::Type("root"), and reaches the kernel asslot-refused=X:type.policy::typedwrapper and its test are gone.lib/update/src/slots.rs:grant(table, running, volume, listed, kinds)refuses an idle slot that names the booted volume or the running ROOT, withStray::Running("is one of the running slot's"). It no longer takes the running slot's partitions from the table.issues/diskserver-serves-the-slot-the-machine-runs-from.mdbecomes the rejected recordissues/the-block-service-does-not-refuse-the-running-root.md. It has no citations elsewhere.issues/the-running-slots-volume-is-claimable.mdkeeps only its kernel-claim half: on a disk the kernel drives, adeviceholder can still claim the volume. That half closes when step 10 deletes the kernel's USB storage path. The updater half closes here.Size: 23 files, +165 / −158, including the last commit, which changes only comments.
lib/update: +45 / −9, of which about 25 lines are the new test.Grants after this change
Every block grant is minted in the supervisor. Who can write the running slot:
TOYOS_ROOT.slots::grantnow refuses the booted volume and the running ROOT as the loader named them, plus partitions of the wrong type, on another disk, unlisted or carried twice.Checks
b157714 changes only comments:
cargo run -- --build-onlyexits 0 at it (log). The runs below, at ce4f91a, still apply, because nothing a test or build reads has changed since.At the head, ce4f91a (x86_64, macOS host):
cargo test -p toyos-update --lib && cargo test -p toyos-abi --lib(51 + 53 tests, includinga_table_cannot_name_the_booted_volume_idle, the review's decoy table)git apply --check, built and tested, then reverted andcmp-verified in the same runleft: Ok((B, Slot { boot: [1; 16], .. }))cargo run -- --ci hostcargo run -- --build-onlycargo test --test toyos-build -- nvme_disk_bootsbuild/llvm.rs's SDKROOT test (kernel-loom: each model's vacuity witness is its own test's #952/Audio leaves soundserver for an hda driver per controller; the matcher takes any prog-if #953) was red in rounds 1 and 2 (round 1, round 2) and passed in round 3 on the same base. It depends on the host's environment, not on this branch.nvme_disk_bootsshows. The loader reads ROOT from diskserver's disk here, so--runningused to be active on this row. The kernel checksLAYOUTbefore reading any field past it. A boot to ready therefore shows that the rebuilt loader and kernel agree on the newKernelArgs, that a correctly typed ROOT passes the check, and that diskserver runs without the flag.Not verified in a guest. The
Role::Slotrecord reaching a runningupdate's grant: no guest row launchesupdate, and a row for it would have to install an image. The plumbing is a field copy at each hop. The refusal logic is host-tested above, andclaimed_slotsand the block-service branch each pass the samevolume. No guest test exercises the type refusal either; inspection settles the inline check, as review agreed. No metal test was run, because nothing here depends on hardware.Risks
hold_sourceand the kernel-claim half of the volume issue remain until step 10, as ruled.issues/the-boot-volumes-server-holds-a-claim-that-writes.mddescribes the boot file server's partition as "the running slot's volume" and "the volume the loader reads the kernel from". On the image the build writes, that partition is the ESP, which holds the loader andlog.guid, not the kernel. The issue's premise may need restating. Recorded here, not changed.🤖 Generated with Claude Code