Skip to content

MigTD: add retry for quote generation#754

Draft
haitaohuang wants to merge 3 commits intointel:mainfrom
haitaohuang:quote_retry
Draft

MigTD: add retry for quote generation#754
haitaohuang wants to merge 3 commits intointel:mainfrom
haitaohuang:quote_retry

Conversation

@haitaohuang
Copy link
Copy Markdown
Contributor

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:

  • mig_policy.rs: local TCB info initialization
  • ratls/server_client.rs: RA-TLS quote generation
  • spdm/mod.rs: SPDM quote generation, also changed error return to MigrationAttestationError for failed quote generation, consistent with RA-TLS.

@haitaohuang haitaohuang requested a review from jyao1 as a code owner March 17, 2026 23:39
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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bodzhang , please review this and ensure 21 minutes is OK.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shortened to 2.5 min after checking more data

@haitaohuang haitaohuang force-pushed the quote_retry branch 5 times, most recently from 453a490 to 4e48b13 Compare March 20, 2026 22:35
@haitaohuang
Copy link
Copy Markdown
Contributor Author

cargo deny failure due to a new advisory just issued today not related to PR changes

haitaohuang and others added 3 commits March 21, 2026 13:56
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, also changed error return to
  MigrationAttestationError for failed quote generation, consistent with
RA-TLS.

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 8 simulated quote failures
- Both source and destination logs contain exactly 8 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>
@haitaohuang haitaohuang marked this pull request as draft March 23, 2026 22:40
@haitaohuang
Copy link
Copy Markdown
Contributor Author

Change draft to do more investigation

@jyao1 jyao1 closed this Mar 24, 2026
@jyao1 jyao1 reopened this Mar 24, 2026
@jyao1
Copy link
Copy Markdown
Contributor

jyao1 commented Mar 24, 2026

cargo deny failure due to a new advisory just issued today not related to PR changes

It is resolved in recent commit.

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