Conversation
… firmware needs MAX_OVMF_METADATA_PAGES admitted 16777216 pages -- 64 GiB. Every page is one SHA-384 over a PAGE_INFO, and verify_sev_launch recomputes the whole measurement *before* comparing it with the hardware MEASUREMENT, so the budget is spent entirely on input the requester authored. The document is bound only to vm_config.os_image_hash, which the requester also chooses, so no allowlist rejects it first. Measured on an EPYC-class host: 0.68 us per page, so the ceiling is **11.3 seconds of one core** for a measurement.snp.cbor of about 200 bytes. The path is reached from the verifier's POST /verify and from the KMS's key-release path, both gated only by one valid SNP quote -- which a holder can replay with an arbitrary vm_config. The shipped dstack-0.6.0 image declares 7 sections totalling **31 pages**, so the ceiling was 541000x what a real firmware asks for. Lower it to 65536 pages: over 2000x headroom, about 44 ms at the ceiling, and deliberately the same number as tdvf::MAX_MEASURED_PAGES, since the two measurement paths have the same shape and should have the same bound.
This was referenced Sep 20, 2026
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.
MAX_OVMF_METADATA_PAGESadmitted 16 777 216 pages — 64 GiB. Every page costs one SHA-384 over aPAGE_INFO, andverify_sev_launchrecomputes the whole measurement before comparing it with the hardwareMEASUREMENT, so the entire budget is spent on input the requester authored. The document is bound only tovm_config.os_image_hash, which the requester also chooses, so no allowlist can reject it first.Measured, not estimated
11.3 seconds of one core for a
measurement.snp.cborof about 200 bytes — two OVMF sections, oneSnpKernelHashes(required byvalidate_measurement_input) and oneSnpSecMemorysized to the budget.The path is reached from the verifier's
POST /verifyand from the KMS's key-release path. Both are gated by one valid SNP quote — which its holder can replay with an arbitraryvm_config, so the gate bounds who can do it, not how often.The ceiling was 541 000× what a real firmware asks for
The shipped
dstack-0.6.0image'smeasurement.snp.cbor:Lowered to 65 536 pages: over 2000× headroom over a real image, about 44 ms at the ceiling, and deliberately the same number as
tdvf::MAX_MEASURED_PAGES— the two measurement paths have the same shape and should have the same bound.Tests
a_metadata_table_cannot_buy_unbounded_hashingbuilds the largest table the old ceiling accepted (one section filling the budget the others do not claim) and asserts it is refused, and refused before any hashing rather than after. Against the old constant:the_page_budget_admits_a_real_metadata_tabletranscribes the shipped 7-section table, asserts it is 31 pages, asserts the budget leaves it three orders of magnitude of headroom, and assertsvalidate_measurement_inputaccepts it — so a future tightening cannot quietly start rejecting real images.cargo test -p dstack-mr: 31 passed.cargo clippy -p dstack-mr -- -D warnings --allow unused_variables: clean.Independent of #1236, which bounds the TDX side (
tdvf.rs,tdx.rs) and does not touchsev.rs. Thespawn_blockinghalf of this — the recomputation running on a Rocket worker — is #1251.