Fix SVN dropped from ROM-stashed measurements in initialize_dpe()#3501
Open
raghuncstate wants to merge 3 commits into
Open
Fix SVN dropped from ROM-stashed measurements in initialize_dpe()#3501raghuncstate wants to merge 3 commits into
raghuncstate wants to merge 3 commits into
Conversation
initialize_dpe() hardcoded svn: 0 when replaying ROM measurement log entries into DPE via DeriveContextCmd, even though MeasurementLogEntry stores the SVN from the original STASH_MEASUREMENT call. This caused ROM-phase measurements to get wrong SVN in DPE, producing incorrect CDI derivation and X.509 certificates. Fix: use measurement_log_entry.svn instead of 0. Add regression test (test_svn_preserved_in_rom_stash_measurement) that sends STASH_MEASUREMENT with svn=42 via both ROM and RT paths and verifies the DPE leaf certs match with correct SVN in MultiTcbInfo. Fixes chipsalliance#3500 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
raghuncstate
requested review from
bluegate010,
fdamato,
jhand2,
mhatrevi,
rusty1968,
swenson,
timothytrippel,
vsonims and
zhalvorsen
as code owners
March 17, 2026 20:07
zhalvorsen
previously approved these changes
Mar 18, 2026
…mments - Remove all eprintln debug output from test (reviewer: zhalvorsen) - Use single tci_type byte matching instead of dual-endianness fallback - Update stale comment that referenced pre-fix bug behavior Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
zhalvorsen
previously approved these changes
Mar 19, 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.
Summary
initialize_dpe()to usemeasurement_log_entry.svninstead of hardcoded0when replaying ROM measurement log entries into DPEtest_svn_preserved_in_rom_stash_measurementthat verifies ROM-stash and RT-stash paths produce identical DPE certs with correct SVNThe Bug
runtime/src/drivers.rsline 726 hardcodessvn: 0inDeriveContextCmdwhen replaying ROM measurements, even thoughMeasurementLogEntry.svnstores the correct value from the originalSTASH_MEASUREMENTcall. The RT stash path (stash_measurement.rs:66) correctly passes SVN.This causes ROM-phase measurements to get wrong SVN in DPE, producing incorrect CDI derivation and X.509 certificates (MultiTcbInfo shows SVN=0 instead of actual value).
Fix
One-line change:
svn: 0→svn: measurement_log_entry.svnTest plan
test_svn_preserved_in_rom_stash_measurement— sendsSTASH_MEASUREMENT(svn=42)via ROM and RT paths, parses MultiTcbInfo from DPE leaf certs, asserts both show SVN=42 and certs matchtest_all_measurement_apis(usessvn: 0, should still pass)Fixes #3500
🤖 Generated with Claude Code