fix(migtd/spdm): make session failures atomic - #1028
Open
haitaohuang wants to merge 3 commits into
Open
haitaohuang wants to merge 3 commits into
haitaohuang wants to merge 3 commits into
Conversation
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]
Contributor
|
It's a rather big change, I'll review next week |
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. FINISH clears runtime_info.last_session_id while the session remains established. Cleanup based on that field therefore misses post-FINISH timeouts, leaving session secrets live until context destruction. Tear down all session slots owned by the exchange before transport shutdown, including when the inner exchange future is cancelled. Cover requester and responder cleanup with and without the handshake ID, including secret reset and repeated cleanup. Run the regression coverage in the library CI entry point with SPDM policy v1 and policy v2 enabled. Signed-off-by: Haitao Huang <haitaohuang@microsoft.com> Assisted-by: GitHub Copilot CLI:GPT-5.6-Sol Assisted-by: GitHub Copilot CLI:gpt-6-astra
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
force-pushed
the
fix/spdm-responder-error-before-close
branch
from
September 8, 2026 19:34
02d0726 to
f0c2a39
Compare
haitaohuang
added a commit
to microsoft/MigTD
that referenced
this pull request
Sep 9, 2026
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
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
Harden SPDM migration and rebind failure atomicity across three ordered commits:
END_SESSION.END_SESSIONand 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.shcargo fmt --checkcargo checkcargo test -p migtd --lib(23 passed)main,stack-guard,vmcall-raw,spdm_attestation,policy_v2)stack-guard,virtio-vsock,virtio-serial,vmcall-interrupt)cargo deny check advisories,sources, andbanscargo xtask lib-buildandcargo xtask lib-testintegration-emu.ymlscenarios, run sequentially