openhcl: reseal VMGS hardware protector after live migration - #4415
Open
Ming-Wei Shih (mingweishih) wants to merge 1 commit into
Open
openhcl: reseal VMGS hardware protector after live migration#4415Ming-Wei Shih (mingweishih) wants to merge 1 commit into
Ming-Wei Shih (mingweishih) wants to merge 1 commit into
Conversation
Copilot started reviewing on behalf of
Ming-Wei Shih (mingweishih)
September 10, 2026 22:03
View session
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The change spans complex migration, hardware sealing, persistence, and lifecycle behavior, with review comments still outstanding.
Pull request overview
Adds event-driven VMGS hardware-protector resealing after live migration while preserving the active DEK and coordinating retries, persistence, and shutdown.
Changes:
- Adds migration notification handling and a lifecycle-managed resealing worker.
- Adds guarded VMGS broker operations and runtime sealing verification.
- Adds regression tests, diagnostics, dependency updates, and documentation.
File summaries
| File | Summary |
|---|---|
vm/vmgs/vmgs/src/vmgs_impl.rs |
Exposes active-key retrieval and flushing. |
vm/vmgs/vmgs/Cargo.toml |
Updates VMGS package dependencies. |
vm/vmgs/vmgs_broker/src/client.rs |
Adds guarded key and write APIs. |
vm/vmgs/vmgs_broker/src/broker/tests.rs |
Tests broker guards and flush behavior. Nit (2 votes): remove the unused test_with_tracing::test import. |
vm/vmgs/vmgs_broker/src/broker.rs |
Implements serialized guarded writes. |
vm/vmgs/vmgs_broker/Cargo.toml |
Updates broker dependencies. Nit (1 vote): remove the unused test_with_tracing dev-dependency. |
openhcl/underhill_core/src/worker.rs |
Wires migration notifications and starts the reseal worker. |
openhcl/underhill_core/src/lib.rs |
Registers the hardware-reseal module. |
openhcl/underhill_core/src/hardware_reseal/tests.rs |
Tests notification, retry, I/O, and shutdown behavior. |
openhcl/underhill_core/src/hardware_reseal.rs |
Implements resealing, retries, persistence, and lifecycle handling. |
openhcl/underhill_core/src/dispatch/mod.rs |
Drains resealing during teardown. |
openhcl/underhill_attestation/src/vmgs.rs |
Shares VMGS protector parsing. |
openhcl/underhill_attestation/src/runtime_sealing/tests.rs |
Tests runtime sealing policies and failures. |
openhcl/underhill_attestation/src/runtime_sealing.rs |
Creates and verifies runtime protectors. |
openhcl/underhill_attestation/src/lib.rs |
Exports runtime sealing helpers. |
openhcl/underhill_attestation/src/hardware_key_sealing.rs |
Adds typed sealing errors and rate-limited diagnostics. |
openhcl/underhill_attestation/Cargo.toml |
Adds runtime sealing dependencies. |
Guide/src/reference/architecture/openhcl/processes.md |
Documents VMGS hardware resealing. |
Cargo.lock |
Updates dependency resolution. |
Review details
Suppressed comments (1)
vm/vmgs/vmgs_broker/Cargo.toml:35
- This dev-dependency has no consumer: the only
test_with_tracingreference in this crate is the unused import inbroker/tests.rs, while every test uses#[async_test]. Remove this dependency along with that import so the workspace formatter does not delete it or leave unused test plumbing behind.
test_with_tracing.workspace = true
- Files reviewed: 18/19 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Summary
Reseal the active VMGS datastore key after GET reports live migration completion, so a hardware protector bound to the source platform can be replaced with one bound to destination hardware.
NOTIFY_POST_LIVE_MIGRATIONto a lifecycle-managed worker using bounded, coalesced notifications; the GET callback performs no hardware or storage I/O.Scope and limitations
This is the event-driven change only. Recurring verification and ordinary startup checks are deferred to a separate follow-up. Saved-state reconstruction explicitly requests a durable rewrite to avoid losing an earlier failed-flush obligation; this does not add isolated-VM servicing support.
A completely missed migration notification has no periodic recovery coverage in this PR. Recovery remains best effort: a crash after migration but before durable destination resealing may leave hardware-only VMGS unrecoverable. No encryption or sealing-policy downgrade is introduced.
Validation
Validated in a clean worktree using the OpenHCL entrypoint's normal crypto/TPM feature selection:
cargo check --all-targetsfor the modified crates andopenvmm_hclcargo clippy --all-targetswith-D warningscargo doc --no-depscargo nextest run --profile agent: 168 tests passed, 0 skippedcargo xtask fmt --fix: all passes succeededCoverage includes SNP/TDX protector verification, same-SVN hardware-secret changes, unchanged-DEK resealing, idle behavior without notifications, coalescing, retry backoff, events/migration during I/O, stale-key guards, flush failures, and stop/drain/reconstruction behavior.
Real-hardware live migration has not yet been tested.