MigTD: add retry for quote generation#754
Closed
haitaohuang wants to merge 4 commits intointel:mainfrom
Closed
Conversation
jyao1
reviewed
Mar 18, 2026
src/migtd/src/quote.rs
Outdated
| const INITIAL_DELAY_MS: u64 = 5000; | ||
|
|
||
| /// Maximum number of attempts before giving up | ||
| const MAX_ATTEMPTS: u32 = 9; // Total wait time up to ~21 minutes with 5s initial delay |
Contributor
There was a problem hiding this comment.
@bodzhang , please review this and ensure 21 minutes is OK.
Contributor
Author
There was a problem hiding this comment.
shortened to 2.5 min after checking more data
jyao1
reviewed
Mar 18, 2026
453a490 to
4e48b13
Compare
Contributor
Author
|
cargo deny failure due to a new advisory just issued today not related to PR changes |
c9a2bb6 to
2bdfb27
Compare
Contributor
Author
|
Change draft to do more investigation |
Contributor
It is resolved in recent commit. |
Split the SPDM transfer functions so that the 60-second timeout only applies to the actual MSK exchange, not the full session establishment (which includes attestation). This makes the SPDM implementation consistent with the RATLS implementation where the timeout only covers the MSK transfer. Requester side: - spdm_requester_transfer_msk -> spdm_requester_establish_session (version/capability/algorithm negotiation, pub key exchange, key exchange, attestation, finish) + spdm_requester_exchange_msk (migration info exchange, end session) Responder side: - spdm_responder_transfer_msk -> spdm_responder_establish_session (runs message loop until SpdmSessionEstablished state) + spdm_responder_exchange_msk (remaining message loop for MSK transfer and end session) Signed-off-by: Haitao Huang <haitaohuang@microsoft.com>
Add new quote module (src/migtd/src/quote.rs) that centralizes TD quote generation with exponential backoff retry (5s initial, up to 5 retries). This handles the race where an impactless security update invalidates a TD REPORT generated before the update then sent for quote generation. Replace direct attestation::get_quote + tdcall_report calls with quote::get_quote_with_retry in three call sites: - mig_policy.rs: local TCB info initialization - ratls/server_client.rs: RA-TLS quote generation - spdm/mod.rs: SPDM quote generation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Haitao Huang <haitaohuang@microsoft.com>
Also flush log area in more VMCALL handlers so all logs read in time Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Haitao Huang <haitaohuang@microsoft.com>
Adds a new 'Mock Quote Retry' test that exercises the quote retry logic by enabling mock_quote_retry feature. The test verifies: - Migration completes successfully after 5 simulated quote failures - Both source and destination logs contain exactly 5 retry failures and at least 1 success message Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Haitao Huang <haitaohuang@microsoft.com>
Contributor
Author
|
@jyao1 I did some refresh on this PR. mainly:
future improvement would be check for different error codes before retry. But I'd want to upstream that later.as separate pr |
Contributor
Author
|
There is something messed up during rebase. I'll create a new one |
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.
Add new quote module (src/migtd/src/quote.rs) that centralizes TD quote generation with exponential backoff retry (5s initial, up to 9 attempts). This handles the race where an impactless security update invalidates a TD REPORT generated before the update then sent for quote generation.
Replace direct attestation::get_quote + tdcall_report calls with quote::get_quote_with_retry in three call sites: