Skip to content

fix(verifier): key the measurement cache on the measured VM shape only - #1334

Merged
kvinwang merged 1 commit into
nextfrom
fix/verifier-measurement-cache
Sep 23, 2026
Merged

kvinwang merged 1 commit into
nextfrom
fix/verifier-measurement-cache

Conversation

@kvinwang

@kvinwang kvinwang commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

vm_config_cache_key hashes the whole request-supplied VmConfig, including image and the *_measurement documents, none of which the measurement reads. Changing one byte in them forces a cache miss: a full firmware/kernel hash, ACPI generation, and a new file under <cache>/measurements/.

Clear those fields before hashing. They are cleared rather than allowlisted, so new VmConfig fields stay in the key by default.

Cache eviction is left for a separate change. The spawn_blocking part moved to #1336.

@kvinwang
kvinwang force-pushed the fix/verifier-measurement-cache branch from 6008ff0 to 91f0f49 Compare September 23, 2026 06:30
@kvinwang kvinwang changed the title fix(verifier): key the measurement cache on the measured VM shape and measure off the async runtime fix(verifier): key the measurement cache on the measured VM shape only Sep 23, 2026
vm_config_cache_key hashed the whole VmConfig, including fields the full-image
measurement never reads: an arbitrary `image` string, and the
`tdx_measurement`/`gcp_measurement`/`aws_measurement` documents, each carrying
a caller-sized checksum_file and CBOR blob. A cache miss costs a full firmware
and kernel hash plus ACPI generation and leaves a file under
<cache>/measurements/ that nothing evicts, so one captured quote replayed with
a different filler byte per request misses every time and grows the cache
without bound.

Clear those four before hashing. Clearing rather than listing the fields that
matter keeps a VmConfig field added later in the key by default, which is the
safe direction: an extra miss, never a stale measurement.
@kvinwang
kvinwang force-pushed the fix/verifier-measurement-cache branch from 91f0f49 to b4218e7 Compare September 23, 2026 06:33
@kvinwang
kvinwang enabled auto-merge September 23, 2026 06:34
@kvinwang
kvinwang merged commit 3927d46 into next Sep 23, 2026
11 checks passed
@kvinwang
kvinwang deleted the fix/verifier-measurement-cache branch September 23, 2026 06:38
kvinwang added a commit that referenced this pull request Sep 25, 2026
…bounds

#1251 renamed the manifest confinement test the image-download case ran by
name. Run its replacement plus the tests that pin the sha256sum grammar,
the end-to-end image binding (#1337) and the truncated-download retry
(#1388), and extend the measurement cache case with shape-only keying
(#1334) and the bounded cache directory (#1369).

Signed-off-by: Kevin Wang <wy721@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant