Skip to content

fix(migtd): complete SPDM cleanup and temporary GetTDReport compatibility - #243

Merged
Haitao Huang (haitaohuang) merged 2 commits into
microsoft:integrationfrom
haitaohuang:fix/spdm-cleanup-and-reportdata-transition
Sep 9, 2026
Merged

Haitao Huang (haitaohuang) merged 2 commits into
microsoft:integrationfrom
haitaohuang:fix/spdm-cleanup-and-reportdata-transition

Conversation

@haitaohuang

Copy link
Copy Markdown
Collaborator

Summary

Bring both requested changes to integration in two independently revertible commits:

  1. 169fcff9 - backport only the missing behavior from fix(migtd/spdm): make session failures atomic intel/MigTD#1028: retire all exchange-owned SPDM session slots, including after FINISH clears the handshake ID; preserve the primary error while attempting transport shutdown; propagate all responder processing errors; reset the responder exchange latch. Reuse integration's shared helpers and preserve its existing cancellation-safe application-key wipe, source EXPORT-version selection, and deferred migration-state installation.
  2. dcfd8270 - REVERT_ME, temporary GetTDReport compatibility for testing while old and new OS versions coexist. Remove this commit after the OS transition; do not upstream it to Intel.

Keeping the temporary allowance separate lets it be reverted without removing the SPDM fixes.

Temporary GetTDReport contract

Request payload Behavior
8-byte request ID Accepted, unchanged
Request ID + 64-byte legacy REPORT_DATA (72 bytes total) Accepted; the tail is silently discarded
Any other declared length, or a truncated declared payload Rejected

ReportInfo remains request-ID-only. Legacy REPORT_DATA is not stored, logged, or used to generate TDREPORT; MigTD's fixed report-data namespace remains unchanged. The separate GetMigtdData REPORT_DATA field is still honored. The emulator continues emitting the canonical 8-byte form.

Verification

  • Regression cases failed before their respective fixes and pass afterward.
  • MigTD library suites with vmcall-raw/SPDM: 42 tests with policy v1, 68 tests with policy v2, including both requester/responder migration and rebind cleanup, ignored legacy data, exhaustive nearby payload lengths, truncation, and GetMigtdData preservation.
  • cargo fmt --check and supported in-scope library Clippy.
  • Full local CI gauntlet on the combined snapshot: preparation, format/check/CI Clippy, cargo-deny, library builds/tests, 32 firmware builds, CoRIM policy-contract checks, and 18 sequential EMU scenarios.
  • make -C sh_script/Azure build-igvm generate-hash-v2 with the recorded dependencies and Rust 1.88.0.

The extra workspace-wide -D warnings check also fails on the unmodified baseline (including existing spdmlib build-script and attestation/vmcall lints). Those unrelated warnings are not changed or suppressed here; the repository's configured CI gauntlet passes.

Selectively backport the missing failure paths from intel#1028.
Retire all exchange-owned sessions through AppContextGuard, including
post-FINISH cancellation, before attempting transport shutdown. Preserve
the primary error and propagate every responder processing error.

Retain integration-specific helpers and application-buffer zeroization,
reset the responder exchange latch at entry, and adapt the upstream
cleanup regressions for both roles and cancellation. Existing state
staging and source EXPORT selection are already present.

Adapted from 7b40ecc and the responder
latch reset in f0c2a39.

Signed-off-by: Haitao Huang <haitaohuang@microsoft.com>
Assisted-by: GitHub Copilot CLI:gpt-6-astra
Temporarily accept the request-ID-only GetTDReport payload and the legacy
request ID plus 64-byte REPORT_DATA for testing mixed OS versions during
the transition. Bound-check the complete declared payload, keep ReportInfo
request-ID-only, and discard the optional tail without logging it or using
it to construct TDREPORT data.

Continue rejecting malformed lengths and truncation. Cover ignored legacy
bytes and preserve the separate GetMigtdData REPORT_DATA contract. Remove
this compatibility allowance after older test OS versions are retired;
do not upstream this temporary change to Intel.

Signed-off-by: Haitao Huang <haitaohuang@microsoft.com>
Assisted-by: GitHub Copilot CLI:gpt-6-astra
@haitaohuang
Haitao Huang (haitaohuang) merged commit af930ba into microsoft:integration Sep 9, 2026
60 checks passed
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