Skip to content

Fix SVN dropped from ROM-stashed measurements in initialize_dpe()#3501

Open
raghuncstate wants to merge 3 commits into
chipsalliance:mainfrom
raghuncstate:fix-svn-rom-measurement-replay
Open

Fix SVN dropped from ROM-stashed measurements in initialize_dpe()#3501
raghuncstate wants to merge 3 commits into
chipsalliance:mainfrom
raghuncstate:fix-svn-rom-measurement-replay

Conversation

@raghuncstate

Copy link
Copy Markdown

Summary

  • Fix initialize_dpe() to use measurement_log_entry.svn instead of hardcoded 0 when replaying ROM measurement log entries into DPE
  • Add regression test test_svn_preserved_in_rom_stash_measurement that verifies ROM-stash and RT-stash paths produce identical DPE certs with correct SVN

The Bug

runtime/src/drivers.rs line 726 hardcodes svn: 0 in DeriveContextCmd when replaying ROM measurements, even though MeasurementLogEntry.svn stores the correct value from the original STASH_MEASUREMENT call. 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: 0svn: measurement_log_entry.svn

Test plan

  • test_svn_preserved_in_rom_stash_measurement — sends STASH_MEASUREMENT(svn=42) via ROM and RT paths, parses MultiTcbInfo from DPE leaf certs, asserts both show SVN=42 and certs match
  • Existing test_all_measurement_apis (uses svn: 0, should still pass)

Fixes #3500

🤖 Generated with Claude Code

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>
@linux-foundation-easycla

linux-foundation-easycla Bot commented Mar 17, 2026

Copy link
Copy Markdown

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: mhatrevi / name: Vishal Mhatre (52cf364)
  • ✅ login: raghuncstate / name: Raghu Krishnamurthy (0674306, a979861)

zhalvorsen
zhalvorsen previously approved these changes Mar 18, 2026
Comment thread runtime/tests/runtime_integration_tests/test_certs.rs Outdated
Comment thread runtime/tests/runtime_integration_tests/test_certs.rs Outdated
Comment thread runtime/tests/runtime_integration_tests/test_certs.rs Outdated
Comment thread runtime/tests/runtime_integration_tests/test_certs.rs Outdated
…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
zhalvorsen previously approved these changes Mar 19, 2026
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.

initialize_dpe() drops SVN from ROM-stashed measurements during replay

3 participants