Skip to content

attest: carry the boot disk's GPT digests - #13

Merged
HarryR merged 3 commits into
mainfrom
gpt-digest
Nov 15, 2026
Merged

HarryR merged 3 commits into
mainfrom
gpt-digest

Conversation

@HarryR

@HarryR HarryR commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Closes nothing yet; first part of #12.

The attestation gains a required gpt field: the boot disk's H(UEFI_GPT_DATA) in sha256 and sha384, read from the disk rather than the firmware event log. It is replay input for the PCR the firmware's EV_EFI_GPT_EVENT extended (PCR5; PCR2 on GCE TDX); the quote covers that PCR, so a wrong value fails the replay.

  • gpt module (UEFI_GPT_DATA as EDK2 builds it), unit-tested against workspace pcr-replay's gpt_data().
  • attest(nonce, &gpt), attest_with(tpm, nonce, &gpt, fetcher); CLI attest [--disk <DISK>] [NONCE_HEX]; without --disk, bootdisk::boot_disk() picks the one disk with an EFI System Partition (zero or several is an error).
  • uefi_gpt_data caps the partition entry array at 64 KiB and checks the entry offset: the header is untrusted.
  • verify CLI outputs gpt next to the verified PCRs. Flat/zkVM format unchanged (vaportpm-zk needs no change).

Consumers: stage1 (computes the digests before it attests), stage0's predict-pcrs.py and workspace pcr-replay (from_attestation: gpt). Not yet tested on hardware.

Release (0.4.0):

  • Both crates to 0.4.0 (API break).
  • CI gains build-x86_64 / build-aarch64 (static musl make release-x86 / release-aarch64). A v* tag adds a release job: vaportpm-{attest,verify}-{x86_64,aarch64}-linux-musl, one build-provenance attestation over the four, an immutable release. Procedure: workspace RELEASING.md (workspace#6).
  • Cargo.lock committed; builds run --locked; make lock re-resolves.
  • Byte parity: this PR's CI binaries (run 43708903271) are identical to a local build of f25c65c, all four.

🤖 Generated with Claude Code

The firmware measures the boot disk's GPT as EV_EFI_GPT_EVENT (PCR5; PCR2 on
GCE TDX), and stage2 rewrites that GPT, so a verifier cannot replay the PCR
from release artifacts after a first boot. The attestation now carries
H(UEFI_GPT_DATA) in sha256 and sha384, read from the disk (not the firmware
event log, which not every platform hands to Linux intact).

- gpt module: UEFI_GPT_DATA as EDK2 builds it (92-byte header, UINT64 count,
  non-empty entries), from a block reader or a device/image path.
- AttestationOutput.gpt is required; attest()/attest_with() take it; the
  CLI is `attest <DISK> [NONCE_HEX]`.
- vaportpm-verify's CLI outputs gpt next to the verified PCRs. The quote does
  not cover it: a replay uses it and is checked against the quoted PCR. The
  flat (zkVM) format is unchanged.
- Test fixtures predate the field and get an all-zero gpt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HarryR and others added 2 commits November 15, 2026 10:32
…ry array

The CLI is `attest [--disk <DISK>] [NONCE_HEX]` again with the nonce as
the only positional argument, as on main: the earlier `<DISK>` positional
turned an existing `attest <nonce>` into an open of a "disk" named after
the nonce.

Without --disk, bootdisk::boot_disk() picks the one whole disk whose GPT
has an EFI System Partition; zero or several is an error naming --disk.
A wrong pick fails the PCR replay, not trust. No efivarfs: the firmware's
boot options (GCE's are short-form NVMe paths) carry no partition to
match, and lockboot never writes its own.

uefi_gpt_data now rejects an entry array over 64 KiB (4x the usual
128 x 128) and an overflowing PartitionEntryLBA * sector: the header is
untrusted once every attached disk is parsed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o.lock

- Both crates to 0.4.0: #13 breaks the API (attest(nonce, &gpt), the
  required gpt field, the CLI).
- CI gains build-x86_64 / build-aarch64 (make release-x86 /
  release-aarch64) on every push and PR. A v* tag adds a release job:
  vaportpm-{attest,verify}-{x86_64,aarch64}-linux-musl, one
  build-provenance attestation over all four (subject-checksums), an
  immutable release. Procedure: workspace RELEASING.md.
- Cargo.lock is committed and every build/check/test/clippy runs
  --locked, so a tag fixes its binaries' dependencies; `make lock`
  re-resolves it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@HarryR
HarryR marked this pull request as ready for review November 15, 2026 11:54
@HarryR
HarryR merged commit ba3f931 into main Nov 15, 2026
4 checks passed
@HarryR
HarryR deleted the gpt-digest branch November 15, 2026 11:54
HarryR added a commit to lockboot/stage1 that referenced this pull request Nov 15, 2026
Repin from the unreleased lockboot/vaportpm#13 commit (8b2c35c) to the
v0.4.1 release commit 157ec04, guard =0.4.1. Since 8b2c35c: the
attest CLI's --disk flag and boot-disk detection, and the 64 KiB cap on
the GPT entry array, which stage1's uefi_gpt_data_device() read now
gets. Cargo.lock: only the vaportpm-attest entry (make update-vaportpm).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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