Repository navigation
fix(guest): start applications only after the env update window is closed - #1546
Merged
kvinwang merged 1 commit intoNov 9, 2026
Merged
Conversation
kvinwang
added a commit
that referenced
this pull request
Nov 9, 2026
…tation DiskMigration now models the two-keyslot migration of #1539 (luksAddKey, token bound to its keyslot, luksKillSlot) instead of luksHeaderRestore, and lets the KMS rotate at any point of a boot. All invariants hold for epochs 0-3; the torn-restore script and the configs for the replaced scheme go. KmsRotation checks the latest registered epoch's chain hash on handover, as onboard_service.rs does since #1542, so HandoverAgreesWithRegistry now holds and joins the main config. EnvUpdate gains FailClosed for the guest of #1546, which holds with a lossy host API; the lossy config keeps the earlier guest as a counterexample. The README records the mutations each model catches. Signed-off-by: Kevin Wang <wy721@qq.com>
…osed The VMM closes a boot's env update window when the guest calls UpdateSealedEnv or reports an application-stage boot.progress. Both were best effort: a failed UpdateSealedEnv only logged a warning and the progress notifications ignore errors. If both were lost, the window stayed open and init scripts or containers could replace the env the next boot reads. Make closing the window an acknowledged step: - The VMM closes the window as soon as it identifies the VM and then always succeeds, logging why an env was not stored. Only failures before that point (an unknown VM) are errors. - The guest continues once answered, or when the host has no window: no host API, another platform, or a VMM predating UpdateSealedEnv, recognized by its unknown-method status (404 since 0.6, 400 with the pRPC dispatcher's "Service not found" before). Other errors are retried with backoff, and the boot fails if none is answered. - The pRPC client reports a non-200 answer as a StatusError carrying the status, so the guest needs no text matching for new VMMs; its message is unchanged. A retry after a lost answer finds the window closed, as does a reboot inside the same VM process. The boot.progress closing stays as defense in depth. Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
force-pushed
the
fix/sealed-env-window-fail-closed
branch
from
November 9, 2026 15:09
2da8459 to
ff136ad
Compare
kvinwang
added a commit
that referenced
this pull request
Nov 9, 2026
…tation DiskMigration now models the two-keyslot migration of #1539 (luksAddKey, token bound to its keyslot, luksKillSlot) instead of luksHeaderRestore, and lets the KMS rotate at any point of a boot. All invariants hold for epochs 0-3; the torn-restore script and the configs for the replaced scheme go. KmsRotation checks the latest registered epoch's chain hash on handover, as onboard_service.rs does since #1542, so HandoverAgreesWithRegistry now holds and joins the main config. EnvUpdate gains FailClosed for the guest of #1546, which holds with a lossy host API; the lossy config keeps the earlier guest as a counterexample. The README records the mutations each model catches. Signed-off-by: Kevin Wang <wy721@qq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The env update window closed only through two best-effort messages: the guest's
UpdateSealedEnv, which only logged a warning on failure, and the application-stageboot.progressnotifications (|| true). If both were lost, application code could replace the env the next boot reads. Closing the window is now an acknowledged step, and the boot fails closed without the acknowledgment.UpdateSealedEnv. Other errors are retried after 1, 2, 4 and 8 s; if none is answered, the boot fails before init scripts or containers run. A retry after a lost answer finds the window closed and continues, as does a reboot inside the same VM process.Service not found: <method>.PrpcClientnow carries non-200 answers asStatusError { status, message }; itsDisplayis unchanged.boot.progressclosing stays as defense in depth, and a VM the VMM adopts already running still gets no window.Tests:
HostApiagainst a fake host: 200, both old-VMM unknown-method answers, other 400, 500, refused, and no host API.HostApiagainst the real handler: the window closes on the first answer, rejected and late updates still close it without storing, and an unknown VM errors.cargo fmtis clean, and clippy on non-test code is clean.