Skip to content

feat: verify the GCP TDX boot chain alongside the vTPM - #1702

Draft
kvinwang wants to merge 5 commits into
nextfrom
feat/gcp-acpi
Draft

kvinwang wants to merge 5 commits into
nextfrom
feat/gcp-acpi

Conversation

@kvinwang

@kvinwang kvinwang commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

Checks MRTD and RTMR0–2 of GCP TDX boots in addition to the existing vTPM checks, so trust no longer rests on the vTPM alone.

crates/gcp-acpi: pure Rust generator for the three ACPI fw_cfg blobs GCE's TDVF measures into RTMR0 (etc/table-loader, etc/vanadium/acpi/rsdp, etc/vanadium/acpi/tables).

  • The input is the vCPU count, the memory size and whether a GPU is attached. Data disks, local SSDs and the zone do not change the blobs.
  • It models multi-socket NUMA shapes (SRAT, SLIT, APIC IDs) and the extra PCI root bridge of GPU shapes.
  • Every table is built from structure, with no binary templates.
  • Output matches GCE byte for byte on c3-standard-4, -8, -22, -44, -88, -176 and a3-highgpu-1g (one H100).

Verification (dstack_mr::gcp::verify_gcp_tdx_boot), enforced when measurement.gcp.cbor is version 2:

  • MRTD must be one of the GCE TDVF builds deployed as of 2026-12 or endorsed since. Each is computed from the public .fd images, which carry Google-signed endorsements.
  • RTMR0 is replayed from the event log. The TD HOB, CFV and ACPI events must match recomputed values. The machine shape comes from cpu_count, memory_size, num_gpus and numa_nodes in the VM config, which dstack-cloud now fills in from the GCE machine type. Only UEFI variable events are not reproduced; Secure Boot and boot-device selection are pinned by RTMR1.
  • RTMR1 and RTMR2 must equal the values dstack-mr gcp-measurement-cbor computes at build time from the UKI and the GPT of disk.raw.
  • GCP attestations now keep all RTMR0 event digests when stripped.

v1 images still verify with the vTPM checks only.

Tested against quotes and CCEL from dstack 0.6.7 on c3-standard-4, and from Ubuntu on c3-standard-8, -22, -44, -88, -176 and a3-highgpu-1g.

GCE's TDVF measures etc/table-loader, etc/vanadium/acpi/rsdp and
etc/vanadium/acpi/tables into RTMR0. Captures from c3-standard TDX VMs
show they depend only on the vCPU count and memory size: data disks,
local SSDs and the zone leave them unchanged.

Generate them in pure Rust so a verifier can check those RTMR0 events
instead of trusting whatever ACPI the host supplied. Every table is
built from structure (a small AML encoder, since GCE uses fixed-width
integers where acpi_tables would pick the shortest form); there are no
binary templates. The table-loader also carries GCE's vendor commands
that point the firmware at the DSDT integers it overwrites with the PCI
windows after measurement.

The output matches the event-log digests of c3-standard-4, -8 and -22
byte for byte. Larger multi-socket shapes have not been captured.

Signed-off-by: Kevin Wang <wy721@qq.com>
Version 2 of measurement.gcp.cbor records the RTMR1 and RTMR2 values GCE's
TDVF produces when it boots the image, computed at build time from the UKI
and the GPT of disk.raw. For such images the verifier now also checks:

- MRTD is one of the known GCE TDVF builds;
- RTMR0 replays from the attested event log, and its TD HOB, CFV and ACPI
  table events match values recomputed by the verifier (ACPI tables from
  gcp-acpi);
- RTMR1 and RTMR2 match the image measurement.

The existing vTPM checks are unchanged. GCP attestations now keep every
RTMR0 event digest when stripped so the verifier can replay RTMR0.

Signed-off-by: Kevin Wang <wy721@qq.com>
@kvinwang kvinwang changed the title feat: verify GCP TDX RTMR0 against generated ACPI tables feat: verify the GCP TDX boot chain alongside the vTPM Dec 2, 2026
Captured c3-standard-44, -88, -176 and a3-highgpu-1g (one H100) TDX VMs and
extended the ACPI and TD HOB model to match them byte for byte:

- NUMA: 44 vCPUs per node, two nodes per socket. Sockets start at the next
  power-of-two APIC ID, the SSDT names CPUs by APIC ID, CPON marks the
  gaps, SRAT and the TD HOB give each node its own RAM range, and a SLIT
  is added on multi-node shapes.
- GPU: a second host bridge PR01 owns buses 1-255, PCI hotplug and the AC
  adapter are off, and low RAM ends at 2 GiB.
- a3-highgpu hosts run the 2026-06-26 TDVF build, now in the allowlist.

The verifier takes the shape from the VM config's cpu_count, memory_size
and num_gpus when present, and otherwise tries every shape GCE offers for
TDX. Either way the regenerated tables must match the measured ones.

Signed-off-by: Kevin Wang <wy721@qq.com>
dstack-cloud now writes cpu_count, memory_size and num_gpus of the GCE
machine type into the GCP vm_config, and the verifier requires them for
v2 images instead of trying a built-in list of GCE shapes. The shape is
only trusted as far as it reproduces the measured ACPI tables and TD HOB.

Signed-off-by: Kevin Wang <wy721@qq.com>
The verifier derived the node count from a 44-vCPUs-per-node rule while
vm_config.numa_nodes stayed empty, which by its own definition means one
node. dstack-cloud now writes numa_nodes for multi-node GCE machine types
(gcloud does not report it, so the rule moves there), and the verifier
reads it like the other shape fields.

Signed-off-by: Kevin Wang <wy721@qq.com>

This branch has not been deployed

No deployments
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