fix(vmm): generate simulated SEV-SNP mr_config - #850
Merged
Conversation
kvinwang
force-pushed
the
codex/fix-vmm-simulated-snp-mr-config
branch
from
August 3, 2026 03:49
7602081 to
8c77af9
Compare
kvinwang
force-pushed
the
codex/fix-vmm-simulated-snp-mr-config
branch
from
August 3, 2026 04:46
8c77af9 to
47dc2d2
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.
Problem
A simulated SEV-SNP launch has
manifest.no_tee = truebecause QEMU is not launching a hardware-protected VM. The previous MR-config policy treatedno_teeas sufficient to suppress all MR configuration, so the VMM did not create the V3 document that the SEV-SNP simulator needs to derive and verifyHOST_DATA.The original fix expressed the exception as an opaque boolean. That hid the broader policy: TDX may select no MR config, V1, or V3, while real and simulated SEV-SNP require V3.
Fix
Centralize MR-config policy and document preparation in
app/mr_config.rs:The resulting policy is:
no_tee = trueuse_mrconfigid = false: no MR configA TDX deployment with a key-provider ID requires V3. If MRCONFIGID is disabled,
mr_config_version()now rejects the invalid combination before document generation instead of silently launching without the required identity binding.Both normal and one-shot launches call the same preparation method. Version selection, validation, GPU-policy binding, and V3 document construction therefore cannot drift between the two paths.
V2 remains a compatibility fallback in
tdx_mr_config_id()for an older work directory that has a key-provider ID but no V3 document; it is not selected for a newly prepared launch.Why simulated SNP needs V3
SEV-SNP carries only the 32-byte
HOST_DATAfield in its attestation report. dstack binds the complete app identity by hashing the canonical V3 document intoHOST_DATA; the guest then validates the supplied document against that report value. The simulator must receive the same document as a real SNP launch.This is independent of TDX lite. TDX lite controls OS-image measurement verification and does not itself require V3.
Verification
dstack-vmmtest suite: 57 passeddstack-vmmall-targets check: passeddstack-vmmClippy: passedorigin/master: cleangit diff --check: passed