Skip to content

tdx-attest: fix infinite loop in ConfigFS generation wait (#565)#596

Merged
kvinwang merged 1 commit intomasterfrom
feat/fix-565-wait-for-generation-change
Mar 25, 2026
Merged

tdx-attest: fix infinite loop in ConfigFS generation wait (#565)#596
kvinwang merged 1 commit intomasterfrom
feat/fix-565-wait-for-generation-change

Conversation

@kvinwang
Copy link
Collaborator

Fixes #565.

The TDX attestation helper currently waits for the ConfigFS generation counter to advance in a tight loop with only a 1µs sleep. If the kernel interface gets stuck and never increments the counter, the loop will effectively run forever and can burn CPU.

This change:

  • Adds a small polling delay (10ms) between reads.
  • Introduces a 5 second timeout for the generation to advance.
  • Returns a clear QuoteFailure error when the timeout is hit.

This keeps the happy path unchanged for normal hosts where the generation increases quickly, while ensuring that a stuck or misbehaving ConfigFS implementation leads to a bounded wait and a recoverable error instead of an infinite busy loop.

@kvinwang kvinwang changed the title tdx-attest: add timeout when waiting for configfs generation tdx-attest: fix infinite loop in ConfigFS generation wait (#565) Mar 25, 2026
@kvinwang kvinwang merged commit cce5ff2 into master Mar 25, 2026
15 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.

Infinite loop in wait_for_generation_change — DoS

1 participant