Skip to content

fix(migtd/spdm): make session failures atomic - #1028

Open
haitaohuang wants to merge 3 commits into
intel:mainfrom
haitaohuang:fix/spdm-responder-error-before-close
Open

fix(migtd/spdm): make session failures atomic#1028
haitaohuang wants to merge 3 commits into
intel:mainfrom
haitaohuang:fix/spdm-responder-error-before-close

Conversation

@haitaohuang

@haitaohuang haitaohuang commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Harden SPDM migration and rebind failure atomicity across three ordered commits:

  1. Propagate responder processing errors before interpreting a removed session as successful END_SESSION.
  2. Tear down every keyed requester/responder session on post-key-exchange failures, including timeout/cancellation paths, and perform best-effort transport shutdown without replacing the primary protocol error.
  3. Stage exchanged migration information and install the migration version, MSK, and approved SERVTD_EXT hash only after successful END_SESSION and transport shutdown. Responder exchange remains one-shot so replay cannot replace staged state.

The change preserves the existing quote and TDREPORT binding paths and does not import policy-series refactors, one-hash/CoRIM/RTMR1 changes, test bypasses, or diagnostic logging.

Validation

  • bash sh_script/preparation.sh
  • cargo fmt --check
  • cargo check
  • cargo test -p migtd --lib (23 passed)
  • Targeted SPDM Clippy (main,stack-guard,vmcall-raw,spdm_attestation,policy_v2)
  • Intel workflow Clippy (stack-guard,virtio-vsock,virtio-serial,vmcall-interrupt)
  • cargo deny check advisories, sources, and bans
  • cargo xtask lib-build and cargo xtask lib-test
  • All 32 Intel image matrix builds
  • All 14 current Intel integration-emu.yml scenarios, run sequentially

Evaluate the responder message result before treating a removed session as a successful END_SESSION. This preserves VDM and policy failures when the handler tears down the session.

Signed-off-by: Haitao Huang <haitaohuang@microsoft.com>
Assisted-by: GitHub Copilot CLI:GPT-5.6-Sol [migtd-review]
Invalidate requester and responder sessions on every failure after key exchange, including timeout and transport-finalization paths. Always attempt transport shutdown while preserving the primary protocol error.

Assisted-by: GitHub Copilot CLI:GPT-5.6-Sol [migtd-review]
Signed-off-by: Haitao Huang <haitaohuang@microsoft.com>
Stage peer migration information during the SPDM VDM exchange and commit the negotiated version, MSK, and approved SERVTD_EXT hash only after END_SESSION and transport shutdown complete successfully. Preserve one-shot responder handling so a replay cannot replace staged state.

Assisted-by: GitHub Copilot CLI:GPT-5.6-Sol [migtd-review]
Signed-off-by: Haitao Huang <haitaohuang@microsoft.com>
@haitaohuang haitaohuang changed the title fix(migtd/spdm): propagate errors before session close fix(migtd/spdm): make session failures atomic Sep 4, 2026
@sgrams

sgrams commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

It's a rather big change, I'll review next week

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.

2 participants