Skip to content

fix(guest-agent): stop an anonymous Info from driving a quote and a KMS round trip - #1263

Merged
kvinwang merged 1 commit into
nextfrom
fix/guest-agent-residuals
Sep 24, 2026
Merged

kvinwang merged 1 commit into
nextfrom
fix/guest-agent-residuals

Conversation

@kvinwang

@kvinwang kvinwang commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #1256 (base will switch to next once it merges).

The frozen Info (also behind the dashboard and vsock GuestApi.Info) is anonymous, yet it:

  1. attested on every call, only to decode identity that never changes, and
  2. started another demo-cert request (quote + KMS round trip) on every call while the KMS was unreachable, with no bound on how many ran at once.

Changes:

  • Identity comes from the existing identity() cache; attestation happens only when tcb_info is served (internal callers, or public_tcbinfo).
  • demo_cert becomes a tokio::sync::OnceCell<String>. A try_lock on the last-failure mutex makes the request single-flight, and a failure throttles retries to one per 30 s.

Tests: 8 anonymous Info calls → 0 extra attestations; concurrent + post-failure calls → 1 demo-cert request.

The rest of the original PR was split out: #1358, #1359, #1360.

@kvinwang

Copy link
Copy Markdown
Collaborator Author

Follow-up commit 5d3ebe1 also moves the residual startup-identity retry path off the executor and coalesces concurrent retries; cancellation retains the guard.

@kvinwang
kvinwang force-pushed the fix/guest-agent-residuals branch from 5d3ebe1 to 805058b Compare September 24, 2026 07:56
@kvinwang kvinwang changed the title fix(guest-agent): an anonymous Info drives a quote and a KMS round trip, and the supervisor fsyncs its log every 8 KiB fix(guest-agent): stop an anonymous Info from driving a quote and a KMS round trip Sep 24, 2026
@kvinwang
kvinwang changed the base branch from next to fix/guest-agent-quote-blocking September 24, 2026 07:56
Base automatically changed from fix/guest-agent-quote-blocking to next September 24, 2026 08:05
`get_info` (frozen `Info`, the dashboard and vsock `GuestApi.Info`)
attested on every call, and started another demo-cert request (a quote
plus a KMS round trip) on every call while the KMS was unreachable.

- Serve identity from the existing `identity()` cache, and attest only
  when `tcb_info` is served.
- Keep the demo cert in a `tokio::sync::OnceCell`; a `try_lock` on the
  last-failure mutex makes the request single-flight, and a failure
  throttles retries to one per 30s.
@kvinwang
kvinwang force-pushed the fix/guest-agent-residuals branch from 805058b to ea3d67b Compare September 24, 2026 08:09
@kvinwang
kvinwang merged commit 3069f3e into next Sep 24, 2026
11 checks passed
@kvinwang
kvinwang deleted the fix/guest-agent-residuals branch September 24, 2026 08:21
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.

1 participant