Repository navigation
fix(tpm-qvl): reject duplicate PCR indices before the event-log replay - #1267
Merged
Merged
Conversation
This was referenced Sep 20, 2026
kvinwang
force-pushed
the
fix/tpm-replay-and-diagnose
branch
from
September 24, 2026 08:39
9641604 to
db0fa7a
Compare
kvinwang
force-pushed
the
fix/tpm-replay-and-diagnose
branch
from
September 24, 2026 09:01
db0fa7a to
444e502
Compare
kvinwang
added a commit
that referenced
this pull request
Sep 25, 2026
Extend the SEV-SNP case with the certificate-table, empty-report, guest feature, rootfs-hash and page-budget tests (#1248, #1279, #1275, #1252), and the cloud TPM case with the PCR bank, duplicate index, quoted event log, collateral budget and host allowlist tests (#1275, #1267, #1338, Signed-off-by: Kevin Wang <wy721@qq.com> #1238, #1404).
kvinwang
added a commit
that referenced
this pull request
Nov 8, 2026
Extend the SEV-SNP case with the certificate-table, empty-report, guest feature, rootfs-hash and page-budget tests (#1248, #1279, #1275, #1252), and the cloud TPM case with the PCR bank, duplicate index, quoted event log, collateral budget and host allowlist tests (#1275, #1267, #1338, Signed-off-by: Kevin Wang <wy721@qq.com> #1238, #1404).
kvinwang
added a commit
that referenced
this pull request
Nov 8, 2026
Extend the SEV-SNP case with the certificate-table, empty-report, guest feature, rootfs-hash and page-budget tests (#1248, #1279, #1275, #1252), and the cloud TPM case with the PCR bank, duplicate index, quoted event log, collateral budget and host allowlist tests (#1275, #1267, #1338, Signed-off-by: Kevin Wang <wy721@qq.com> #1238, #1404).
kvinwang
added a commit
that referenced
this pull request
Nov 10, 2026
Extend the SEV-SNP case with the certificate-table, empty-report, guest feature, rootfs-hash and page-budget tests (#1248, #1279, #1275, #1252), and the cloud TPM case with the PCR bank, duplicate index, quoted event log, collateral budget and host allowlist tests (#1275, #1267, #1338, Signed-off-by: Kevin Wang <wy721@qq.com> #1238, #1404).
kvinwang
added a commit
that referenced
this pull request
Nov 11, 2026
Extend the SEV-SNP case with the certificate-table, empty-report, guest feature, rootfs-hash and page-budget tests (#1248, #1279, #1275, #1252), and the cloud TPM case with the PCR bank, duplicate index, quoted event log, collateral budget and host allowlist tests (#1275, #1267, #1338, Signed-off-by: Kevin Wang <wy721@qq.com> #1238, #1404).
kvinwang
added a commit
that referenced
this pull request
Nov 11, 2026
Extend the SEV-SNP case with the certificate-table, empty-report, guest feature, rootfs-hash and page-budget tests (#1248, #1279, #1275, #1252), and the cloud TPM case with the PCR bank, duplicate index, quoted event log, collateral budget and host allowlist tests (#1275, #1267, #1338, Signed-off-by: Kevin Wang <wy721@qq.com> #1238, #1404).
kvinwang
added a commit
that referenced
this pull request
Nov 16, 2026
Extend the SEV-SNP case with the certificate-table, empty-report, guest feature, rootfs-hash and page-budget tests (#1248, #1279, #1275, #1252), and the cloud TPM case with the PCR bank, duplicate index, quoted event log, collateral budget and host allowlist tests (#1275, #1267, #1338, Signed-off-by: Kevin Wang <wy721@qq.com> #1238, #1404).
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
verify_quote_with_careplays the event log before the AK certificate or signature is checked, andverify_event_logrescans the whole log once per entry inpcr_values. Nothing required the PCR indices to be distinct: a TPMS_ATTEST with 5 000 selections all naming PCR 0 (20 KB) plus a matchingpcr_valuespasses both pre-signature gates (the selection list is unsigned,pcr_digestis a plain SHA-256). With 5 000 events that is 25 M extends, measured at 4.66 s of one core per request in release. Reachable via GCP TDX attestations (a replayed public TDX quote plus an attacker-suppliedtpm_quote).Fix
pcr_valuesrepeat an index (a real TPM never produces one).Verification
rejects_duplicate_pcr_indices: without the gate it reaches AK cert parsing (failed to extract AK public key from certificate); with it, fails withduplicate PCR index 0.cargo test -p tpm-qvl4 passed; fmt and clippy clean. Rebased onnext(after fix(tpm-qvl,nsm-qvl): bound collateral fetching from untrusted URLs #1238).