Repository navigation
docs(formal): add TLA+ models of the key rotation protocol - #1541
Merged
Merged
Conversation
kvinwang
force-pushed
the
docs/key-rotation-model
branch
from
November 9, 2026 15:06
5c2892c to
eb57205
Compare
Model the root epoch registry and KMS onboarding, data disk key migration with crashes, and the VMM env update window, as implemented, and check them with TLC. The models find that a crash during luksHeaderRestore can destroy the volume key, that an initialization interrupted before the epoch token is written fails every later boot, that lost boot notifications leave the env update window open to application code, and that an ordinary join can hand over a losing pending root. A model of a fix for the two disk issues passes. Signed-off-by: Kevin Wang <wy721@qq.com>
…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>
kvinwang
force-pushed
the
docs/key-rotation-model
branch
from
November 9, 2026 15:20
eb57205 to
45ed57f
Compare
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.
Stacked on #1533. Adds TLA+ models of the key rotation protocol as implemented, checked exhaustively with TLC (see
docs/formal/key-rotation/README.md).KmsRotation: root epoch registry, keyrings, ordinary and rotation joins, key release.DiskMigration: data disk setup and the two-keyslot LUKS migration of fix(kms): address #1533 review on LUKS migration, setters and handover checks #1539, with a crash between any two cryptsetup commands and rotations at any point.EnvUpdate: env re-encryption at boot and the VMM once-per-boot update window, with a lossy host API.Keys are only released from the registered root of their epoch, handover only passes on registered roots, owner env updates are never overwritten, and no crash or rotation fails a boot or loses the disk key.
EnvUpdate.cfgmodels the fail-closed guest of #1546;EnvUpdateLossy.cfgkeeps the earlier guest, where application code can replace the env, as a counterexample.Earlier versions of these models found issues since fixed: a torn
luksHeaderRestoredestroying the volume key and an interrupted format failing every boot (#1539), a migration interrupted before a later rotation failing every boot (#1539), a losing pending root passed on by an ordinary join (#1542), and the env window left open (#1546). The README lists the mutations each model catches.This PR changes no code.
Validation: TLC 2026.11.06 on OpenJDK 21.0.13, Linux 6.8.0-1028-intel x86_64.
KmsRotation3 nodes/4 roots (4,423 states) and 4 nodes/5 roots (57,889 states);DiskMigrationepochs 0-3 (828 states);EnvUpdateepochs 0-2, 2 owner updates (267 states).