From c72fa2ef30990e3ede647dc43ab993e320530319 Mon Sep 17 00:00:00 2001 From: HaRoLd <303926+HarryR@users.noreply.github.com> Date: Sat, 14 Nov 2026 22:23:38 +0000 Subject: [PATCH 01/13] pcr-replay: take the GPT event's digest from the attestation An event marked "from_attestation": "gpt" (stage0's EV_EFI_GPT_EVENT) uses the gpt {bank: hex} of the --check attestation (or vaportpm-verify output) instead of its derivation, reported as "supplied" with whether it equals the file's own derivation. The quote binds it: a wrong value fails the PCR comparison. Without a gpt field the event replays as before. Verified on GCP c3-standard-4 TDX: boots 1-3 of a stage2 reboot test replay PCR2 from the attested GPT, including after stage2's rewrite. Co-Authored-By: Claude Opus 5.5 --- tools/pcr-replay/README.md | 20 ++++++------ tools/pcr-replay/pcr-replay.py | 59 +++++++++++++++++++++++++++------- 2 files changed, 56 insertions(+), 23 deletions(-) diff --git a/tools/pcr-replay/README.md b/tools/pcr-replay/README.md index 66862a7..2ead5c5 100644 --- a/tools/pcr-replay/README.md +++ b/tools/pcr-replay/README.md @@ -25,6 +25,9 @@ pcr-replay.py gcp-n2d.replay.json stage0.replay.json stage1.replay.json stage2.r was used unverified. - **pinned**: the file gives a digest or value without any derivation (platform firmware, say). The replay is only as good as that file's provenance. + - **supplied**: the digest came from the attestation (`from_attestation`, below). It is not + covered by the quote on its own; the PCR it is replayed into is, so a wrong value fails the + comparison. Reported with whether it equals the file's own derivation. - A derivation that disagrees with its embedded digest is an error (exit 2), whatever the quote says. A PCR that differs from the quote fails the check (exit 1). - A PCR is reported **not reproduced** when no file models it from reset, when a later file does @@ -84,6 +87,7 @@ An event: | `banks` | Only extended in these banks; other banks are unaffected. | | `digests` | `{bank: hex}` as the producer computed them. | | `value` | Instead of an extend: `{bank: hex}`, the PCR's value at this point (pinned). Only before any event in that PCR. | +| `from_attestation` | `"gpt"`: when `--check` is a vaportpm attestation (or vaportpm-verify output) carrying `gpt` `{bank: hex}`, the event's digest in each bank is that value, whatever the derivation gives; the derivation and `digests` are still checked against each other. Without one, the event replays as if the field were absent. | Derivations are single-key objects, nested: @@ -102,20 +106,14 @@ Derivations are single-key objects, nested: | `{"efi_signature_list": {"type", "owner", "data"}}` | One `EFI_SIGNATURE_LIST` with one entry. `type` is `x509`, `sha256` or a GUID. | | `{"cpio_newc": [{"ino", "mode", "name", "data"?}, …]}` | newc entries, with uid/gid 0, nlink 1 and mtime 0. Each entry's mode is an octal string with the type bits. No trailer: writers differ, so spell it out with `utf8`/`hex`. | -## Open: GPT digest from the attestation +## The GPT digest from the attestation stage0's `EV_EFI_GPT_EVENT` derives from `boot.disk`, which only holds on a first boot: stage2 rewrites the GPT (adds its partitions), so later boots measure a GPT no release artifact -describes. Reconstructing it is brittle and not planned. Instead the attestation will carry that -event's digest as auxiliary data (lockboot/vaportpm#12, with a matching change in vaportpm-zk), -and the replay takes it from there, which pins PCR5 (non-TDX) and PCR2 (TDX) on every boot. The -quote binds the supplied digest: a wrong one fails the PCR comparison. - -Undecided: how a replay file says "this event's digest comes from the attestation's aux data". -Something like `"supplied": "gpt"` on the event (a new status besides verified / derived / -pinned / unchecked, reported as such), with the value read from `--check`'s attestation JSON or -given per bank on the command line, falling back to the `boot.disk` derivation when absent. -Inputs today are 32-byte sha256 values only, so an aux digest needs a per-bank value. +describes. The attestation carries the boot disk's `H(UEFI_GPT_DATA)` in each bank (`gpt`, +read from the disk by the attesting stage, not from the firmware event log), and stage0's event +is marked `"from_attestation": "gpt"`, so the replay pins PCR5 (non-TDX) and PCR2 (TDX) on every +boot. The quote binds the supplied digest: a wrong one fails the PCR comparison. ## Producers diff --git a/tools/pcr-replay/pcr-replay.py b/tools/pcr-replay/pcr-replay.py index 35252d1..cb12d5d 100644 --- a/tools/pcr-replay/pcr-replay.py +++ b/tools/pcr-replay/pcr-replay.py @@ -128,6 +128,7 @@ class Event(TypedDict): banks: NotRequired[list[str]] # only extended in these banks digests: NotRequired[dict[str, str]] # bank -> hex, as the producer computed them value: NotRequired[dict[str, str]] # instead of an extend: the PCR's pinned value here + from_attestation: NotRequired[Literal["gpt"]] # digest from the attestation's field of this name # A platform's firmware logging an event type into a different PCR than the boot chain's files @@ -164,9 +165,14 @@ class PcrsDoc(TypedDict): pcrs: dict[str, dict[str, str]] # vaportpm layout: bank -> pcr -> hex +class AttestationDoc(PcrsDoc): + gpt: NotRequired[dict[str, str]] # bank -> hex: the boot disk's H(UEFI_GPT_DATA) + + Hasher = Callable[..., "hashlib._Hash"] InputKey = tuple[str, str] # (file label, input name) Quote = dict[tuple[str, int], str] # (bank, pcr) -> hex +Supplied = dict[str, dict[str, bytes]] # attestation field ("gpt") -> bank -> digest class Missing(Exception): @@ -298,6 +304,9 @@ def load(cls, path: str) -> ReplayFile: rf.extends = {e["pcr"] for e in rf.events} if rf.entry is not None and rf.entry not in rf.artifacts: raise Bad(f"{path}: entry {rf.entry!r} is not a declared artifact") + for e in rf.events: + if e.get("from_attestation", "gpt") != "gpt": + raise Bad(f"{path}: unknown from_attestation {e['from_attestation']!r}") for r in rf.routes: if not (isinstance(r.get("type"), str) and all(isinstance(r.get(k), int) and 0 <= r[k] < NPCR for k in ("from", "to")) and r["from"] != r["to"]): @@ -472,7 +481,7 @@ def bind_inputs(files: list[ReplayFile], given: dict[str, bytes]) -> tuple[dict[ # --- replay ----------------------------------------------------------------------------------------- -EventStatus = Literal["verified", "derived", "pinned", "unchecked"] +EventStatus = Literal["verified", "derived", "pinned", "unchecked", "supplied"] @dataclass @@ -481,6 +490,7 @@ class Trust: derived: int = 0 # re-derived, nothing embedded to compare pinned: list[str] = field(default_factory=list) # no derivation: taken on the file's word unchecked: list[str] = field(default_factory=list) # derivable, but an artifact was not supplied + supplied: list[str] = field(default_factory=list) # digest from the attestation, bound by the quote @dataclass @@ -495,7 +505,7 @@ def extend(bank: str, v: bytes, d: bytes) -> bytes: def replay(files: list[ReplayFile], banks: list[str], artifacts: dict[str, bytes], - inputs: dict[InputKey, bytes], verbose: bool) -> Result: + inputs: dict[InputKey, bytes], supplied: Supplied, verbose: bool) -> Result: val = {b: {p: reset_value(p, digest_size(b)) for p in range(NPCR)} for b in banks} lost: dict[str, dict[int, str]] = {b: {} for b in banks} # pcr -> why its value is unknown cov: dict[int, str | None] = {p: "no file models it from reset" for p in range(NPCR)} # None: modelled @@ -540,22 +550,32 @@ def replay(files: list[ReplayFile], banks: list[str], artifacts: dict[str, bytes except Missing as e: why = str(e) st: EventStatus | None = None + sup = supplied.get(ev["from_attestation"]) if "from_attestation" in ev else None for b in banks: if "banks" in ev and b not in ev["banks"]: continue emb_hex = ev.get("digests", {}).get(b) emb = bytes.fromhex(emb_hex) if emb_hex else None + derived: bytes | None = None if data is not None: - d = event_digest(ev, data, b) + d = derived = event_digest(ev, data, b) if emb is not None and emb != d: errors.append(f"{what}: {b} digest re-derives to {d.hex()[:16]}..., " f"file says {emb.hex()[:16]}...") st = "verified" if emb is not None else (st or "derived") elif emb is not None: d, st = emb, ("pinned" if "derive" not in ev else "unchecked") - else: + elif sup is None: lost[b].setdefault(p, f"{what}: {why}" if why else f"{what}: no {b} digest") continue + if sup is not None: # the attestation's value wins; the file's is the first boot's + if b not in sup: + lost[b].setdefault(p, f"{what}: the attestation has no {b} {ev['from_attestation']}") + continue + d, st = sup[b], "supplied" + same = "" if derived is None else (", = the file's derivation" if d == derived + else ", differs from the file's derivation") + why = f"{b} {ev['from_attestation']} from the attestation{same}" if p not in lost[b]: val[b][p] = extend(b, val[b][p], d) if st == "verified": @@ -566,6 +586,8 @@ def replay(files: list[ReplayFile], banks: list[str], artifacts: dict[str, bytes trust.pinned.append(what) elif st == "unchecked": trust.unchecked.append(f"{what} ({why})") + elif st == "supplied": + trust.supplied.append(f"{what} ({why})") if verbose: print(f" {st or 'lost':9} {what}" + (f" [{why}]" if why else ""), file=sys.stderr) if errors: @@ -578,16 +600,20 @@ def replay(files: list[ReplayFile], banks: list[str], artifacts: dict[str, bytes # --- quotes ----------------------------------------------------------------------------------------- -def read_quote(path: str) -> Quote: - """A vaportpm attestation / any JSON with a top-level "pcrs" {bank: {n: hex}}, or a serial log - with "PCR " lines.""" +def read_quote(path: str) -> tuple[Quote, Supplied]: + """A vaportpm attestation / any JSON with a top-level "pcrs" {bank: {n: hex}} (and a vaportpm + attestation's "gpt" {bank: hex}, the digests events marked "from_attestation" take), or a + serial log with "PCR " lines.""" with open(path, "rb") as f: raw = f.read() quote: Quote + supplied: Supplied = {} + doc: AttestationDoc | None = None try: - doc = cast(PcrsDoc, json.loads(raw)) + doc = cast(AttestationDoc, json.loads(raw)) quote = {(b, int(i)): v.lower() for b, pcrs in doc["pcrs"].items() for i, v in pcrs.items()} except (ValueError, KeyError, AttributeError, TypeError): + doc = None txt = raw.decode("latin1").replace("\r", "") quote = {(b, int(i)): v for b, i, v in re.findall(r"^(?:payload: )?PCR (\w+) (\d\d) ([0-9a-f]+)$", txt, re.M)} @@ -596,7 +622,13 @@ def read_quote(path: str) -> Quote: for (b, i), v in sorted(quote.items()): if hasattr(hashlib, b) and not re.fullmatch(f"[0-9a-f]{{{2 * digest_size(b)}}}", v): raise Bad(f"quote {path}: {b} PCR{i} is not {digest_size(b)} bytes of hex: {v!r}") - return quote + if doc is not None and "gpt" in doc: + gpt = doc["gpt"] + for b, v in gpt.items(): + if not re.fullmatch(f"[0-9a-f]{{{2 * digest_size(b)}}}", v.lower()): + raise Bad(f"quote {path}: gpt {b} is not {digest_size(b)} bytes of hex: {v!r}") + supplied["gpt"] = {b: bytes.fromhex(v) for b, v in gpt.items()} + return quote, supplied def parse_inputs(ap: argparse.ArgumentParser, specs: list[str]) -> dict[str, bytes]: @@ -663,8 +695,8 @@ def main() -> None: inputs, notes = bind_inputs(files, given) for note in notes: print(f"bound: {note}", file=sys.stderr) - result = replay(files, banks, load_artifacts(a.artifacts), inputs, a.verbose) - seen = read_quote(a.check) if a.check else None + seen, supplied = read_quote(a.check) if a.check else (None, {}) + result = replay(files, banks, load_artifacts(a.artifacts), inputs, supplied, a.verbose) except Bad as e: print(f"error: {e}", file=sys.stderr) sys.exit(2) @@ -674,7 +706,10 @@ def main() -> None: print(f"{b:7} PCR{p:<2} not reproduced: {why}", file=sys.stderr) t = result.trust print(f"events: {t.verified} re-derived and verified, {t.derived} derived, " - f"{len(t.pinned)} pinned, {len(t.unchecked)} unchecked", file=sys.stderr) + f"{len(t.pinned)} pinned, {len(t.unchecked)} unchecked, {len(t.supplied)} supplied", + file=sys.stderr) + for w in t.supplied: + print(f" supplied: {w}", file=sys.stderr) for w in t.pinned: print(f" pinned: {w}", file=sys.stderr) for w in t.unchecked: From 9e3eef1866b6ac215525cdb08032b1364b24d306 Mon Sep 17 00:00:00 2001 From: HaRoLd <303926+HarryR@users.noreply.github.com> Date: Sat, 14 Nov 2026 23:50:26 +0000 Subject: [PATCH 02/13] plan: GPT measurement decided -- grow, then reboot; bind PCR5 Section 3 chosen and implemented (stage2 grow-then-reboot), verified on GCP n2d SEV-SNP and c3 TDX: /data survives the reboot after provisioning on both. O1 settled (read-back guard). Section 4 done (vaportpm#13, stage1#22, stage0#14, workspace#6). Rejected: binding stage0 via PCR7 and excluding PCR2 -- it rests on a key deletion nobody can demonstrate. Co-Authored-By: Claude Opus 5.5 --- PLAN-GPT-MEASUREMENT.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/PLAN-GPT-MEASUREMENT.md b/PLAN-GPT-MEASUREMENT.md index 87411a7..74707a2 100644 --- a/PLAN-GPT-MEASUREMENT.md +++ b/PLAN-GPT-MEASUREMENT.md @@ -1,6 +1,8 @@ # Plan: the GPT measurement, the /data key, and the verifier -Status: **draft for decision, parked 2026-11-10** (pondering; EC2 still blocked). Written so it +Status: **decided 2026-11-14: section 3 (grow, then reboot; bind PCR5)**, implemented on stage2 +`grow-then-reboot` (QEMU selftest both arches; GCP pending). Section 4 done: lockboot/vaportpm#13, +stage1#22, stage0#14, workspace#6 (verified on GCP c3 TDX). Was parked 2026-11-10. Written so it survives a context compaction: every fact, rejected option and open question from the 2026-11-10 discussion is here. Tracker item: `WIP-RELEASE-TODO.md`, "TDX stage2 data key binds PCR2". Companion verifier issue: lockboot/vaportpm#12. @@ -116,7 +118,10 @@ device, writes nothing, measures the final GPT, and derives the key from it. ### Open questions -- **O1 reboot loop.** If the GPT write does not persist (read-only/misbehaving device, firmware +- **O1 reboot loop -- settled 2026-11-14: the read-back guard is enough** (it drops the buffer + cache before re-reading). A firmware that rewrote the GPT would change what it measures, so the + key just follows it; it is the provisioning phase, needs no sealing, and a reboot is cheap. + Original question: If the GPT write does not persist (read-only/misbehaving device, firmware that "repairs" the table), every boot sees free space -> rewrite -> reboot, forever. The read-back guard (change 3) catches a write that didn't stick; it does not catch a firmware that rewrites the GPT on its next boot. Stronger bound wanted? @@ -147,6 +152,10 @@ device, writes nothing, measures the final GPT, and derives the key from it. ### Rejected +- **Bind stage0's identity via PCR7 and exclude PCR2 (2026-11-14):** stage0's PK/KEK/db are minted + per build and the private keys discarded, so PCR7 would identify one build -- but only as long as + that key really was destroyed, which nobody can demonstrate. PCR7 stays bound as before; PCR2 + stays bound for stage0's measured identity. - **Exclude PCR2 on TDX** (from the data key or the verifier): loses stage0's identity. - **Accept the one-time loss** (document "reboot once before relying on /data"): no. - **Final layout at image build:** the GPT header's LastUsableLBA/AlternateLBA depend on the From bd70729e2640b5a507b7bdf0c027e711bd5a0443 Mon Sep 17 00:00:00 2001 From: HaRoLd <303926+HarryR@users.noreply.github.com> Date: Sun, 15 Nov 2026 11:56:44 +0000 Subject: [PATCH 03/13] release procedure; vaportpm requires its build checks - RELEASING.md: the release procedure common to stage0/1/2 and vaportpm (v* tag on main's merge commit, the workflow publishes an immutable, attested release, verify it byte-for-byte), and vaportpm's version, assets, pin line and consumer repin steps. - rulesets.sh: vaportpm's required checks are ci build-x86_64 build-aarch64, now that its CI builds the static musl binaries (vaportpm#13). Applied live with `make sync-rulesets`; `make check-rulesets` clean on every repo. Co-Authored-By: Claude Opus 5.5 --- AGENTS.md | 2 +- RELEASING.md | 54 +++++++++++++++++++++++++++++++++++++++++++++++ tools/rulesets.sh | 7 +++--- 3 files changed, 58 insertions(+), 5 deletions(-) create mode 100644 RELEASING.md diff --git a/AGENTS.md b/AGENTS.md index e3cc102..c2b58ca 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -58,7 +58,7 @@ Out of scope -- do not fold into the chain or org overviews: **os402** (dormant - One canonical branch ruleset, **`lockboot-main`**, is applied to every repo by **`tools/rulesets.sh`** (`make sync-rulesets` / `make check-rulesets`): PR required (0 approvals), no force-push, no branch deletion, **no linear history** (merge commits allowed), admin bypass; required checks = - `ci build-x86_64 build-aarch64` (stage0/1/2), `ci` (vaportpm), `build` (DudeFS), none (.github / + `ci build-x86_64 build-aarch64` (stage0/1/2, vaportpm), `build` (DudeFS), none (.github / workspace). The same script sets each repo's merge settings: merge commits on, squash off, rebase on, head branch deleted on merge. `sync` also deletes any legacy differently-named ruleset. `make check-rulesets` catches drift and is the source of truth for branch protection and merge diff --git a/RELEASING.md b/RELEASING.md new file mode 100644 index 0000000..99f52be --- /dev/null +++ b/RELEASING.md @@ -0,0 +1,54 @@ +# Releasing + +How a lockboot repo cuts a release. The governance (who may tag, immutability) is enforced by +`tools/rulesets.sh`; this is the procedure on top of it. + +## Common to every release repo + +Release repos: stage0, stage1, stage2, vaportpm. Release tags are plain `v*`. + +- **A release is a `v*` tag on `main`**, pushed by a repo admin (the + `lockboot-release-tags` ruleset lets only admins create one; nobody can move or delete one). + The tag push runs the repo's workflow, which builds, attests and publishes the release. Nothing + is uploaded by hand. +- **Releases are immutable** once published: assets and tag are locked, and GitHub signs a release + attestation. Title, notes and the prerelease/latest flags stay editable. A bad release is + deprecated in its notes (or deleted; its tag name can never be reused), never changed. +- **Only a merged, tested changeset is tagged.** The tag goes on the merge commit on `main`, after + every repo in the changeset has merged (see `AGENTS.md`, Git & PR workflow). + +Steps: + +1. The version bump is part of the changeset's PR, not a separate one. +2. After the merge: `git checkout main && git pull --ff-only`, then + `git tag vX.Y.Z` and `git push origin vX.Y.Z`. +3. Wait for the workflow's release job; it publishes the release. +4. Verify (below), then edit the notes: what changed and the pin line consumers use. +5. Repin the consumers (below) in their own PRs. + +Verify a release: + +``` +gh release view vX.Y.Z -R lockboot/ --json isImmutable,assets +gh release download vX.Y.Z -R lockboot/ -D +gh attestation verify --repo lockboot/ # each asset +``` + +Then check that the assets are byte-identical to a local build of the tag: check out the tag and +build with the repo's Makefile release targets (`REPRODUCIBLE-BUILDS.md`), then sha256-compare. + +## vaportpm + +- **Version:** `vaportpm-attest` and `vaportpm-verify` share one version, bumped together in + their `Cargo.toml`s. Pre-1.0, an API or attestation-format change bumps the minor version. +- **Assets:** static musl `vaportpm-attest` and `vaportpm-verify` for x86_64 and aarch64 + (`vaportpm-{attest,verify}-{x86_64,aarch64}-linux-musl`), all four covered by one build-provenance + attestation. Local equivalents: `make release-x86`, `make release-aarch64` + (`target/-unknown-linux-musl/release/`). Downloaded assets lose the executable bit. +- **Consumers** use it as a git dependency, not crates.io, pinned by commit with a version guard: + `vaportpm-attest = { git = "https://github.com/lockboot/vaportpm", rev = "", version = "=X.Y.Z" }`. + The release notes carry this line. + - stage1 (root `Cargo.toml`): bump `rev` and `version`, then `make update-vaportpm`. + - stage2 (`crates/tpm-derive/Cargo.toml`): bump `rev` and `version`, then + `make update-vaportpm`. + - vaportpm-zk follows `branch = "main"` for now. diff --git a/tools/rulesets.sh b/tools/rulesets.sh index a781f69..d846d8c 100755 --- a/tools/rulesets.sh +++ b/tools/rulesets.sh @@ -50,10 +50,9 @@ release_tag_pattern() { # GitHub repo name -> required check contexts (space-separated; empty = no CI gate). required_checks() { case "$1" in - stage0|stage1|stage2) echo "ci build-x86_64 build-aarch64" ;; - vaportpm) echo "ci" ;; - DudeFS) echo "build" ;; # its CI's single job - .github|workspace) echo "" ;; # no CI workflows -> structural protection only + stage0|stage1|stage2|vaportpm) echo "ci build-x86_64 build-aarch64" ;; + DudeFS) echo "build" ;; # its CI's single job + .github|workspace) echo "" ;; # no CI workflows -> structural protection only *) return 1 ;; esac } From 9955ae7960855a7b4d0193c021f6867f8fa17586 Mon Sep 17 00:00:00 2001 From: HaRoLd <303926+HarryR@users.noreply.github.com> Date: Sun, 15 Nov 2026 12:32:35 +0000 Subject: [PATCH 04/13] release: draft-then-publish; record the first vaportpm releases RELEASING.md: release workflows create the release as a draft with its assets and publish it last; a published (immutable) release takes no uploads. Tracker: vaportpm v0.4.0 shipped empty, v0.4.1 verified. Co-Authored-By: Claude Opus 5.5 --- RELEASING.md | 3 +++ WIP-RELEASE-TODO.md | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/RELEASING.md b/RELEASING.md index 99f52be..7ffc72e 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -14,6 +14,9 @@ Release repos: stage0, stage1, stage2, vaportpm. Release tags are plain `v*`. - **Releases are immutable** once published: assets and tag are locked, and GitHub signs a release attestation. Title, notes and the prerelease/latest flags stay editable. A bad release is deprecated in its notes (or deleted; its tag name can never be reused), never changed. +- **The workflow creates the release as a draft with its assets, then publishes it** (`gh release + edit --draft=false`). A published release takes no uploads, so publishing first ships it empty + (vaportpm v0.4.0). - **Only a merged, tested changeset is tagged.** The tag goes on the merge commit on `main`, after every repo in the changeset has merged (see `AGENTS.md`, Git & PR workflow). diff --git a/WIP-RELEASE-TODO.md b/WIP-RELEASE-TODO.md index ac19ad1..ed07f38 100644 --- a/WIP-RELEASE-TODO.md +++ b/WIP-RELEASE-TODO.md @@ -211,6 +211,11 @@ Spot, asia-southeast1-b, probe payload, sha256 PCRs (first 16 hex). All stable a - [ ] (later, at the first tag) First tagged release: confirm attestation subject names (`gh attestation verify --format json`), that release-notes edits still work under immutability, and the new-ghcr- package push (org package-creation policy unknown). + 2026-11-15, vaportpm (no ghcr package): v0.4.0 published EMPTY -- `draft: false` publishes + before the upload and an immutable release takes no uploads after. Fixed by draft-then-publish + (vaportpm#14; stage0#14, stage1#22, stage2#5). v0.4.1: 4 assets, immutable, each asset passes + `gh attestation verify`, byte-identical to a local build; notes edits work. The ghcr push + remains unconfirmed until a stage release. - [ ] (later, when it comes up) stage1 `release-docker` builds arm64 without `docker/setup-qemu-action` (the stage0 harness and stage2 erofs-builder jobs add it). Likely broken the same way; untested. From bd9dde35a65cd239046df9f266ad295e064b0e05 Mon Sep 17 00:00:00 2001 From: HaRoLd <303926+HarryR@users.noreply.github.com> Date: Wed, 18 Nov 2026 05:27:30 +0000 Subject: [PATCH 05/13] tracker: GPT measurement resolved; remove PLAN-GPT-MEASUREMENT.md Its two untested questions (firmware on a grown volume, Nitro PCR5) move to the tracker's open items. Co-Authored-By: Claude --- PLAN-GPT-MEASUREMENT.md | 196 ---------------------------------------- WIP-RELEASE-TODO.md | 54 +++++------ 2 files changed, 24 insertions(+), 226 deletions(-) delete mode 100644 PLAN-GPT-MEASUREMENT.md diff --git a/PLAN-GPT-MEASUREMENT.md b/PLAN-GPT-MEASUREMENT.md deleted file mode 100644 index 74707a2..0000000 --- a/PLAN-GPT-MEASUREMENT.md +++ /dev/null @@ -1,196 +0,0 @@ -# Plan: the GPT measurement, the /data key, and the verifier - -Status: **decided 2026-11-14: section 3 (grow, then reboot; bind PCR5)**, implemented on stage2 -`grow-then-reboot` (QEMU selftest both arches; GCP pending). Section 4 done: lockboot/vaportpm#13, -stage1#22, stage0#14, workspace#6 (verified on GCP c3 TDX). Was parked 2026-11-10. Written so it -survives a context compaction: every fact, rejected option and open question from the -2026-11-10 discussion is here. Tracker item: `WIP-RELEASE-TODO.md`, "TDX stage2 data key binds -PCR2". Companion verifier issue: lockboot/vaportpm#12. - -## 1. Facts - -### What the firmware measures - -- `EV_EFI_GPT_EVENT` = `H_bank(UEFI_GPT_DATA)`: the **primary** GPT header (92 bytes: disk - GUID, MyLBA, AlternateLBA, First/LastUsableLBA, entry-array LBA/count/size, entry-array - CRC32, header CRC32) + a UINT64 partition count + every used 128-byte entry (type GUID, - unique GUID, start/end LBA, attributes, name). The whole table, not just the disk GUID. - Built in `stage0/tools/predict-pcrs.py` `gpt_data()` and `tools/pcr-replay/pcr-replay.py` - `gpt_data()`. EDK2: `Tcg2MeasureGptTable` (DxeTpm2MeasureBootLib), measured once per boot. -- The image's GPT (`boot.disk`) is 228 bytes of measured data: 92 + 8 + 128 (ESP only). -- The firmware does **not** measure ESP filesystem contents; only `BOOT*.EFI` (Authenticode). - stage0 does not read the ESP filesystem (no SimpleFileSystem use in stage0's crates). - -### Where it lands - -| Platform | GPT event | stage0 Authenticode | Evidence | -|---|---|---|---| -| QEMU/OVMF, GCE Shielded / SEV / SEV-SNP | PCR5 (after its separator; PCR5 holds nothing else) | PCR4 | captures in `tools/pcr-replay/platforms/gcp/captures/` | -| **GCE TDX** (c3) | **PCR2** (after PCR2's separator, before the Authenticode) | **PCR2** | `captures/2026-11-09-c3-standard-4-tdx.log` | -| EC2 Nitro | PCR5 expected; Nitro's profile defines PCR5 as "Boot Manager Code Configuration and Data **and** GPT" -- may hold more | PCR4 expected | unverified (AWS blocked) | - -GCE TDX looks like logging by CC measurement register (TCG CC mapping: PCR2-6 -> RTMR1, "MR -index 2") reflected into the vTPM as PCR2. Same firmware binary as c3 Shielded. - -### stage2's GPT rewrite and the data key (today) - -- `stage2/crates/blockdev/src/lib.rs` `ensure_partitions()` (line ~158): idempotent, - grow-only. Rebuilds the GPT whenever p3 (data) is missing or ends before `last_usable`; - returns without writing when p3 already fills the device. Preserves the ESP entry verbatim - and the disk GUID; p2 = runtime (fixed size, fixed GUID `4c4f434b-424f-4f54-...-02`), p3 = - data (fills the rest, fixed GUID `...-03`). Refuses to shrink. So the rebuilt GPT is - deterministic for a given disk size. -- `stage2/crates/bootstrap/src/main.rs`: `derive_data_key()` at line ~54, **before** - `ensure_partitions()` at line ~59; `crypt_mount_or_mkfs()` at line ~103. -- `stage2/crates/tpm-derive/src/lib.rs`: `DATA_KEY_PCRS` = every PCR except 5 (GPT) and 10 - (IMA). Rationale in `stage2/PCR-BINDING.md` (PCR5: runtime GPT rewrite; PCR10: IMA boot - aggregate = hash(PCR0-9), redundant, includes PCR5). -- `vaportpm/crates/vaportpm-attest/src/derive.rs` `derive_pcr_bound()`: keyedhash HMAC primary - in the owner hierarchy, `authPolicy` = `PolicyPCR` over the **live** values of the chosen - PCRs (sha256 bank), `userWithAuth` clear; every HMAC block re-satisfies `PolicyPCR` in a - policy session. Key material = f(owner seed, template incl. authPolicy). Stateless. -- `crypt_mount_or_mkfs()`: plain dm-crypt `aes-xts-plain64` (no LUKS header); a wrong key - decrypts the ext4 superblock to garbage -> no magic -> reinit (fail closed). - -### Observed 2026-11-10 (pivot-init reboot test, cloudtest `7cf12890de5f`, `lb-rb-*.console.log`) - -- **n2d SEV-SNP: PASS.** Boot 2 `data_reinit=false`, sentinel present, overlay root ephemeral. -- **c3 TDX: key moves once.** Boot 1 writes GPT-B; boot 2 measures GPT-B into PCR2 -> different - key -> `data_reinit=true` (/data lost; pivot-init re-ran boot 1); boot 3 PASS. Data written - on a TDX VM's first boot is lost at its first reboot; stable after, until a grow. - -## 2. Requirements (from the discussion) - -- PCR2 on TDX must stay bound and pinned: it carries stage0's Authenticode. Excluding it, or - treating it as a free variable (data key or verifier), is not acceptable. -- No reconstruction of the post-rewrite GPT in the verifier from GUIDs / disk size: brittle. -- Every carrier that persists across boots (ESP, any disk region, TPM NV with empty owner auth) - is **adversarial input**: an operator may run another author's stage1/stage2 on the same - machine. The attack to defend is **substitution** (plant a key we then use), not disclosure. -- Unattested claims (in-guest CPUID etc.) are meaningless; no platform auto-detection in the - verifier -- the caller names the platform file. - -## 3. Leading candidate: grow, then reboot; bind PCR5 again - -### Rule - -In bootstrap: **if `ensure_partitions()` wrote the GPT this boot, sync and reboot before -touching `/data`.** No first-boot detection, no stored state: "free space -> grow into it" is -the existing logic, and its own outcome is the trigger. The next boot finds p3 filling the -device, writes nothing, measures the final GPT, and derives the key from it. - -### Consequences - -- First boot (64 MiB image -> full volume): grow, reboot, key from the final GPT. Nothing lost. -- **Volume grown later (EBS / PD resize): grow, reboot, key changes -> `/data` reinit (wiped)** - through the existing fail-closed path. Accepted: you cannot grow the volume without wiping - `/data` (until a key carrier exists, section 5). -- The GPT is final before any key is derived on every platform, so **PCR5 can be bound again** - (`DATA_KEY_PCRS` = all but PCR10). Same behaviour on every platform, TDX included. -- Cost: one extra boot (~30 s) on first boot and after each grow. -- A volume resize by itself changes nothing measured (the primary GPT is untouched until stage2 - rewrites it) -- but see open question O2. - -### Changes - -1. `blockdev::ensure_partitions()` returns whether it wrote (today: only the two paths). -2. `bootstrap/src/main.rs`: on a write, sync + reboot; never reach `crypt_mount_or_mkfs()`. - Move `derive_data_key()` after `ensure_partitions()` (deriving before a reboot is harmless - but wasted; the new order states the dependency). -3. Reboot-loop guard (O1): before rebooting, re-read the table from the device and check that - p3 now ends at `last_usable`; if not, fail closed instead of rebooting. -4. `tpm-derive`: `DATA_KEY_PCRS` gains PCR5; doc comment updated. -5. `stage2/PCR-BINDING.md`: PCR5 now bound (GPT final before derivation); grow = reinit; the - TDX placement (PCR2); PCR10 still excluded (IMA boot aggregate). -6. pivot-init / grow-probe expectations: boot 1 now reboots once before the sentinel boot; a - grow test expects reinit after a grow. - -### Verification - -- QEMU x86_64 + aarch64: `make -C stage2 selftest-` / `test-pivot-` (pivot-init, - grow-probe with `PERSIST_GROW`), adjusted for the extra reboot and grow-wipes semantics. -- GCP, one VM at a time (AGENTS.md "Cloud test runs"), bundle like `chain-reboot` - (`scratchpad/setup-reboot.sh`, `reboot-run.sh`, `test-lb-rb-{snp,tdx}.sh`): n2d SEV-SNP and - c3 TDX must both PASS with no reinit after the provisioning reboot. -- A resized-volume test on GCP (O2): stop, grow the PD, start; confirm PCR5/PCR2 unchanged - before stage2 acts, then the grow + reboot + reinit. -- EC2 when unblocked: same, plus O3. - -### Open questions - -- **O1 reboot loop -- settled 2026-11-14: the read-back guard is enough** (it drops the buffer - cache before re-reading). A firmware that rewrote the GPT would change what it measures, so the - key just follows it; it is the provisioning phase, needs no sealing, and a reboot is cheap. - Original question: If the GPT write does not persist (read-only/misbehaving device, firmware - that "repairs" the table), every boot sees free space -> rewrite -> reboot, forever. The - read-back guard (change 3) catches a write that didn't stick; it does not catch a firmware - that rewrites the GPT on its next boot. Stronger bound wanted? -- **O2 firmware on a grown volume.** After a resize the backup GPT is no longer at the disk's - end. Expect EDK2 to validate and measure the primary unchanged; if a firmware repairs or - relocates the backup header, PCR5/PCR2 would move without stage2 rewriting anything. Check - on a real resized disk (GCP, EC2). -- **O3 Nitro PCR5.** If NitroTPM's PCR5 holds more than the GPT, binding it on EC2 needs that - content understood first. Needs an EC2 event-log capture (`tools/pcr-replay/EC2-NOTES.md`). - -## 4. Verifier side (independent of the data-key choice) - -- `pcr-replay` derives stage0's GPT event from `boot.disk`, which only holds on a boot before - stage2's rewrite. With the provisioning reboot, **every workload boot** measures the - rewritten GPT, so replaying PCR5 (non-TDX) / PCR2 (TDX) needs the GPT event digest from the - attestation: **lockboot/vaportpm#12** (aux data: one digest in the attested bank, from the - event log; the quote binds it via the PCR comparison). Needs: vaportpm-attest, - vaportpm-verify (+ flat zkVM format), **vaportpm-zk** (commit it in `ZkPublicInputs`), and a - pcr-replay "supplied digest" mechanism (open design; `tools/pcr-replay/README.md`, "Open: - GPT digest from the attestation"). Inputs today are 32-byte sha256 only -> per-bank values. -- Already done (workspace a56e303, 454744c; stage0 8322629): `route` rules in platform files - (GCE TDX: `EV_EFI_GPT_EVENT` 5 -> 2, `EV_EFI_BOOT_SERVICES_APPLICATION` 4 -> 2), stage0's - replay file in firmware log order, `gcp-c3-standard-4-tdx.replay.json`; TDX full chain - verified (first boot). -- Policy note: anything binding stage0's identity via PCR4 needs a TDX case (PCR2). - -## 5. Options considered - -### Rejected - -- **Bind stage0's identity via PCR7 and exclude PCR2 (2026-11-14):** stage0's PK/KEK/db are minted - per build and the private keys discarded, so PCR7 would identify one build -- but only as long as - that key really was destroyed, which nobody can demonstrate. PCR7 stays bound as before; PCR2 - stays bound for stage0's measured identity. -- **Exclude PCR2 on TDX** (from the data key or the verifier): loses stage0's identity. -- **Accept the one-time loss** (document "reboot once before relying on /data"): no. -- **Final layout at image build:** the GPT header's LastUsableLBA/AlternateLBA depend on the - disk size; would need a fixed disk size. -- **MAC under a GPT-independent PCR-derived key** (authenticating a blob): a foreign stage0 - runs first and can mimic every PCR except PCR2, then derive the MAC key -- "DOA". -- **Platform auto-detection / PCR0-based platform selection** in the verifier: the caller - names the platform file; a wrong one fails closed. - -### Key carriers (only needed if a grow must keep `/data`) - -Predict the post-rewrite PCRs on the setup boot (replay the verified live event log with -`H(UEFI_GPT_DATA(GPT-after))`; PolicyPCR digest = `H(0^32 || TPM_CC_PolicyPCR || selection || -H(PCR values))`) and carry the key K across the state change. Any carrier is adversarial. - -- **a) Sealed blob + TPM creation record.** Seal K to `PolicyPCR(after)`; before use, - `TPM2_CertifyCreation` (unsigned, `TPM_RH_NULL`) verifies the creation ticket, and the - recorded creation-PCR digest must equal our chain's state at sealing: non-GPT PCRs = live; - the GPT-holding PCR rebuilt from the verified live log with the stored pre-rewrite GPT - digest (untrusted but harmless: in PCR2 the Authenticode follows the GPT, so a foreign - stage0 would need a collision). Needs on-disk state (~200-byte blob); the ESP was considered - (placeholder file written raw, A/B slots) and is adversarial like any location. -- **b) TPM NV index holding K.** `authPolicy` = `PolicyOR(NV_Read + PolicyPCR(after), - NV_Write + PolicyPCR(before))`; attributes exactly `POLICYREAD | POLICYWRITE` (+ NO_DA; no - OWNER*/AUTH*); handle in the owner range, not `0x01c0xxxx` (TCG / GCP AK). Reader checks - `NV_ReadPublic` (attrs + authPolicy) against its own computation, so only a TPM in our full - chain's before state can have written K. Grow carries K over (read old, define new), no - re-encryption. Open: where the pre-setup GPT digest lives (second NV index or file; - untrusted, same argument as a), A/B indices for crash-safe grows, NV persistence on GCE / - NitroTPM / swtpm. Undefine via empty owner auth = DoS -> reinit. -- **Option 1 (last place): never rewrite the GPT.** Data region after the ESP found by its own - header. Stateless, handles grows; a disk region with no partition entry. - -## 6. Order of work (when un-parked) - -1. Decide section 3 (and O1's bound). 2. stage2 changes 1-6 + QEMU selftest both arches. -3. GCP SNP + TDX reboot tests, resized-volume test (O2). 4. EC2: capture, O3, same tests. -5. vaportpm#12 (verifier aux digest) in parallel; it is needed either way. diff --git a/WIP-RELEASE-TODO.md b/WIP-RELEASE-TODO.md index ed07f38..da18846 100644 --- a/WIP-RELEASE-TODO.md +++ b/WIP-RELEASE-TODO.md @@ -32,42 +32,36 @@ Needs a decision / quick check: `lb-rb-*.console.log`. **n2d SEV-SNP: PASS** (boot 2 `data_reinit=false`, sentinel present, overlay root ephemeral). **c3 TDX: key moves once** -- boot 2 `data_reinit=true` (/data wiped, pivot-init redid boot 1), boot 3 PASS (next item). -- [ ] **TDX stage2 data key binds PCR2, which now carries the GPT.** GCE TDX logs the GPT into - PCR2 (not PCR5), and PCR2 is in `DATA_KEY_PCRS` (stage2 tpm-derive). stage2 rewrites the GPT - on first boot, so the first reboot derives a different key and reinits `/data`; stable - after, until a disk grow. CONFIRMED 2026-11-10 (lb-rb-tdx: boots 1-2 reinit, boot 3 PASS): - data written on a TDX VM's first boot is lost at its first reboot. **Full plan: - `PLAN-GPT-MEASUREMENT.md`** (leading candidate: grow -> reboot before deriving the key, - bind PCR5 again, a volume grow wipes /data). **PARKED 2026-11-10** - until EC2 works (NitroTPM NV behaviour is an input). Options discussed, none ideal: - - Rejected: exclude PCR2 on TDX; accept the one-time loss; final layout at image build - (GPT header depends on disk size); a MAC under a GPT-independent PCR-derived key (a - foreign stage0 can mimic every PCR but PCR2). - - Option 3, predict the post-rewrite PCRs on the setup boot and bind the key to them. - Needs a carrier for the key across the state change; any carrier (ESP, disk, NV) is - adversarial input -- the attack is substitution (plant a key we then use), not reading. - a) Sealed blob + TPM creation record (CertifyCreation; creation PCRs checked against - our chain, GPT-holding PCR rebuilt from the verified live log). Needs on-disk state. - b) NV index holding K: authPolicy = OR(NV_Read + PolicyPCR(after), NV_Write + - PolicyPCR(before)), attrs exactly POLICYREAD|POLICYWRITE; reader checks - NV_ReadPublic attrs + authPolicy against its own computation, so only our full chain - (before state) can have written K. Grow carries K over (no re-encryption). Open: - where the pre-setup GPT digest lives, A/B indices for crash-safe grows, NV - persistence on GCE / NitroTPM. Undefine by empty owner auth = DoS -> reinit. - - Option 1 (last place): stage2 never rewrites the GPT (data region found by its own - header) -- stateless, handles grows. PCR2 cannot simply be excluded on TDX: it also carries - stage0's Authenticode. +- [x] **TDX stage2 data key binds PCR2, which now carries the GPT.** RESOLVED 2026-11-14 (stage2#5): + `bootstrap` reboots after any GPT rewrite and derives the key only on a boot that wrote + nothing; PCR5 bound again (only PCR10 excluded); a volume grow reinitializes `/data`. + Read-back guard before the reboot (p3 must end at the last usable LBA, else fail closed). + Verified: QEMU selftest both arches; GCP n2d SEV-SNP and c3 TDX reboot test PASS, no reinit + after the provisioning reboot (cloudtest `cd177e5753e6`, `lb-gr-{snp,tdx}`). Rationale, + rejected options (exclude PCR2; bind stage0 through PCR7; key carriers) in + `stage2/PCR-BINDING.md`. Was: data written on a TDX VM's first boot was lost at its first + reboot (cloudtest `7cf12890de5f`, `lb-rb-tdx`). +- [ ] **Firmware on a grown volume (untested).** After a PD / EBS resize the backup GPT is no + longer at the disk's end. Expect the firmware to measure the primary unchanged; if it + repairs or relocates the backup header, PCR5 / PCR2 move without stage2 writing anything. + Test on GCP: stop, grow the PD, start; confirm the GPT digest is unchanged before stage2 + acts, then the grow + reboot + reinit. +- [ ] **Nitro PCR5 (blocked on AWS).** NitroTPM's profile defines PCR5 as "Boot Manager Code + Configuration and Data and GPT". The data key now binds PCR5, so capture an EC2 event log + (`tools/pcr-replay/EC2-NOTES.md`) and confirm what else lands there before relying on it. - [ ] **PCR4 policy needs a TDX case:** anything binding stage0's identity via PCR4 (sealing, attestation policy) must use PCR2 on TDX. - [x] **stage1 `stage0-snippet.json`**: DROPPED (stage1 46d2bd0); `lockboot-deploy create` + docs produce the `_stage1` document. Follow-ups (filed / tracked): -- [ ] **GPT event digest as attestation aux data** -- lockboot/vaportpm#12: vaportpm-attest reads - it from the event log, vaportpm-verify carries it (incl. the flat zkVM format), **matching - vaportpm-zk change** (commit it in `ZkPublicInputs`), pcr-replay takes an event's digest from - it (open design, workspace `tools/pcr-replay/README.md`). Then PCR2 and PCR5 pin on every - boot, TDX and non-TDX; until then replay reproduces them on first boots only. +- [ ] **GPT digests in the attestation** -- lockboot/vaportpm#12 (open). DONE in vaportpm v0.4.1: + vaportpm-attest reads the boot disk's GPT (not the event log) and carries + `gpt: {sha256, sha384}`; vaportpm-verify outputs it; stage1#22 attests with it; stage0#14 + and workspace#6 replay PCR5 / PCR2 from it on every boot (verified on c3 TDX, cloudtest + `54ccd425a50b`). REMAINING: the flat zkVM format and vaportpm-zk do not carry it (or decide + a proof's verifier takes it out of band); vaportpm-zk follows vaportpm `main` and its + fixtures lack `gpt`. - [ ] **`init_on_free=1` kills the TD on GCE TDX** (silent reset; dropped, `init_on_alloc=1` kept). Root cause parked. A triple fault and a TD kill look the same from inside; a #DF handler that dumps state before the triple fault would tell them apart. From 19880406d11ba424097e9692589223ca81c884c1 Mon Sep 17 00:00:00 2001 From: HaRoLd <303926+HarryR@users.noreply.github.com> Date: Wed, 18 Nov 2026 05:32:48 +0000 Subject: [PATCH 06/13] tracker, gcp README: GPT digests shipped; vaportpm#12 closed The flat zkVM format and vaportpm-zk are unchanged by design. Co-Authored-By: Claude --- WIP-RELEASE-TODO.md | 12 +++++++----- tools/pcr-replay/platforms/gcp/README.md | 9 +++++---- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/WIP-RELEASE-TODO.md b/WIP-RELEASE-TODO.md index da18846..cb4544c 100644 --- a/WIP-RELEASE-TODO.md +++ b/WIP-RELEASE-TODO.md @@ -55,13 +55,15 @@ Needs a decision / quick check: docs produce the `_stage1` document. Follow-ups (filed / tracked): -- [ ] **GPT digests in the attestation** -- lockboot/vaportpm#12 (open). DONE in vaportpm v0.4.1: - vaportpm-attest reads the boot disk's GPT (not the event log) and carries +- [x] **GPT digests in the attestation** -- lockboot/vaportpm#12, CLOSED 2026-11-18. vaportpm + v0.4.1: vaportpm-attest reads the boot disk's GPT (not the event log) and carries `gpt: {sha256, sha384}`; vaportpm-verify outputs it; stage1#22 attests with it; stage0#14 and workspace#6 replay PCR5 / PCR2 from it on every boot (verified on c3 TDX, cloudtest - `54ccd425a50b`). REMAINING: the flat zkVM format and vaportpm-zk do not carry it (or decide - a proof's verifier takes it out of band); vaportpm-zk follows vaportpm `main` and its - fixtures lack `gpt`. + `54ccd425a50b`). The flat zkVM format and vaportpm-zk are unchanged BY DESIGN: the proof + establishes the chain of trust behind the quote and does not rebuild PCRs; the digests are + replay input and travel outside the proof. +- [ ] (later, housekeeping) vaportpm-zk's `Cargo.lock` still pins vaportpm 0.1.0 (785438f) though + its manifest follows `branch = "main"`; re-lock and re-run its tests when it is next touched. - [ ] **`init_on_free=1` kills the TD on GCE TDX** (silent reset; dropped, `init_on_alloc=1` kept). Root cause parked. A triple fault and a TD kill look the same from inside; a #DF handler that dumps state before the triple fault would tell them apart. diff --git a/tools/pcr-replay/platforms/gcp/README.md b/tools/pcr-replay/platforms/gcp/README.md index de52358..882e680 100644 --- a/tools/pcr-replay/platforms/gcp/README.md +++ b/tools/pcr-replay/platforms/gcp/README.md @@ -108,10 +108,11 @@ stage0, stage1, stage2, every PCR but IMA's PCR10, sha256 and sha384). - Anything binding stage0's identity via PCR4 (sealing policy, attestation policy) needs a TDX case: there it is PCR2, which also carries the GPT. - The GPT changes after the first boot (stage2 adds its partitions, and again on a disk grow), so - the replay, which derives it from `boot.disk`, reproduces PCR5 (non-TDX) and PCR2 (TDX) on first - boots only. PCR2 must stay pinned on TDX: it carries stage0's Authenticode. Planned: the - attestation carries the GPT event digest as auxiliary data, which pins PCR2 and PCR5 on every - boot on both (lockboot/vaportpm#12; `../../README.md`, "Open: GPT digest from the attestation"). + a derivation from `boot.disk` reproduces PCR5 (non-TDX) and PCR2 (TDX) on first boots only. + PCR2 must stay pinned on TDX: it carries stage0's Authenticode. The attestation carries the + boot disk's GPT digests (vaportpm v0.4.1), and stage0's GPT event takes its digest from them, + which pins PCR2 and PCR5 on every boot on both (`../../README.md`, "The GPT digest from the + attestation"). ## Expected (from the 2026-11-05 matrix, before captures were kept) From f00112ca2399317613c5e0db8627955a8d8f6246 Mon Sep 17 00:00:00 2001 From: HaRoLd <303926+HarryR@users.noreply.github.com> Date: Wed, 18 Nov 2026 05:34:55 +0000 Subject: [PATCH 07/13] gcp platform README: every-boot TDX verification, stage2's key; drop the 11-05 table The 2026-11-05 expected-values table is superseded by the captures table. Co-Authored-By: Claude --- tools/pcr-replay/platforms/gcp/README.md | 31 +++++++++--------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/tools/pcr-replay/platforms/gcp/README.md b/tools/pcr-replay/platforms/gcp/README.md index 882e680..265ab3c 100644 --- a/tools/pcr-replay/platforms/gcp/README.md +++ b/tools/pcr-replay/platforms/gcp/README.md @@ -15,7 +15,7 @@ pcr-replay.py platforms/gcp/gcp-n2d-standard-2-sev-snp.replay.json stage0.replay | `gcp-n2d-standard-2-sev.replay.json` | `a0b5ff33` | `2c4b6392` | full chain, 2026-11-09 | | `gcp-n2d-standard-2-sev-snp.replay.json` | `50597a27` | `2c4b6392` | full chain, 2026-11-09 | | `gcp-c3-standard-4-shielded.replay.json` | `d0c70a93` | `1e0e29fc` | stage0 only | -| `gcp-c3-standard-4-tdx.replay.json` | `0cca9ec1` | `baef2b3d` | full chain, 2026-11-10 (with `route`, below) | +| `gcp-c3-standard-4-tdx.replay.json` | `0cca9ec1` | `baef2b3d` | full chain, 2026-11-10 (with `route`, below); boots 1-3 of one VM with the attested GPT digest, 2026-11-14 | Each file re-derives every PCR0-2 event from its logged bytes except the three ACPI DATA events, which are pinned (their digests cover ACPI tables the log does not contain). Not covered: t2a / Arm (no network stack in the firmware, below), other @@ -103,24 +103,17 @@ CC measurement register rather than by PCR (TCG CC mapping: PCR2-6 all map to RT boot-chain event type in PCR0-2 after the separator and never in its usual PCR. stage0's replay file is unchanged apart from listing its events in log order (GPT before BOOTX64.EFI), which is the order they reach PCR2. Verified against the TDX full-chain regression boot (2026-11-10: -stage0, stage1, stage2, every PCR but IMA's PCR10, sha256 and sha384). +stage0, stage1, stage2, every PCR but IMA's PCR10, sha256 and sha384), and across three boots of +one VM, before and after stage2's GPT rewrite, with PCR2 replayed from the attestation's GPT +digest (2026-11-14). - Anything binding stage0's identity via PCR4 (sealing policy, attestation policy) needs a TDX case: there it is PCR2, which also carries the GPT. -- The GPT changes after the first boot (stage2 adds its partitions, and again on a disk grow), so - a derivation from `boot.disk` reproduces PCR5 (non-TDX) and PCR2 (TDX) on first boots only. - PCR2 must stay pinned on TDX: it carries stage0's Authenticode. The attestation carries the - boot disk's GPT digests (vaportpm v0.4.1), and stage0's GPT event takes its digest from them, - which pins PCR2 and PCR5 on every boot on both (`../../README.md`, "The GPT digest from the - attestation"). - -## Expected (from the 2026-11-05 matrix, before captures were kept) - -| Config | PCR0 | PCR1 | -|---|---|---| -| n2d Shielded | `d0c70a93` | `09b32fdf` | -| n2d SEV | `a0b5ff33` | `2c4b6392` | -| n2d SEV-SNP | `50597a27` | `2c4b6392` | -| c3 Shielded | `d0c70a93` | `1e0e29fc` | -| c3 TDX | DHCP timeout, no reading | | -| t2a Shielded | never booted | | +- The GPT changes when stage2 adds its partitions (first boot, and again on a disk grow), so a + derivation from `boot.disk` reproduces PCR5 (non-TDX) and PCR2 (TDX) only on a boot before + that rewrite. The attestation carries the boot disk's GPT digests (vaportpm v0.4.1) and + stage0's GPT event takes its digest from them, which pins PCR2 and PCR5 on every boot + (`../../README.md`, "The GPT digest from the attestation"). +- stage2's data key binds both PCRs. It reboots after a GPT rewrite and derives the key only on + a boot that wrote nothing, so the key follows the final layout on TDX as elsewhere (stage2 + `PCR-BINDING.md`). From 7408e03b65f35d085d56bc408eb2c5c78724577c Mon Sep 17 00:00:00 2001 From: HaRoLd <303926+HarryR@users.noreply.github.com> Date: Wed, 18 Nov 2026 08:14:46 +0000 Subject: [PATCH 08/13] tracker trimmed to outstanding items; deploy-shell-aws / deploy-shell-gcp - WIP-RELEASE-TODO.md: resolved and superseded items removed (git history has them); scope is the GCP x86_64 release; records the kernel bump, the 2026-11-18 selftest and the release tooling fixes. - Makefile: deploy-shell-aws and deploy-shell-gcp = deploy-shell with LOGIN fixed. Co-Authored-By: Claude --- Makefile | 8 + WIP-RELEASE-TODO.md | 628 +++++++++----------------------------------- 2 files changed, 138 insertions(+), 498 deletions(-) diff --git a/Makefile b/Makefile index 563a4a6..dcc93b0 100644 --- a/Makefile +++ b/Makefile @@ -130,6 +130,7 @@ check-harness: ## Fail if any repo's build.mk / Dockerfile.build drifted from st # $HOME -- never on disk, never under /src (which every lockboot:build container can read). Don't run # builds while a logged-in shell is open: the builders are --privileged. # make deploy-shell LOGIN=aws|gcp|both # sign in, interactive shell, sign out on exit +# make deploy-shell-aws / deploy-shell-gcp # the same, one cloud # make deploy-shell # tools only, no login # make deploy-shell LOGIN=gcp CMD='gcloud compute images list --no-standard-images' # make deploy-exec CMD='aws sts get-caller-identity' # run inside the OPEN shell (its login) @@ -172,6 +173,13 @@ deploy-shell: deploy-image ## Shell (or CMD='...') in lockboot:deploy; LOGIN=aws -v $(DEPLOY_HOST_WS):/src $(DEPLOY_ENV) -e DEPLOY_LOGIN=$(LOGIN) -e DEPLOY_CMD -e GH_TOKEN \ -w /src $(DEPLOY_IMAGE) +.PHONY: deploy-shell-aws deploy-shell-gcp +# deploy-shell signed in to one cloud. Still one session at a time (fixed container name). +deploy-shell-aws: override LOGIN := aws +deploy-shell-gcp: override LOGIN := gcp +deploy-shell-aws: deploy-shell ## deploy-shell signed in to AWS only (= LOGIN=aws) +deploy-shell-gcp: deploy-shell ## deploy-shell signed in to GCP only (= LOGIN=gcp) + .PHONY: deploy-exec # Run CMD inside the RUNNING deploy-shell (same tmpfs $HOME, so the same live login). Fails if no # shell is open; the session's lifetime stays with whoever holds the interactive deploy-shell. diff --git a/WIP-RELEASE-TODO.md b/WIP-RELEASE-TODO.md index cb4544c..950f892 100644 --- a/WIP-RELEASE-TODO.md +++ b/WIP-RELEASE-TODO.md @@ -1,504 +1,136 @@ # WIP release TODO -Working tracker for the current cross-repo release changeset, so nothing is lost from context. -Status legend: `[ ]` open, `[x]` done, `[?]` claim not yet verified against docs/behaviour. -Every cloud-platform claim must cite the doc (or observed behaviour) it was verified against. +Outstanding items for the current release. Resolved items are removed, not ticked; git history +has them. Every cloud-platform claim cites the doc or the observed behaviour it rests on. -## The changeset (one PR per repo; merge only when all pass together) +## This release: GCP x86_64 -| Repo | PR | Branch | -|---|---|---| -| stage0 | lockboot/stage0#12 | `mkvarstore-port-forward` | -| stage1 | lockboot/stage1#21 | `aarch64-sysctl-arch-aliases` | -| stage2 | lockboot/stage2#2 | `resolv-conf-arch-aliases` | -| vaportpm | lockboot/vaportpm#11 | `attest-derive-subcommand` | -| workspace | lockboot/workspace#5 | `harness-sync-stage2` | - -## Status 2026-11-10 - -- All five PRs draft, mergeable, CI green on their heads (stage0 8322629, stage1 b86bc5a, stage2 - bb96d47, vaportpm e956e5f, workspace 454744c). PR descriptions current. -- GCP x86_64 done: n2d Shielded / SEV / SEV-SNP, c3 Shielded / **TDX**. Full chain verified by - `pcr-replay` against golden platform files on SEV, SEV-SNP and TDX (2026-11-10 regression); - stage0 probes on Shielded n2d and c3. TDX needed direct gVNIC doorbells + the LAPIC tick - (stage0 615b810, 34dbc69) and dropping `init_on_free=1` (stage1 b86bc5a). -- GCP project `lockboot` clean (no instances / images / objects). -- Merge gate unchanged: EC2 (AWS account still blocked) + the full suite on both arches. - -## Open items 2026-11-10 - -Needs a decision / quick check: -- [x] **Reboot stability on GCP** (check E), 2026-11-10, pivot-init, cloudtest 7cf12890de5f - `lb-rb-*.console.log`. **n2d SEV-SNP: PASS** (boot 2 `data_reinit=false`, sentinel present, - overlay root ephemeral). **c3 TDX: key moves once** -- boot 2 `data_reinit=true` (/data - wiped, pivot-init redid boot 1), boot 3 PASS (next item). -- [x] **TDX stage2 data key binds PCR2, which now carries the GPT.** RESOLVED 2026-11-14 (stage2#5): - `bootstrap` reboots after any GPT rewrite and derives the key only on a boot that wrote - nothing; PCR5 bound again (only PCR10 excluded); a volume grow reinitializes `/data`. - Read-back guard before the reboot (p3 must end at the last usable LBA, else fail closed). - Verified: QEMU selftest both arches; GCP n2d SEV-SNP and c3 TDX reboot test PASS, no reinit - after the provisioning reboot (cloudtest `cd177e5753e6`, `lb-gr-{snp,tdx}`). Rationale, - rejected options (exclude PCR2; bind stage0 through PCR7; key carriers) in - `stage2/PCR-BINDING.md`. Was: data written on a TDX VM's first boot was lost at its first - reboot (cloudtest `7cf12890de5f`, `lb-rb-tdx`). -- [ ] **Firmware on a grown volume (untested).** After a PD / EBS resize the backup GPT is no - longer at the disk's end. Expect the firmware to measure the primary unchanged; if it - repairs or relocates the backup header, PCR5 / PCR2 move without stage2 writing anything. - Test on GCP: stop, grow the PD, start; confirm the GPT digest is unchanged before stage2 - acts, then the grow + reboot + reinit. -- [ ] **Nitro PCR5 (blocked on AWS).** NitroTPM's profile defines PCR5 as "Boot Manager Code - Configuration and Data and GPT". The data key now binds PCR5, so capture an EC2 event log - (`tools/pcr-replay/EC2-NOTES.md`) and confirm what else lands there before relying on it. -- [ ] **PCR4 policy needs a TDX case:** anything binding stage0's identity via PCR4 (sealing, - attestation policy) must use PCR2 on TDX. -- [x] **stage1 `stage0-snippet.json`**: DROPPED (stage1 46d2bd0); `lockboot-deploy create` + - docs produce the `_stage1` document. - -Follow-ups (filed / tracked): -- [x] **GPT digests in the attestation** -- lockboot/vaportpm#12, CLOSED 2026-11-18. vaportpm - v0.4.1: vaportpm-attest reads the boot disk's GPT (not the event log) and carries - `gpt: {sha256, sha384}`; vaportpm-verify outputs it; stage1#22 attests with it; stage0#14 - and workspace#6 replay PCR5 / PCR2 from it on every boot (verified on c3 TDX, cloudtest - `54ccd425a50b`). The flat zkVM format and vaportpm-zk are unchanged BY DESIGN: the proof - establishes the chain of trust behind the quote and does not rebuild PCRs; the digests are - replay input and travel outside the proof. -- [ ] (later, housekeeping) vaportpm-zk's `Cargo.lock` still pins vaportpm 0.1.0 (785438f) though - its manifest follows `branch = "main"`; re-lock and re-run its tests when it is next touched. -- [ ] **`init_on_free=1` kills the TD on GCE TDX** (silent reset; dropped, `init_on_alloc=1` kept). - Root cause parked. A triple fault and a TD kill look the same from inside; a #DF handler - that dumps state before the triple fault would tell them apart. -- [ ] **GCP Arm (t2a):** firmware has no network stack above SNP (no MNP/IP4/DHCP4/TCP4); stage0 - would need to embed one. No t2a PCRs until then. -- [ ] **EC2** (blocked on the AWS case): platform golden files (`tools/pcr-replay/EC2-NOTES.md`), - recreate the AMI (predates the PCR7 owner-GUID fix), ENA logging / `[S.mmm]` timestamps, - ENA ExitBootServices quiesce (below). -- [ ] stage0 `REPRODUCIBLE-BUILDS.md`: varstore notes. -- [ ] No Makefile target for the verbose gvnic build (`--features verbose`). -- [ ] Blog: the gvnic post gains the TDX story (BAR2 doorbells, PIT-less TD, LAPIC tick). - -After the release: -- [ ] **TDX quote / SNP report as supplementary attestation** (like Nitro's NSM document): bind the - vTPM attestation to hardware evidence. Unattested in-guest claims (CPUID etc.) are not used. - -## Status 2026-11-05 (end of GCP day) - -- Merge gate: AWS account restriction (support case) -> then the full suite across EC2 + GCP, - both arches where supported, before any PR merges. All PRs stay open/draft until then. -- GCP x86 done for Shielded / SEV / SEV-SNP (stage0 PR #12: 34bd6fa db8caab b3df2b0 aeecd8d); - TDX + t2a open (below). GCP project `lockboot` cleaned: no instances/images/objects; buckets - `lockboot` + `lockboot-test` kept empty (test keeps its allUsers grant). -- Blog draft (uncommitted, outside the build): `wavebend.org/drafts/2026-11-05-gcp-gvnic.md`. - After merge: decide extra sections (UDP4 RecycleSignal, dbx), and add a correction note to the - ENA post (it says GCP's OVMF brings up virtio-net -- no longer true). - -## Up next (queued) - -- [x] **stage0 gVNIC UEFI driver** -- DONE (stage0 #12; TDX too: 615b810 doorbells, 34dbc69 LAPIC - tick). Original note: (embedded + measured like `ena.efi`). GCP enforces gVNIC for - Confidential VMs AND Arm (t2a) -- API, observed 2026-11-05: "Confidential Compute VMs - cannot use VIRTIO_NET. They must use GVNIC." / t2a: "Only [[GVNIC, UNSPECIFIED_NIC_TYPE]] - nic types are allowed". GCP's UEFI firmware has no gVNIC driver (only virtio-net), so - with gVNIC stage0 dies at `no EFI_IP4_CONFIG2 ... NOT_FOUND`. Blocks GCP SNP + GCP aarch64. - Spec references: Linux `gve`, DPDK gve PMD. Until then GCP x86 = Shielded VM on virtio-net - (test only); `launch-instance.sh` hard-codes GVNIC (introduced 7f1bc44 with the ENA - driver, never booted on GCP since). -- [ ] **ENA ExitBootServices quiesce** (gvnic half DONE: full teardown -- DESTROY_TX/RX, - UNREGISTER_PAGE_LIST, DECONFIGURE -- then reset, from an EBS event). ENA: later issue. `ena.efi` never resets the device - at ExitBootServices, so RX DMA stays posted into boot-services memory the OS reuses. Linux - evidently copes on EC2 (its driver resets at probe), but the window between EBS and the ENA - probe is a real DMA-into-freed-memory hazard. gvnic registers an EBS event -> reset - handshake from the start; port the same to ena. -- [x] **dbx A/B** -- DONE (resolved below: `dbx.auth.bin`). Original note: (after the DeployedMode question): `mkvarstore.py` emits `dbx.esl` (same - placeholder already in efi-vars.{ovmf,aws}); `gcp/create.sh --forbidden-database-file`; - confirm GCP's "BIN" = full EFI_SIGNATURE_LIST by comparing PCR 7 / the dbx event. - -## GCP x86 matrix 2026-11-05 (gvnic driver, image A = GCP default dbx) - -Spot, asia-southeast1-b, probe payload, sha256 PCRs (first 16 hex). All stable across reboots. -**Superseded** by workspace `tools/pcr-replay/platforms/gcp/` (captures + golden replay files, -2026-11-09/10), which also covers TDX. Kept as the 11-05 record. - -| Config | Machine | Net/payload | PCR0 | PCR1 | PCR2,3,6 | PCR4 | PCR5 | PCR7 | PCR14 | -|---|---|---|---|---|---|---|---|---|---| -| Shielded | n2d-standard-2 | OK (6 boots) | d0c70a93 | 09b32fdf | 3d458cfe | 4fd748b2 | 170cbfef | c05a3c37 | 090f86bc | -| SEV | n2d-standard-2 | OK | a0b5ff33 | 2c4b6392 | 3d458cfe | 4fd748b2 | 170cbfef | c05a3c37 | 090f86bc | -| SEV-SNP | n2d-standard-2 (Milan) | OK | 50597a27 | 2c4b6392 | 3d458cfe | 4fd748b2 | 170cbfef | c05a3c37 | 090f86bc | -| Shielded | c3-standard-4 | OK | d0c70a93 | 1e0e29fc | 3d458cfe | 4fd748b2 | 170cbfef | c05a3c37 | 090f86bc | -| TDX | c3-standard-4 | **DHCP timeout** (11-05); OK 11-09 | 0cca9ec1 | baef2b3d | GPT + stage0 land in PCR2 | BDS action + sep only | sep only | | | -| local QEMU (our dbx) | | OK | 62852b26 | c3cc3083 | 3410b993/3d458cfe | 4fd748b2 | 170cbfef | 965cb27a | 090f86bc | - -- PCR0 varies by confidential type; PCR1 by machine type / confidential-vs-not. PCR4 (stage0), - PCR5 (GPT), PCR14 (payload) are portable across GCP configs AND local QEMU; PCR7 is uniform - across GCP configs for one image (keys + dbx fixed). -- [x] **TDX: gvnic probe all PASSED + link up, but no packets (DHCP 30 s timeout).** RESOLVED - 2026-11-09. The QPL shared/private theory below was wrong. Two causes: (1) GCE backs the - doorbell BAR2 as memory; under TDX EDK2's `PciIo.Mem` is a TDVMCALL MMIO hypercall that - never reaches it -> direct stores to the BAR's host address (615b810); (2) GCE firmware - ticks from the PIT/8259 and a TD gets no IRQ0, so no UEFI timer event ever fired -> LAPIC - tick when the firmware tick is dead (34dbc69). Original note: Not the queue - format (c3 Shielded works in GQI_QPL with the same device options 0x3+0x4). TDX-specific: - AQ DMA works, data-path DMA doesn't -- look at shared/private conversion of the large QPL / - ring buffers under TDX's IoMmu. Deferred. -- [ ] (deferred, 2026-11-10: GQI_QPL works on every platform we need) **DQO** (0x4) offered on c3 alongside GQI_QPL; not needed (GQI_QPL carries traffic). Revisit - only if a series stops offering 0x3. -- [x] **dbx on GCP: RESOLVED.** A bare EFI_SIGNATURE_LIST as fileType BIN is accepted at image - create but kills every VM at start (`compute.instances.hostError` ~8 s, all configs incl. - TDX, console "Unknown CPU Platform"). GCP's BIN dbx is an AUTHENTICATED variable update - (`EFI_VARIABLE_AUTHENTICATION_2` || ESL, as uefi.org DBXUpdate.bin used in RHEL's GCP docs), - signed by an enrolled KEK. Build now emits `dbx.auth.bin` (mkvarstore.py `--out-dbx-auth`, - KEK-signed via `openssl cms -noattr`, fixed timestamp) -- reproducible for a given key set, - ESL byte-identical to efi-vars.{ovmf,aws}. Verified through gcp/create.sh: boots, PCR7 - `ee5f65dc` (an X.509 dbx entry also boots: PCR7 `09992522`; default dbx: `c05a3c37`). -- [x] **PCR7 GCP vs QEMU differs with identical dbx bytes** (`ee5f65dc` vs `965cb27a`). ROOT CAUSE - (2026-11-06): GCP wraps the PK/KEK/db .cer we upload in an ESL with a fixed, undocumented - SignatureOwner `d281fad2-8d88-47a4-9792-5baa47bb1b89` (seen in go-tpm-tools' GCE test event - logs, cos-101 + ubuntu-2404); we used random per-key GUIDs (gen-keys.sh `uuidgen`). Event - sequence is otherwise identical (SecureBoot, PK, KEK, db, dbx, separator, db authority) -- - offline replay (scratchpad gce-evlog/bin/predict.py) reproduces BOTH values exactly. FIX - (committed, stage0 #12): gen-keys.sh writes GCP's GUID for all three; dev build/keys/*.guid rewritten. - VERIFIED on QEMU: PCR7 `965cb27a` -> `ee5f65dc` (= GCP), PCR0-6/14 unchanged. EC2 pending - (expected `ee5f65dc` too: efi-vars.aws comes from the same mkvarstore). The AMI - `ami-04abef7162f90706e` predates the fix -> recreate. Follow-up DONE: predicted PCRs are a - build output (`stage0.replay.json` + `pcrs.json`, stage0 #12). -- gcp/create.sh bugs found + fixed (committed, stage0 #12): `images list --filter=name=X` is a pattern match - (X matched X-defdbx) -> exact `images describe`; gcloud types key files by extension (`.bin` -> - BIN, else must be DER X.509) -> dbx passed as a `.bin` copy. -- [x] Signed BOOT*.EFI is not byte-reproducible across re-signings -- BY DESIGN: the Secure Boot - keys are deliberately ephemeral (minted per build), so the signed binary differs per build. - PCR4 (Authenticode hash) is unaffected. - -## Findings 2026-11-05 (GCP day) - -- stage0 DeployedMode gate refused every GCP boot: GCP can only provision PK/KEK/db/dbx, firmware - boots in User Mode. Fixed in stage0 be996b4: require SecureBoot=1, SetupMode=0, AuditMode - 0/absent; accept User or Deployed. stage0 never writes DeployedMode. -- Local QEMU (our edk2): `AuditMode` absent, `DeployedMode` = our preset plain NV|BS variable - (attrs 0x03), `SecureBoot`/`SetupMode` BS|RT -- this edk2 does not implement the UEFI 2.5 - modes; DeployedMode=1 on QEMU/EC2 was never firmware-enforced. -- A guest power-off leaves a GCP spot VM STOPPED (not deleted; `--max-run-duration` timer is - cleared on stop). Manifest + cleanup.sh required. -- GCP org policy `iam.allowedPolicyMemberDomains` blocked allUsers; overridden on project - `lockboot` only (2026-11-05). `gs://lockboot-test` = public-read payload mirror. -- `t2a` not offered in asia-southeast1-a -> default zone now `-b` (workspace Makefile). -- `lockboot-deploy create --args` applies to `_stage2` only; no way to set `_stage1` args - (used jq for the probe). Test-only gap: `_stage1.args` become the chain-loaded EFI image's - LoadOptions, which our UKI ignores under Secure Boot (stage0 `config.rs`); only a non-UKI stage1 - such as the stage0 test payload reads them. LEAVE (2026-11-10). -- Follow loops: stopping the host `docker exec` does not stop the in-container process; run - followers under in-container `timeout`. - -## Release gate - -- [x] Local `make selftest`, both arches (x86_64 KVM, aarch64 TCG): ALL PASS (before the getcap - fix; getcap fix verified by a single fresh-vTPM boot, no `core` file). -- [x] Tag rulesets (`lockboot-release-tags`, `refs/tags/v*`) + immutable releases: applied live, - `make check-rulesets` ok on all 6 repos. -- [x] Release attestation covers zip contents (+ `qemu-test.sh`) via `subject-checksums`. -- [ ] Cloud serial-console check, 4 cells: {EC2, GCP} x {x86_64, aarch64}. GCP x86_64 DONE - (2026-11-09/10, all lines present); EC2 both blocked (AWS case); GCP aarch64 blocked (no - network stack in the t2a firmware). Per cell look for - `stage0:` lines, kernel printk, `init:` lines, `stage1:` lines, stage2 loader lines. - (See `CONSOLE-OUTPUT.md` Phase 2.) Watch userspace lines: `/dev/console` = last - registered `console=`. -- [ ] (later -- user archives them in due time) stage1 old releases `v0.1.0` / `v0.2.0` (pre-split, from lockboot/lockboot): both ship an - aarch64 varstore trusting Debian's public SnakeOil KEK + db (verified by parsing their - `efi-vars.ovmf`). Decide: delete (recommended) or deprecate. Check whether any AMI / GCP - image was ever published from them; deregister if so. -- [ ] (later, at the first tag) First tagged release: confirm attestation subject names (`gh attestation verify - --format json`), that release-notes edits still work under immutability, and the new-ghcr- - package push (org package-creation policy unknown). - 2026-11-15, vaportpm (no ghcr package): v0.4.0 published EMPTY -- `draft: false` publishes - before the upload and an immutable release takes no uploads after. Fixed by draft-then-publish - (vaportpm#14; stage0#14, stage1#22, stage2#5). v0.4.1: 4 assets, immutable, each asset passes - `gh attestation verify`, byte-identical to a local build; notes edits work. The ghcr push - remains unconfirmed until a stage release. -- [ ] (later, when it comes up) stage1 `release-docker` builds arm64 without `docker/setup-qemu-action` (the stage0 harness - and stage2 erofs-builder jobs add it). Likely broken the same way; untested. - -## Cloud verification matrix (day plan) - -Goal: the full chain (stage0 -> UKI -> stage1 -> packed stage2 loader -> `pivot-init`) boots, -is captured on the serial console, and survives an in-guest reboot on all four cells. Fill the -results table as you go; each `[?]` / experiment below resolves a tracked item. - -### 0. Prep (local, once, before any cloud) - -**STALE (2026-11-04):** stage0 has been rebuilt many times since; these hashes describe nothing -current. **Prep builds DONE 2026-11-04 18:30** (step 1 below; all four make steps ok). Snapshot -- if any of -these change, stage0 was rebuilt and every AMI / GCP image made earlier is stale: - -| File | x86_64 sha256 (16) | aarch64 sha256 (16) | -|---|---|---| -| stage0 `BOOT*.EFI` | `99104de5ff746e61` | `40e8d596c36eb5ba` | -| stage0 `boot.disk` | `5f4b143de40e2642` | `7bea0a26a45f47d2` | -| stage0 `efi-vars.ovmf` | `04ae1c84463b731c` | `25e1cbf68ef26276` | -| stage0 `efi-vars.aws` | `8f8ea21083b3d435` | `8f8ea21083b3d435` (arch-independent) | -| stage0 `db.cer` (shared keys) | `47cd8e40b46dbe81` | `47cd8e40b46dbe81` | -| stage0 `BUILD_ID` | `stage0-99104de5ff74` | `stage0-40e8d596c36e` | -| stage1 `linux.efi` | `8b9a120e7c34f8d2` | `a75b5113b1333395` | -| stage2 `pack/stage2` | `2eea48a4353a5536` | `444cf15f12d14cfd` | - -**Do NOT run any `make -C stage0 ...` while a cloud image built from the current keys is in use** -(still true by default; `HAZMAT_WARNING_NO_REGEN_KEYS_DEV_ONLY=1` reuses `build/keys` for dev -loops, refused under CI, never for a release) -- not just builds: any target that depends on the keys (`build-*`, `boot-*`, `smoke-boot-*`, `selftest-*`) regenerates -PK/KEK/db (observed: keys re-minted at 15:33 by a boot test and at 18:29 by this build), which -re-signs `BOOT*.EFI` and rewrites the varstores. (`gcp/create.sh` now names images by `BUILD_ID`, -faa8604, so it no longer silently reuses an old image.) stage1/stage2 makes are safe (UKI hashes reproduce exactly). +Scope: n2d Shielded / SEV / SEV-SNP and c3 Shielded / TDX. EC2 and GCP Arm are out of scope +(blocked, below) and do not hold the release. -0. **Tooling: DONE (`lockboot:deploy` image built 2026-11-05).** All cloud work runs in - `make deploy-shell` (workspace Makefile; never `make -C stage0 ...`). Image = - `tools/deploy/Dockerfile`: aws CLI 2.39.4, coldsnap 0.12.0, gcloud 592.0.0, gh 2.103.3, jq/curl/unzip, - all sha256-pinned. `/src` = workspace; `$HOME` = per-run tmpfs. Defaults: AWS `ap-southeast-1`, - GCP project `lockboot`, `asia-southeast1` / `asia-southeast1-b` (201b614; t2a is not offered in -a) (override `DEPLOY_AWS_REGION`, - `DEPLOY_GCP_PROJECT`, `DEPLOY_GCP_REGION`, `DEPLOY_GCP_ZONE`). - **Credentials = browser sign-in (passkey) at shell start, only to the clouds you name; sign-out on - exit.** Tokens exist only in the container's tmpfs (`tools/deploy/entry.sh`): - ```bash - make deploy-shell LOGIN=both # or LOGIN=aws / LOGIN=gcp; keep ONE shell open for the day - ``` - - AWS (current, 91902d6): sign-in as IAM user `lockboot` (passkey MFA), which can only assume role - `lockboot-deploy` (least-privilege EC2/EBS-direct/S3; `tools/deploy/aws-iam.sh`). Original - (root) notes: `aws login --remote` (console sign-in incl. passkey MFA; temp creds auto-refresh, session - <= 12 h then re-login). IAM principal needs `SignInLocalDevelopmentAccess`, plus: `ec2` - image/snapshot/instance/tag/console-output actions, `ebs:StartSnapshot/PutSnapshotBlock/ - CompleteSnapshot` (coldsnap), S3 put on the hosting bucket. Profile `default` wraps the login via - `credential_process`, so aws/coldsnap/scripts need no `AWS_PROFILE`. Exit: `aws logout --all`. - - GCP: `gcloud auth login --no-launch-browser`. The refresh token does NOT expire on its own - (unless Cloud Identity "Google Cloud session control" is set) -> exit runs `gcloud auth revoke - --all` (server-side). Needs Compute Instance Admin + Compute Storage Admin (images) + Storage - Object Admin on the bucket. - - Exit = `exit` / Ctrl-D in the shell (trap also fires on INT/TERM/HUP). If the container is - killed hard (`docker kill`, host crash) no revoke runs: revoke the gcloud grant manually. - - The container is named `lockboot-deploy` (`--rm`: gone on exit; one session at a time). - `make deploy-exec CMD='...'` runs inside the open shell with its login (how Claude runs - commands: read-only freely, ask before anything that creates/modifies/deletes or costs money; - cloud test VMs follow AGENTS.md "Cloud test runs"). - - Builds while a logged-in shell is open: allowed by the user (2026-11-09). Originally avoided - because builders are `--privileged` and could read the shell's tmpfs. - - gh (release mode only; local-build mode doesn't need it): `GH_TOKEN` env passthrough. -1. All five repos on their PR branches (table above). Build once: - ```bash - make -C stage0 build-x86_64 build-aarch64 # boot.disk, efi-vars.{ovmf,aws}, *.cer - make -C stage1 build-x86_64 build-aarch64 # tools/build-uki//linux.efi - make -C stage2 pack-x86_64 pack-aarch64 # build//pack/stage2 (loader + pivot-init) - make -C stage1 deploy-bin # target/x86_64-unknown-linux-musl/debug/lockboot-deploy - ``` - (Done -- see the snapshot above. Remaining: step 2, which needs the hosting base URL.) -2. Host the UKI + stage2 over **plain http://** (stage0 has no TLS), publicly readable: an S3 - bucket (`http://.s3..amazonaws.com`) or GCS (`http://storage.googleapis.com/`). - Do NOT use `stage1/tools/publish.sh` or the release `stage0-snippet.json` -- both emit a - `_stage1` doc stage0 rejects (no `payload` wrapper, https). Use `lockboot-deploy`, which - enforces http:// and the `payload`/`manifest` schema, and merges both arches into one doc: - ```bash - D=stage1/target/x86_64-unknown-linux-musl/debug/lockboot-deploy - for a in x86_64 aarch64; do - $D create --arch $a --uki stage1/tools/build-uki/$a/linux.efi \ - --stage2 stage2/build/$a/pack/stage2 --base-url http:/// --out deploy/ - done - $D validate deploy/user-data.json # both hops, both arches - # upload deploy//* so URLs are // - ``` - One `deploy/user-data.json` serves all four cells (stage0/stage1 pick their arch's entry). -3. Record every created resource: pass `--manifest teardown.txt` to both `create.sh`; at day's - end `stage0/tools/publish/cleanup.sh --dry-run teardown.txt` then without `--dry-run`. - -### 1. Cells - -| Cell | Machine | Security config to launch with | +| Repo | PR | Branch | |---|---|---| -| EC2 x86_64 | `c6i.large` | AMI: UEFI + NitroTPM v2 + IMDSv2 + our `--uefi-data` (set by `create.sh`) | -| EC2 aarch64 | `c7g.medium` | same | -| GCP x86_64 | `n2d-standard-2` | `--confidential-compute-type=SEV_SNP --min-cpu-platform="AMD Milan" --maintenance-policy=TERMINATE` + shielded secure boot/vTPM/integrity | -| GCP aarch64 | `t2a-standard-1` | Shielded VM (secure boot, vTPM, integrity) -- confidential type per experiment G2 | - -**Script blockers to fix (or bypass with a manual command) before the cell runs:** -- EC2 (both): NOT a blocker for pivot. `boot.disk` is 66 MiB (64 MiB ESP + GPT); EBS sizes in - whole GiB, so the AMI's root volume is 1 GiB, leaving ~900 MiB beyond the image for p2 + `/data` - -- well past pivot-init's 64 MiB base check. Gap for real deployments (and any cloud grow test): - `ec2/launch.sh` has no root-volume size option and no arg passthrough - (`--block-device-mappings` needs a launch.sh option or a manual `aws ec2 run-instances`). -- GCP x86_64: FIXED (stage0 faa8604) -- n2d now `SEV_SNP` + `--min-cpu-platform="AMD Milan"`, - `--no-service-account --no-scopes`. -- GCP aarch64: FIXED (stage0 faa8604) -- t2a is Shielded VM only; G2 passes - `--confidential-compute-type=CCA` as a trailing option. -- Also fixed in faa8604: GCP image name now includes `BUILD_ID` (no stale reuse); `--manifest` - records only resources the run created; instances recorded (`ec2/launch.sh --manifest`, - `gcp/launch-instance.sh --manifest` FIRST arg) + `cleanup.sh` deletes them (GCP instances do - not self-delete); `ec2/launch.sh --tail-timeout`; `get-console.sh --follow` byte offsets. -- Pre-existing GCP image `lockboot-x86-64-26-02-fc41` (2026-02-09, old build) -- not ours to - sweep automatically; delete by hand if unwanted. -- GCP (both): `--boot-disk-size` can be added via `launch-instance.sh`'s trailing passthrough args. - -### 2. Per-cell checks (columns of the results table) - -- **A. Publish:** `create.sh ` succeeds; record AMI / image ID. -- **B. Launch config actually applied:** EC2 `aws ec2 describe-images` (BootMode, TpmSupport, - ImdsSupport) / GCP `gcloud compute instances describe` (`confidentialInstanceConfig`, - `shieldedInstanceConfig`, `serviceAccounts`). -- **C. Console capture** (grep the retrieved console; mirrors `CONSOLE-OUTPUT.md` step 5): - C1 `stage0:` lines (UEFI ConOut); C2 kernel `Linux version` + `console [...] enabled`; - C3 `init:` lines; C4 `stage1:` lines; C5 stage2 loader lines; C6 `PIVOT_TEST=`. -- **D. Admission:** stage0 admitted the UKI; stage1 admitted stage2 (log lines). -- **E. Reboot stability:** `PIVOT_TEST=PASS` -- boot 2 re-derived the same `/data` key (bound PCRs - stable across reboot on this platform -- the Nitro/GCP PCR5 caveat in `stage2/PCR-BINDING.md`) - and the overlay root was ephemeral. If it FAILs with "sentinel missing", the derived key moved: - capture which PCRs differ (no probe for this exists any more -- reboot-probe was deleted in - stage2 9167e6e; compare the two boots' attestation docs, or add a probe). On GCE TDX expect one - FAIL on the first reboot: the GPT lands in PCR2, which the data key binds (Open items). -- **F. Attestation:** pivot-init `[attest] stage1=... stage2=present`. -- **G. Confidential compute evidence** (GCP x86_64): kernel line like `Memory Encryption Features - active: AMD SEV SEV-ES SEV-SNP` (proves SNP, not just SEV). - -### 3. Experiments (resolve open `[?]` items) - -- **G1. `serial-port-enable`** (GCP x86_64, cheap): one boot WITHOUT it, one WITH; compare - `get-serial-port-output`. Decides whether it stays (user observation: needed for output; docs: - interactive access only). -- **G2. Arm confidential compute** (GCP aarch64): try `--confidential-compute-type=CCA` on - `t2a-standard-1`, and on `c4a-standard-1` if available in the zone; record the exact error / - success. Then the Shielded-VM-only launch for the actual cell. -- **G3. No service account** (GCP, either arch): launch with `--no-service-account --no-scopes`, - confirm the chain is unaffected (nothing in stage0/1/2 should call GCP APIs). -- **G4. PCR7 per platform:** note PCR7 from each cell's attestation (GCP gets Microsoft's dbx, see - below) -- input to "publish expected PCRs per release". - -### 4. Results - -| Cell | A publish | B config | C1 stage0 | C2 kernel | C3 init | C4 stage1 | C5 loader | C6/E pivot | F attest | G | Notes | -|---|---|---|---|---|---|---|---|---|---|---|---| -| EC2 x86_64 | | | | | | | | | | n/a | | -| EC2 aarch64 | | | | | | | | | | n/a | | -| GCP x86_64 | ok | ok | ok | ok | ok | ok | ok | SNP PASS; TDX PASS after one reinit | ok | SNP, TDX | 2026-11-09/10: SEV, SEV-SNP, TDX full chains; E: lb-rb-snp, lb-rb-tdx | -| GCP aarch64 | | | | | | | | | | | | - -Experiments: G1 = ; G2 = ; G3 = ; G4 = . - -Afterwards: copy the C-columns into `CONSOLE-OUTPUT.md`'s matrix. Its "Local QEMU aarch64" row -predates the PL011 capture fix in stage0#12 -- UEFI ConOut is now captured locally on aarch64 too. - -## Deployment posture review (AWS + GCP) - -### Breaks a deployment - -- [x] **stage1 `_stage1` snippet is rejected by stage0.** DROPPED (stage1 46d2bd0). (Was: build.sh:317-320. - Added in stage1 e3c8f57, 2026-06-21, "stage0 netboot rework", as a fill-in template next to - `linux.efi`; CI uploads it (build.yml:54). Superseded by `lockboot-deploy create`. Decide: - drop it, or fix it.) `stage1/tools/build-uki/build.sh:306-309` - (writes `stage0-snippet.json`, a release-zip asset) and `stage1/tools/publish.sh:88-94` emit - `"": { "url", "sha256" }` with `https://`. stage0 requires `{ "payload": { ... } }` - (`stage0/crates/stage0/src/config.rs:80-84`) and http:// only (`config.rs:160-164`). - Verified against stage0 source. -- [x] **GCP aarch64 passes the wrong confidential-compute flag.** FIXED (stage0 faa8604: t2a is - Shielded only; CCA only as an explicit trailing option). `gcp/launch-instance.sh:154-170` - uses `--confidential-compute` for `t2a-*` (comment: "ARM TrustZone"). VERIFIED (gcloud - `compute instances create` reference): `--confidential-compute` is DEPRECATED and means - `--confidential-compute-type=SEV` -- AMD-only, cannot apply to Arm. The type enum DOES include - `CCA` ("Arm Confidential Compute Architecture"), but no public doc names a machine series for - it (supported-configurations and the CVM overview list only AMD/Intel series; the Arm-on- - Compute page says nothing about confidential or shielded VMs). Unresolved: whether any Arm - series (T2A, C4A, N4A) accepts `CCA` -> settle with a real launch attempt in the cloud check. - Hardware note (unverified): CCA needs Armv9 RME; T2A is Neoverse N1 (Armv8.2). -- [x] **GCP x86_64 gets SEV, not SEV-SNP.** FIXED (stage0 faa8604: n2d -> SEV_SNP + AMD Milan, c2d - -> SEV, c3 -> TDX). `launch-instance.sh:126-127` passes - `--confidential-compute-type=SEV` for n2d/c2d; README + image `SEV_SNP_CAPABLE` claim SNP. - VERIFIED (Create a Confidential VM instance doc): SNP = `--confidential-compute-type=SEV_SNP` - + N2D + `--min-cpu-platform="AMD Milan"` + `--maintenance-policy=TERMINATE`. SEV = C2D, N2D, - C3D, C4D. SNP is N2D-only (supported-configurations). TDX = c3-standard, c4-standard, - a3-highgpu-1g. Decide: SNP-only on N2D, or SEV/SNP/TDX by machine type. -- [x] **GCP image reuse keyed on `VERSION_ID`, not `BUILD_ID`.** FIXED (stage0 faa8604: the image - name includes `BUILD_ID`). `gcp/create.sh:157`: a local - rebuild (new keys, new BUILD_ID, same VERSION_ID) silently returns the old image. README - claims BUILD_ID matching (true for EC2 only). Verified against the script. - -### Security posture - -- [x] **Dedicated AWS deploy role; stop using root.** DONE (workspace 91902d6): IAM user `lockboot` - (passkey MFA) -> role `lockboot-deploy`, converged by `tools/deploy/aws-iam.sh`; verified - except launches (account still blocked). (2026-11-05: root `aws login` from a VPN - egress tripped AWS fraud detection and the account was restricted -> support case.) Shape: - an IAM user (console sign-in + passkey MFA, `SignInLocalDevelopmentAccess`, nothing else) - that may only `sts:AssumeRole` into a `lockboot-deploy` role, conditioned on - `aws:MultiFactorAuthPresent`. The role carries least privilege, scoped by - `aws:RequestedRegion` = ap-southeast-1: - ec2 Describe*/RegisterImage/DeregisterImage/ModifyImageAttribute/CreateTags/ - Delete+ModifySnapshotAttribute/RunInstances/TerminateInstances/GetConsoleOutput (+ the - `iam:PassRole`-free defaults; no instance profile is attached), `ebs:StartSnapshot`/ - `PutSnapshotBlock`/`CompleteSnapshot` (coldsnap), `s3:PutObject`/`PutObjectAcl`/ - `DeleteObject`/`ListBucket` on `lockboot-ap-southeast-1` `test/*` (+ the release prefix). - `entry.sh` then writes `[profile deploy] role_arn=... source_profile=login` and points - `default`'s `credential_process` at it. Decide: IAM user + role (above) vs IAM Identity - Center permission set (`aws configure sso`; also passkey, but its token cache lives in the - tmpfs $HOME and needs re-login per shell -- same as now). -- [x] **GCP instances get the project's default service account.** FIXED (stage0 faa8604: - `--no-service-account --no-scopes`). `launch-instance.sh` passes no - `--service-account` / `--no-service-account --no-scopes`. VERIFIED (gcloud reference + service - accounts doc): without them the VM gets the Compute Engine default SA - (`PROJECT_NUMBER-compute@developer.gserviceaccount.com`) with scopes devstorage.read_only, - logging.write, monitoring.write, service.management.readonly, servicecontrol, trace.append; - that SA "might automatically be granted" project Editor (org-policy dependent; blocked by - default for orgs created after 2024-05-03). The attested workload can mint tokens for it from - the metadata server. Fix: `--no-service-account --no-scopes` (both flags exist). Confirm - nothing in stage0/1/2 needs GCP API access first. -- [?] **GCP `serial-port-enable=true`: KEEP, still unresolved.** (2026-11-10: every probe set it, - so G1 is still unrun. Fast-power-off guests additionally use `serial-port-logging-enable=true`, - read back from Cloud Logging -- AGENTS.md "Cloud test runs".) User observation: without it - nothing was captured. Docs (VERIFIED, interactive serial console page): it controls - INTERACTIVE serial console access, "disabled by default"; when on, "clients can attempt to - connect ... from any IP address" with a project/instance SSH key + `iam.serviceAccountUser`. - The serial-output page never mentions it (output logging to Cloud Logging is a separate key, - `serial-port-logging-enable`). Docs do not say whether it affects output -- they don't - contradict the observation. Settle in the cloud check: one boot with, one without, compare - `get-serial-port-output`. If it must stay on, the residual risk is console INPUT reaching - firmware/kernel (e.g. UEFI ConIn) for anyone with those credentials. -- [ ] **Release verification lacks signer pinning.** DECIDED (2026-11-10): `--source-ref - refs/tags/$VERSION` + `gh release verify-asset` (neither depends on the workflow file's - location; the tag ruleset makes the ref meaningful). Not `--signer-workflow`. Testable only - against a tagged, immutable release. ec2/create.sh, gcp/create.sh, - stage1/tools/publish.sh run `gh attestation verify --repo` only. Add `--signer-workflow`, - `--source-ref refs/tags/$VERSION`; consider `gh release verify-asset`. `GH_REPO` comes from - `git remote get-url origin` (a fork verifies against the fork). -- [ ] **`source os-release` executes the downloaded file as shell.** (Still true 2026-11-10: - gcp/create.sh:165; line numbers below are old.) ec2/create.sh:151, - gcp/create.sh:153; unverified code under `--no-verify`. Parse keys instead. -- [x] **EC2 `--no-secure-boot` debug AMI is public by default** (`PUBLIC=true`). BY DESIGN (user, - 2026-11-10): ec2/create.sh is public by default; `--private` opts out. - -### Release distribution & lifecycle (decisions, not fixes) - -- [ ] Publish per-release cloud image IDs + owner account / project (release notes stay - editable). Expected PCRs: DONE via the replay files each release ships - (stage0/stage1/stage2 `*.replay.json`) + workspace golden platform files. -- [ ] stage1/tools/publish.sh uploads to a fixed `linux-.efi`: republishing breaks instances - pinned to the old sha256 (fail closed). Content-address or version the object; bucket must - be publicly readable over plain HTTP (not set or checked). -- [ ] Single-region publish; no image deprecation/deregistration step - (`aws ec2 enable-image-deprecation`, `gcloud compute images deprecate`). - -- [x] **GCP dbx is Microsoft's, not ours -> PCR7 differs per platform.** RESOLVED: we pass our own - dbx (`dbx.auth.bin`, `--forbidden-database-file`); see "dbx on GCP" above. VERIFIED (Creating - shielded images doc): custom certs "overwrite the default ones rather than merging"; for any - field left unset (we set PK/KEK/db, not dbx) GCP supplies its default -- for dbx the - Microsoft DBX revocation list. Harmless to admission, but PCR7 (which measures dbx) will not - match EC2/local (our placeholder dbx). Publish expected PCR7 per platform, or pass our own - dbx via `--forbidden-database-file`. Format: DER X.509 (our `.cer` files are DER). - -### Verified good (keep) - -- EC2 AMI: UEFI, NitroTPM v2, IMDSv2-only, our `--uefi-data`; launches attach no instance profile. -- GCP: `--maintenance-policy=TERMINATE` (required for SNP per the CVM create doc), Shielded - Secure Boot + vTPM + integrity monitoring. -- Both clouds: our own PK/KEK/db enrolled (GCP: replaces Google/Microsoft defaults, verified). -- gVNIC on GCP Arm: T2A supports only NVMe + gVNIC (VERIFIED, Arm-on-Compute page); the script - already sets `nic-type=GVNIC` and the image `GVNIC`. - -### Docs consulted (GCP) - -- gcloud `compute instances create` reference (flags: confidential-compute[-type], service - account/scopes, min-cpu-platform) -- Confidential VM: supported configurations; create a Confidential VM instance; overview -- Compute Engine: viewing serial port output; interactive serial console; Arm VMs; service - accounts; Shielded VM; creating shielded images (custom keys) - -### Not yet reviewed - -- `stage0/tools/publish/cleanup.sh`, `gcp/get-console.sh`, `gcp/install-gcloud.sh`. +| stage0 | lockboot/stage0#14 | `gpt-digest` | +| stage1 | lockboot/stage1#22 | `gpt-digest` | +| stage2 | lockboot/stage2#5 | `grow-then-reboot` | +| workspace | lockboot/workspace#6 | `pcr-replay-gpt-digest` | + +vaportpm v0.4.1 is released; stage1 and stage2 pin it. All four PRs are draft with CI green. + +In order: + +- [x] **stage1 kernel bump** to Fedora CoreOS stable 44.20261023.3.1: kernel 7.2.11-200.fc44 + (from 7.0.12-201), systemd-boot stub 259.10-1.fc44 (from 259.6-1). Kernel 7.2 has no + `hkdf` module (nvme-auth no longer needs it), so `init` and `build.sh` drop it. `build.sh` + extracts exactly the RPMs `fedora-deps.mk` pins, and `update-fedora-deps` removes the + previous ones: before, a bump without a clean silently rebuilt the old kernel. + Working tree, uncommitted. +- [x] **Local `make selftest`, both arches** (2026-11-18): ALL PASS on the working trees, with + 7.2.11 confirmed in the boot logs. UKI sha256: x86_64 `e0bc2bbc860aa046`, aarch64 + `8c09afca2f37aebd`. +- [ ] **GCP re-test on the final heads:** reboot test on n2d SEV-SNP and c3 TDX (last pass: + cloudtest `cd177e5753e6`, before the vaportpm v0.4.1 repin and the kernel bump), full chain + replayed by `pcr-replay`. +- [ ] **Release tooling fixes** (working trees, uncommitted): `stage0/tools/publish/{ec2,gcp}/ + create.sh` verify with `--source-ref refs/tags/$VERSION` and `gh release verify-asset`, and + read `os-release` as data instead of sourcing it; `stage1/tools/publish.sh` deleted + (`lockboot-deploy create` replaces it); stage1 `release-docker` gains + `docker/setup-qemu-action`. Tested: the two `gh` checks against vaportpm v0.4.1, the + `os-release` parser on good, hostile and incomplete input. NOT tested: `create.sh`'s release + path end to end and the docker job, which need a stage0 release and a stage1 tag. +- [ ] Merge the four PRs together. +- [ ] **Tag stage0, stage1, stage2** (`RELEASING.md`). These are the first tags in those repos, so + confirm: the draft-then-publish release (proven only on vaportpm), the attestation subject + names (`gh attestation verify --format json`), the release-notes edits made by later jobs, + the first ghcr package push (org package-creation policy unknown), stage1's multi-arch + `release-docker` build, and `create.sh ` against the new stage0 release. + +## Open + +Which of these block the release is undecided. + +Release tooling: + +- [ ] Publish per-release cloud image IDs and the owner account / project (release notes stay + editable under immutability). +- [ ] Single-region publish; no image deprecation / deregistration step + (`gcloud compute images deprecate`, `aws ec2 enable-image-deprecation`). +- [ ] stage1's pre-split releases `v0.1.0` / `v0.2.0` ship an aarch64 varstore trusting Debian's + public SnakeOil KEK + db. The user archives them in due time; check whether any AMI / GCP + image was published from them. +- [ ] Not yet reviewed: `stage0/tools/publish/cleanup.sh`, `gcp/get-console.sh`, + `gcp/install-gcloud.sh`. + +GCP: + +- [ ] **Firmware on a grown volume (untested).** After a PD resize the backup GPT is no longer at + the disk's end. Expect the firmware to measure the primary unchanged; if it repairs or + relocates the backup header, PCR5 / PCR2 move without stage2 writing anything. Test: stop, + grow the PD, start; confirm the GPT digest is unchanged before stage2 acts, then the grow + + reboot + reinit. +- [?] **`serial-port-enable=true`**: every run sets it, so whether output needs it is still + untested (one boot with, one without, compare `get-serial-port-output`). Docs: it controls + interactive access, off by default; if it must stay on, console input reaches the firmware + and kernel for anyone with the project's credentials. +- [ ] Stale image `lockboot-x86-64-26-02-fc41` (2026-02-09) in project `lockboot`: delete by hand. + +Docs and build: + +- [ ] `CONSOLE-OUTPUT.md` matrix is out of date: local aarch64 UEFI ConOut is captured now + (`stage0/build/aarch64/boot-*.log` carry the `stage0:` lines), and GCP x86_64 captured all + three paths (2026-11-09/10). The EC2 rows wait on AWS (below). +- [ ] `REPRODUCIBLE-BUILDS.md` says nothing about the varstores. +- [ ] No Makefile target for the verbose gvnic build: `STAGE0_FEATURES=verbose` enables stage0's + own feature, which does not forward to the `gvnic` crate's. +- [ ] `pcr-replay` cannot reproduce PCR14 in stage1's attestation: stage1 quotes before it extends + PCR14 with stage2 (stage2 is bound through the nonce). + +## Blocked on AWS + +- [ ] **EC2 cells** (`c6i.large`, `c7g.medium`): platform replay files + (`tools/pcr-replay/EC2-NOTES.md`); recreate the AMI (`ami-04abef7162f90706e` predates the + PCR7 owner-GUID fix; expected PCR7 `ee5f65dc`, as on GCP); the full chain and the reboot + test on both arches. Per cell: image attributes applied (BootMode, TpmSupport, ImdsSupport), + console lines from every stage, admission at both hops, `PIVOT_TEST=PASS` across a reboot, + `[attest] stage1=... stage2=present`. +- [ ] **Console capture on EC2 aarch64** (`CONSOLE-OUTPUT.md`): whether stage0's UEFI ConOut + reaches the captured serial there is the open question; x86_64 is a confirmation pass. +- [ ] **Nitro PCR5.** NitroTPM's profile defines PCR5 as "Boot Manager Code Configuration and + Data and GPT". The data key binds PCR5, so capture an EC2 event log and confirm what else + lands there. +- [ ] **ENA ExitBootServices quiesce.** `ena.efi` never resets the device at ExitBootServices, so + RX DMA stays posted into boot-services memory the OS reuses until Linux's driver resets it + at probe. gvnic does the full teardown from an EBS event; port the same to ena. +- [ ] ENA logging / `[S.mmm]` timestamps. +- [ ] `ec2/launch.sh` has no root-volume size option and no argument passthrough (needed for any + grow test; the AMI's root volume is 1 GiB). +- [ ] The `lockboot-deploy` IAM role (`tools/deploy/aws-iam.sh`) is verified except for launches. + +## Deferred + +- [ ] **GCP Arm (t2a):** the firmware has no network stack above SNP (no MNP / IP4 / DHCP4 / + TCP4); stage0 would have to embed one. No t2a PCRs until then. Also unrun: whether any Arm + series accepts `--confidential-compute-type=CCA`. +- [ ] **`init_on_free=1` kills the TD on GCE TDX** (silent reset; dropped, `init_on_alloc=1` + kept). Root cause unknown. A triple fault and a TD kill look the same from inside; a #DF + handler that dumps state first would tell them apart. +- [ ] gVNIC DQO: offered on c3 next to GQI_QPL and not needed. Revisit only if a series stops + offering GQI_QPL. +- [ ] vaportpm-zk's `Cargo.lock` pins vaportpm 0.1.0 (785438f) though its manifest follows + `branch = "main"`; re-lock and re-run its tests when it is next touched. +- [ ] After the release: a TDX quote / SNP report as supplementary attestation (like Nitro's NSM + document), binding the vTPM attestation to hardware evidence. + +## Notes not recorded elsewhere + +- Do not run any `make -C stage0` target that depends on the keys (`build-*`, `boot-*`, + `smoke-boot-*`, `selftest-*`) while a cloud image built from the current keys is in use: it + re-mints PK / KEK / db, re-signs `BOOT*.EFI` and rewrites the varstores. + `HAZMAT_WARNING_NO_REGEN_KEYS_DEV_ONLY=1` reuses `build/keys` for dev loops only. +- GCP project `lockboot`: the org policy `iam.allowedPolicyMemberDomains` is overridden on this + project only, so `gs://lockboot-test` can be a public-read payload mirror. Buckets `lockboot` + and `lockboot-test` are kept empty between runs. +- Stopping the host `docker exec` does not stop the in-container process: run console followers + under an in-container `timeout`. +- `lockboot-deploy create --args` applies to `_stage2` only. `_stage1.args` would become the UKI's + LoadOptions, which it ignores under Secure Boot, so this is left as is. From 7ec14450459ab4d3028840dd8565d73f855c600e Mon Sep 17 00:00:00 2001 From: HaRoLd <303926+HarryR@users.noreply.github.com> Date: Wed, 18 Nov 2026 09:23:02 +0000 Subject: [PATCH 09/13] tools/cloudtest: the release gate on GCP; tracker records the 2026-11-18 run - gcp-setup.sh (snapshot the replay inputs, bundle, upload, stage0 image), gcp-run.sh (one capped spot VM, console read back from Cloud Logging), gcp-delete.sh, and test-{sev,snp,tdx}.sh wrapping run + delete + check for one configuration. - check-run.py: per payload boot, vaportpm-verify accepts stage1's attestation, its nonce is sha256(stage2), the quoted PCRs replay against the golden platform file with the attested GPT digest, and the final PCRs replay with stage2's file (unsigned; PCR14/15). An unreproduced PCR fails the gate unless expected (PCR10; PCR14 in the quoted replay). - WIP-RELEASE-TODO.md: scope is GCP Confidential VMs; SEV, SEV-SNP and TDX pass the gate (cloudtest be236c1f6330). test-snp.sh is unrun: SEV-SNP went through the same three steps by hand. Co-Authored-By: Claude --- WIP-RELEASE-TODO.md | 14 +- tools/cloudtest/README.md | 78 +++++++ .../__pycache__/check-run.cpython-313.pyc | Bin 0 -> 12613 bytes tools/cloudtest/check-run.py | 194 ++++++++++++++++++ tools/cloudtest/gcp-delete.sh | 9 + tools/cloudtest/gcp-run.sh | 58 ++++++ tools/cloudtest/gcp-setup.sh | 68 ++++++ tools/cloudtest/test-sev.sh | 10 + tools/cloudtest/test-snp.sh | 10 + tools/cloudtest/test-tdx.sh | 10 + 10 files changed, 447 insertions(+), 4 deletions(-) create mode 100644 tools/cloudtest/README.md create mode 100644 tools/cloudtest/__pycache__/check-run.cpython-313.pyc create mode 100755 tools/cloudtest/check-run.py create mode 100755 tools/cloudtest/gcp-delete.sh create mode 100755 tools/cloudtest/gcp-run.sh create mode 100755 tools/cloudtest/gcp-setup.sh create mode 100755 tools/cloudtest/test-sev.sh create mode 100755 tools/cloudtest/test-snp.sh create mode 100755 tools/cloudtest/test-tdx.sh diff --git a/WIP-RELEASE-TODO.md b/WIP-RELEASE-TODO.md index 950f892..a0de7fe 100644 --- a/WIP-RELEASE-TODO.md +++ b/WIP-RELEASE-TODO.md @@ -5,7 +5,7 @@ has them. Every cloud-platform claim cites the doc or the observed behaviour it ## This release: GCP x86_64 -Scope: n2d Shielded / SEV / SEV-SNP and c3 Shielded / TDX. EC2 and GCP Arm are out of scope +Scope: GCP Confidential VMs: n2d SEV / SEV-SNP and c3 TDX. EC2 and GCP Arm are out of scope (blocked, below) and do not hold the release. | Repo | PR | Branch | @@ -28,9 +28,15 @@ In order: - [x] **Local `make selftest`, both arches** (2026-11-18): ALL PASS on the working trees, with 7.2.11 confirmed in the boot logs. UKI sha256: x86_64 `e0bc2bbc860aa046`, aarch64 `8c09afca2f37aebd`. -- [ ] **GCP re-test on the final heads:** reboot test on n2d SEV-SNP and c3 TDX (last pass: - cloudtest `cd177e5753e6`, before the vaportpm v0.4.1 repin and the kernel bump), full chain - replayed by `pcr-replay`. +- [x] **GCP gate on the final heads** (2026-11-18, cloudtest `be236c1f6330`, + `tools/cloudtest/`): n2d SEV, n2d SEV-SNP and c3 TDX each GATE PASS. Per VM, on both payload + boots: stage1's attestation verifies (vaportpm-verify v0.4.1), its nonce is sha256(stage2), + the quoted PCRs replay against the golden platform file with the attested GPT digest, the + final PCRs replay with stage2's file (unsigned; covers PCR14 / PCR15), and `/data` survives + the reboot after the provisioning reboot. stage0 `stage0-45bb278f8fed` (stage0#14 head), + UKI `e0bc2bbc860aa046` (= CI's build of stage1#22's head), stage2#5 head plus the + pivot-init evidence printout. Shielded (non-confidential) VMs are not tested: no AK + certificate, so the chain stops at stage1. - [ ] **Release tooling fixes** (working trees, uncommitted): `stage0/tools/publish/{ec2,gcp}/ create.sh` verify with `--source-ref refs/tags/$VERSION` and `gh release verify-asset`, and read `os-release` as data instead of sourcing it; `stage1/tools/publish.sh` deleted diff --git a/tools/cloudtest/README.md b/tools/cloudtest/README.md new file mode 100644 index 0000000..0311323 --- /dev/null +++ b/tools/cloudtest/README.md @@ -0,0 +1,78 @@ +# cloudtest + +The release gate on real hardware: boot the whole chain on a cloud VM, capture its console, and +check that an attestation from that boot verifies and that every PCR is reproduced from the +platform's golden file and the release's replay files. + +Rules for launching anything are in the workspace `AGENTS.md`, "Cloud test runs": one VM at a +time, each with the user's go-ahead, spot with a 3 minute cap, deleted as soon as it stops. + +## A run + +A run lives in `cloudtest//` (gitignored); `cloudtest/CURRENT` names the current one. + +``` +make deploy-shell-gcp # the user opens this and signs in +make -C stage0 build-x86_64 +make -C stage1 build-x86_64 deploy-bin +make -C stage2 pack-x86_64 INIT_PAYLOAD=pivot-init +make -C vaportpm release-x86 # vaportpm-verify for the check + +tools/cloudtest/gcp-setup.sh # bundle + upload + stage0 image +tools/cloudtest/test-snp.sh # one VM each: launch, delete, check +tools/cloudtest/test-sev.sh +tools/cloudtest/test-tdx.sh + +make deploy-exec CMD='stage0/tools/publish/cleanup.sh cloudtest//teardown.txt' # at the end +``` + +No stage0 make target between `gcp-setup.sh` and the end of the run: it would re-mint the Secure +Boot keys the image was built from. `gcp-setup.sh` snapshots what the replay needs into the +run's `replay/`, so a check can be repeated later. + +## The confidential configurations + +Only Confidential VMs run the full chain: stage1 attests before it runs stage2, and GCE issues +AK certificates only to Confidential VMs. + +| Script | Machine | Platform file (`tools/pcr-replay/platforms/gcp/`) | +|---|---|---| +| `test-sev.sh` | n2d-standard-2, SEV | `gcp-n2d-standard-2-sev.replay.json` | +| `test-snp.sh` | n2d-standard-2, SEV-SNP (AMD Milan) | `gcp-n2d-standard-2-sev-snp.replay.json` | +| `test-tdx.sh` | c3-standard-4, TDX | `gcp-c3-standard-4-tdx.replay.json` | + +## What one VM shows + +The bundle's payload is stage2's `pivot-init` test `/init`. A VM boots three times: + +1. stage2 finds free space, rewrites the GPT and reboots before deriving any key. +2. The payload runs for the first time: writes a sentinel to `/data`, reboots. +3. The payload finds the sentinel: `PIVOT_TEST=PASS`, power off. + +On boots 2 and 3 the payload prints stage1's attestation, the config digest and every PCR. +`check-run.py` then checks, per boot: the attestation verifies (`vaportpm-verify`), its nonce is +the sha256 of the published stage2, the quoted PCRs replay from the golden platform file and the +stage0 / stage1 replay files with the GPT digest the attestation carries, and the PCRs the +payload read back replay with stage2's file too. + +Limits, stated by the tool on every run: + +- stage1 quotes before it measures stage2, so the attested replay does not cover PCR14 after + stage2, or PCR15. Those are checked from the PCR values the payload read from the TPM, which + are not signed (stage2 produces no quote yet). +- PCR10 (IMA) is never reproduced. +- The platform's ACPI table measurements in PCR1 are pinned in the golden file, not re-derived. + +The kernel logs to the same console and sometimes cuts into a line the payload is printing. +`check-run.py` takes such a message out and rejoins the line; a wrongly repaired attestation +fails its signature check. + +## Files + +| File | | +|---|---| +| `gcp-setup.sh` | New run: snapshot, bundle, upload, stage0 image. | +| `test-{sev,snp,tdx}.sh` | The gate for one configuration: `gcp-run.sh`, `gcp-delete.sh`, `check-run.py`. | +| `gcp-run.sh` | One VM: create, follow, read the console back from Cloud Logging, summarize boots. | +| `gcp-delete.sh` | Delete one VM. | +| `check-run.py` | The checks above, from the captured console. Exit 0 only if all pass. | diff --git a/tools/cloudtest/__pycache__/check-run.cpython-313.pyc b/tools/cloudtest/__pycache__/check-run.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a1a9028f5eba391789883e6f5068e8552df8eea9 GIT binary patch literal 12613 zcmcgydr%z5nV;GB`@!-C!SH4g%R{^bGLn{;0E^cS1F}I{54!`bg=W$0BBYJ)jPL#k zICsa&=S1sV>avPe(Ylf<<5a4QD_0kCNnJ=)QknHCfs84a>dv_;{ij&2+@&scxvyuL zU8F-OuevGd?&IIrX%{Wl4>lD!6Q^Vyf`}NST$I zG*y_^x8TW_r{$dCDI6B021ymB4Wx{elZqBavWhc7-=b7=s^BU~6;lOLDRIz=SMS$) z2@E5!KWKgxsU|g~mejSVl7nzoQqN_O2F^wrxlGcOk8xR~c{;mUMq2W*mla&jbS`P_ zxPW1FE{093T_;j3r3$6kbWSPOvi~meNnmsM9B$8efa-?@Wzg?m2!wQt9?roriwpFP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FETW=F8f*tckKNY3(`FKQ~;wZ_9g6 znJ8%emNM2DaYlks=UdBP9(+$3F97&xTkYO8XRN&%ZHaZi{oL*`BAWHqi(z@V_oi;o zU-bSR@Z)pa?TORl zpan0^#dGJ87Q8HK!DXZc7VBeMe&3w2ej_}y?qBmqn5ZjZs@^fx#!a=c3maU*)UnyL z*~OdAtjhPSwp)2`(;dLz^H?_x&_52y{ujIIX79@cy=kWUq)oSIAt|UAe z#cxi>6(wK})TXfYuRn(trjMM9wDaZTyotJ}nLxIt`s=crvoTd%SAS2@@UbOhwUJlk zMQ}*|>$8h8EVJklh67Hd5w3-AKEFM-4Tv?$7mV##TpwCo{|zbwM8ExX7{{!m_-{Vd zV1;b~bf@}Bv$KUMl>Op#*{ohARHz{RD9*+pvNC5@uKW+V63T+c?M7D{ zx7(i2y##%^>nOR5k`PK5l%RWY@)9aum}lV?93wssU4aEPJrfY`gHI$%RtavLGuULpFG_>0-DB#{6d5p{@B(4A;GY$7bH0duQ(5g?ARR%iG!o<%MnGc~ppL-Wp`@h^Bfv*4n literal 0 HcmV?d00001 diff --git a/tools/cloudtest/check-run.py b/tools/cloudtest/check-run.py new file mode 100755 index 0000000..b27e9de --- /dev/null +++ b/tools/cloudtest/check-run.py @@ -0,0 +1,194 @@ +#!/usr/bin/env python3 +# check-run: the release gate for one cloud test VM, from its captured console. +# +# The pivot-init test payload prints, on every boot it reaches, stage1's attestation, the config +# digest and every PCR. For each such boot this checks: +# 1. attestation vaportpm-verify accepts stage1's attestation (quote signature, AK certificate +# chain to the provider's root). +# 2. nonce it is the sha256 of the stage2 binary this run published. +# 3. replay pcr-replay reproduces the QUOTED PCRs from the platform's golden file plus +# stage0's and stage1's replay files, with the GPT digest the attestation carries. +# stage1 quotes before it measures stage2, so PCR14 is not reproduced here. +# 4. final PCRs pcr-replay reproduces the PCRs the payload read from the TPM, with stage2's +# replay file, the stage2 binary and the config digest. These values are NOT +# signed: stage2 produces no quote yet. This is what covers PCR14 and PCR15. +# and for the VM as a whole: +# 5. reboot the last boot reports PIVOT_TEST=PASS (/data survived the reboot). +# A PCR that pcr-replay does not reproduce is a failure unless it is expected: PCR10 (IMA) always, +# PCR14 in step 3. +# +# usage: tools/cloudtest/check-run.py [--run ID] [--arch ARCH] +# check-run.py lb-snp tools/pcr-replay/platforms/gcp/gcp-n2d-standard-2-sev-snp.replay.json +# Reads cloudtest//.console.log (gcp-run.sh) and the run's replay/ and chain/ +# snapshots (gcp-setup.sh); writes .boot.{attest,verified,pcrs}.json next to it. +# vaportpm-verify: $VAPORTPM_VERIFY, else vaportpm's `make release-x86` output. +# Python >= 3.11, standard library only. Exit 0 only if every check passes. +import argparse +import base64 +import hashlib +import json +import os +import re +import subprocess +import sys + +WS = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +REPLAY = os.path.join(WS, "tools", "pcr-replay", "pcr-replay.py") +VERIFY = os.environ.get("VAPORTPM_VERIFY") or os.path.join( + WS, "vaportpm", "target", "x86_64-unknown-linux-musl", "release", "vaportpm-verify") +BOOT_MARK = "BdsDxe: loading" # firmware, once per boot +PAYLOAD_MARK = "=== pivot-init" +IMA_PCR = 10 + + +def replay(files, artifacts, inputs, quote, banks): + """Run pcr-replay; return (verifies, mismatched PCRs, not-reproduced PCRs, taken on trust).""" + cmd = [sys.executable, "-I", REPLAY, *files, "--banks", banks, "--check", quote] + for a in artifacts: + cmd += ["--artifacts", a] + for k, v in inputs.items(): + cmd += ["--input", f"{k}={v}"] + p = subprocess.run(cmd, capture_output=True, text=True) + out = p.stdout + p.stderr + bad = sorted({int(n) for n in re.findall(r"PCR(\d+)\s+MISMATCH", out)}) + gaps = {int(n) for n in re.findall(r"PCR(\d+)\s+not reproduced", out)} + for lst in re.findall(r"in the quote but not reproduced: PCR ([\d,]+)", out): + gaps |= {int(n) for n in lst.split(",")} + trust = re.search(r"events: .*", out) + verifies = p.returncode == 0 and "CHAIN VERIFIES" in out + return verifies, bad, sorted(gaps), (trust.group(0) if trust else out.strip()[-300:]), out + + +def main() -> int: + ap = argparse.ArgumentParser(description="Release-gate checks for one cloud test VM") + ap.add_argument("name", help="VM name, as given to gcp-run.sh") + ap.add_argument("platform", help="the platform's golden replay file") + ap.add_argument("--run", help="run id (default: cloudtest/CURRENT)") + ap.add_argument("--arch", default="x86_64") + ap.add_argument("-v", "--verbose", action="store_true", help="print pcr-replay's output") + a = ap.parse_args() + + run = a.run or open(os.path.join(WS, "cloudtest", "CURRENT")).read().strip() + C = os.path.join(WS, "cloudtest", run) + rp = os.path.join(C, "replay") + uki = os.path.join(C, "chain", a.arch, "linux.efi") + stage2 = os.path.join(C, "chain", a.arch, "stage2") + stage2_sha = hashlib.sha256(open(stage2, "rb").read()).hexdigest() + if not os.path.exists(VERIFY): + print(f"error: no vaportpm-verify at {VERIFY} (make -C vaportpm release-x86, or set " + "VAPORTPM_VERIFY)", file=sys.stderr) + return 2 + + text = open(os.path.join(C, f"{a.name}.console.log"), encoding="latin1").read() + text = re.sub(r"\x1b\[[0-9;=]*[A-Za-z]", "", text.replace("\r", "")) + # The kernel logs to the same console and can cut into a line the payload is printing: + # "[ 12.242112] clocksource: ...\n". Take such a message out + # and rejoin the line. Nothing the payload prints as evidence contains "[", and a wrongly + # repaired attestation fails its signature check. + text = re.sub(r"(?<=[^\n])\[ *\d+\.\d{6}\] [^\n]*\n", "", text) + boots = text.split(BOOT_MARK)[1:] + print(f"{a.name} (run {run}): {len(boots)} boot(s), platform {os.path.basename(a.platform)}") + ok = True + checked = 0 + + for i, b in enumerate(boots, 1): + if PAYLOAD_MARK not in b: + why = "stage2 rewrote the GPT and rebooted" if "GPT rewritten" in b else "NO PAYLOAD" + print(f"boot {i}: {why}") + ok &= "GPT rewritten" in b + continue + checked += 1 + base = os.path.join(C, f"{a.name}.boot{i}") + res: list[tuple[str, bool, str]] = [] + + # 1. attestation + m = re.search(r"===ATTESTATION-BEGIN===\n(.*?)===ATTESTATION-END===", b, re.S) + att = verified = None + if m: + try: + raw = base64.b64decode("".join(m.group(1).split()), validate=True) + att = json.loads(raw) + open(base + ".attest.json", "wb").write(raw) + except ValueError as e: + res.append(("attestation", False, f"garbled on the console: {e}")) + else: + res.append(("attestation", False, "none printed")) + if att is not None: + p = subprocess.run([VERIFY, base + ".attest.json"], capture_output=True, text=True) + if p.returncode == 0: + verified = json.loads(p.stdout) + open(base + ".verified.json", "w").write(p.stdout) + res.append(("attestation", True, f"verified, provider {verified.get('provider')}")) + else: + res.append(("attestation", False, p.stderr.strip()[:200])) + + # 2. nonce + if verified is not None: + n = verified.get("nonce", "").lower() + res.append(("nonce", n == stage2_sha, + f"sha256(stage2) {stage2_sha[:16]}" if n == stage2_sha + else f"{n[:16]} is not sha256(stage2) {stage2_sha[:16]}")) + + # 3. replay of the quoted PCRs + if verified is not None: + v, bad, gaps, trust, out = replay( + [a.platform, f"{rp}/stage0.replay.json", f"{rp}/stage1.replay.json"], + [rp, uki], {}, base + ".verified.json", ",".join(verified["pcrs"])) + want = {IMA_PCR, 14} + good = v and not bad and set(gaps) <= want + res.append(("replay (quoted)", good, + f"mismatch PCR {bad}" if bad else + f"not reproduced PCR {gaps}" + ("" if set(gaps) <= want else " UNEXPECTED"))) + res.append(("", True, trust)) + if a.verbose or not good: + print(out) + + # 4. replay of the PCRs the payload read back + pcrs: dict[str, dict[str, str]] = {} + for bank, n, val in re.findall(r"^PCR (\w+) (\d\d) ([0-9a-f]+)$", b, re.M): + pcrs.setdefault(bank, {})[str(int(n))] = val + cfg = re.search(r"^CONFIG bytes=\d+ sha256=([0-9a-f]{64})$", b, re.M) + banks = [x for x in ("sha256", "sha384") if len(pcrs.get(x, {})) == 24] + if not banks or not cfg or "=== PCR-DUMP-END ===" not in b: + res.append(("final PCRs", False, "PCR dump or CONFIG line missing or cut short")) + else: + doc = {"pcrs": {x: pcrs[x] for x in banks}} + if att is not None and "gpt" in att: + doc["gpt"] = att["gpt"] + open(base + ".pcrs.json", "w").write(json.dumps(doc, indent=2) + "\n") + v, bad, gaps, trust, out = replay( + [a.platform, f"{rp}/stage0.replay.json", f"{rp}/stage1.replay.json", + f"{rp}/stage2.replay.json"], + [rp, uki], {"stage2": "@" + stage2, "config": cfg.group(1)}, + base + ".pcrs.json", ",".join(banks)) + good = v and not bad and set(gaps) <= {IMA_PCR} + res.append((f"final PCRs ({'+'.join(banks)}, unsigned)", good, + f"mismatch PCR {bad}" if bad else + f"not reproduced PCR {gaps}" + ("" if set(gaps) <= {IMA_PCR} else " UNEXPECTED"))) + if a.verbose or not good: + print(out) + + gpt = (att or {}).get("gpt", {}).get("sha256", "")[:16] + reinit = re.search(r"data_reinit=(\w+)", b) + print(f"boot {i}: payload ran, data_reinit={reinit.group(1) if reinit else '?'}, gpt {gpt}") + for what, good, detail in res: + if what: + print(f" {'PASS' if good else 'FAIL'} {what}: {detail}") + ok &= good + else: + print(f" {detail}") + + # 5. reboot + last = boots[-1] if boots else "" + passed = "PIVOT_TEST=PASS" in last + print(f"{'PASS' if passed else 'FAIL'} reboot: " + + ("PIVOT_TEST=PASS on the last boot" if passed else "no PIVOT_TEST=PASS on the last boot")) + ok &= passed and checked >= 2 + if checked < 2: + print(f"FAIL only {checked} boot(s) reached the payload; the test needs two") + print("GATE: " + ("PASS" if ok else "FAIL")) + return 0 if ok else 1 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/tools/cloudtest/gcp-delete.sh b/tools/cloudtest/gcp-delete.sh new file mode 100755 index 0000000..f1dc34b --- /dev/null +++ b/tools/cloudtest/gcp-delete.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# Delete one test VM and list what is still running. Run it as soon as gcp-run.sh reports the +# instance stopped, as its own announced step (AGENTS.md "Cloud test runs"). +# usage: tools/cloudtest/gcp-delete.sh +set -euo pipefail +[ $# -eq 1 ] || { echo "usage: $0 " >&2; exit 2; } +ZONE=${DEPLOY_GCP_ZONE:-asia-southeast1-b} +cd "$(dirname "${BASH_SOURCE[0]}")/../.." +make -s deploy-exec CMD="gcloud compute instances delete $1 --zone=$ZONE --quiet 2>&1 | tail -1; echo \"instances left: \$(gcloud compute instances list --format='value(name)' | tr '\n' ' ')\"" 2>&1 | grep -v '^WARNING' diff --git a/tools/cloudtest/gcp-run.sh b/tools/cloudtest/gcp-run.sh new file mode 100755 index 0000000..f36079e --- /dev/null +++ b/tools/cloudtest/gcp-run.sh @@ -0,0 +1,58 @@ +#!/bin/bash +# One GCP test VM for the current run (cloudtest/CURRENT): spot, capped, serial logging on. +# Creates the VM and follows its console in ONE deploy-exec (GCP serves no serial output once +# the instance stops), then reads the whole console back from Cloud Logging by instance id (a +# guest that powers off quickly outruns the follower) and summarizes each boot. +# +# One VM at a time, and only with the user's go-ahead (AGENTS.md "Cloud test runs"). The VM is +# NOT deleted here: that is its own step, gcp-delete.sh. +# +# usage: tools/cloudtest/gcp-run.sh [extra gcloud flags...] +# gcp-run.sh lb-snp n2d-standard-2 --confidential-compute-type=SEV_SNP '--min-cpu-platform=AMD\ Milan' +# gcp-run.sh lb-sev n2d-standard-2 --confidential-compute-type=SEV +# gcp-run.sh lb-tdx c3-standard-4 --confidential-compute-type=TDX +# Extra flags are evaluated by a shell inside the deploy container: escape spaces as above. +# CAP= sets --max-run-duration (default 3, 5 at most). ARCH defaults to x86_64. +set -euo pipefail +[ $# -ge 2 ] || { sed -n '2,/^set -euo/p' "$0" | grep '^#' >&2; exit 2; } +N=$1 MT=$2; shift 2; EXTRA="$*" +ARCH=${ARCH:-x86_64} +CAP=${CAP:-3} +ZONE=${DEPLOY_GCP_ZONE:-asia-southeast1-b} +PROJECT=${DEPLOY_GCP_PROJECT:-lockboot} +cd "$(dirname "${BASH_SOURCE[0]}")/../.." +C=cloudtest/$(cat cloudtest/CURRENT) +IMG=$(cat "$C/image-$ARCH.txt") +U=$C/chain/user-data.json +dx() { make -s deploy-exec CMD="$1" 2>&1 | grep -v '^WARNING' || true; } + +echo "gcp instance $PROJECT $ZONE/$N" >> "$C/teardown.txt" +echo "launch $N ($MT $EXTRA), cap ${CAP}m, at $(date +%T)" +# The follower runs under an in-container timeout: stopping the host side would not stop it. +timeout $(( CAP * 60 + 20 )) make -s deploy-exec CMD="gcloud compute instances create $N --zone=$ZONE --machine-type=$MT --image=$IMG --network-interface=nic-type=GVNIC --boot-disk-type=pd-balanced --boot-disk-auto-delete --metadata-from-file=user-data=$U --metadata=serial-port-enable=true,serial-port-logging-enable=true $EXTRA --maintenance-policy=TERMINATE --shielded-secure-boot --shielded-vtpm --shielded-integrity-monitoring --no-service-account --no-scopes --provisioning-model=SPOT --instance-termination-action=DELETE --max-run-duration=${CAP}m 2>&1 | grep -E '^ERROR|^ - '; gcloud compute instances describe $N --zone=$ZONE --format='value(id)' > $C/$N.id 2>/dev/null; timeout $(( CAP * 60 - 30 )) stage0/tools/publish/gcp/get-console.sh $N $ZONE --follow" > "$C/$N.follow.log" 2>&1 || true +echo "follower done at $(date +%T)" +grep -aE '^ERROR|^ - ' "$C/$N.follow.log" || true +ID=$(tr -dc 0-9 < "$C/$N.id" 2>/dev/null || true) +[ -n "$ID" ] || { echo "error: no instance id (creation failed? see $C/$N.follow.log)" >&2; exit 1; } + +sleep 15 # let Cloud Logging catch up with the last lines +dx "gcloud logging read 'resource.type=gce_instance AND resource.labels.instance_id=$ID AND logName=projects/$PROJECT/logs/serialconsole.googleapis.com%2Fserial_port_1_output' --freshness=30m --order=asc --format='value(textPayload)'" > "$C/$N.cloudlog" +python3 -I - "$C/$N.cloudlog" "$C/$N.console.log" <<'PY' +import sys +# Cloud Logging splits long lines across entries: join them, then split on the literal \r\n. +raw = ''.join(l.rstrip('\n') for l in open(sys.argv[1], encoding='latin1')) +t = raw.replace('\\r\\n', '\n').replace('\\"', '"') +open(sys.argv[2], 'w', encoding='latin1').write(t) +boots = t.split('BdsDxe: loading')[1:] +print('boots: %d' % len(boots)) +KEYS = ('GPT rewritten', 'data_reinit', 'stage1: boot disk', 'stage1: exec stage2', 'boot 1:', + '[persist]', '[integrity]', '[resize]', '[attest]', 'PIVOT_TEST=', 'Memory Encryption Features') +for i, b in enumerate(boots, 1): + print('-- boot %d: %s' % (i, 'payload ran' if '=== pivot-init' in b else 'no payload')) + for l in b.split('\n'): + if any(k in l for k in KEYS): + print(' ' + l.strip()[:160]) +PY +echo "console: $C/$N.console.log" +echo "instance: $(dx "gcloud compute instances describe $N --zone=$ZONE --format='value(status)' 2>&1 | tail -1")" +echo "next: tools/cloudtest/gcp-delete.sh $N" diff --git a/tools/cloudtest/gcp-setup.sh b/tools/cloudtest/gcp-setup.sh new file mode 100755 index 0000000..ad3abcc --- /dev/null +++ b/tools/cloudtest/gcp-setup.sh @@ -0,0 +1,68 @@ +#!/bin/bash +# Start a GCP cloud test run: snapshot what the PCR replay needs, build the netboot bundle +# (UKI + packed stage2, pinned by sha256), upload it, and create the stage0 image. The run lives +# in cloudtest// (gitignored); every created cloud resource is recorded in its teardown.txt. +# +# Creates cloud resources: run it only with the user's go-ahead (AGENTS.md "Cloud test runs"). +# Needs an open deploy shell (`make deploy-shell-gcp`) and built artifacts: +# make -C stage0 build-; make -C stage1 build- deploy-bin +# make -C stage2 pack- INIT_PAYLOAD=pivot-init +# Do not run a stage0 make target between this and the end of the run: it re-mints the Secure +# Boot keys, and the image created here is built from the current ones. +# +# usage: tools/cloudtest/gcp-setup.sh [arch] (default x86_64) +set -euo pipefail +die() { echo "error: $*" >&2; exit 1; } + +ARCH=${1:-x86_64} +cd "$(dirname "${BASH_SOURCE[0]}")/../.." +BUCKET=${CLOUDTEST_BUCKET:-lockboot-test} # public-read over plain http (stage0 has no TLS) +PROJECT=${DEPLOY_GCP_PROJECT:-lockboot} +DEPLOY=stage1/target/x86_64-unknown-linux-musl/debug/lockboot-deploy +UKI=stage1/tools/build-uki/$ARCH/linux.efi +S2=stage2/build/$ARCH/pack/stage2 +S0=stage0/build/$ARCH +S0_FILES=(BOOTX64.EFI boot.disk PK.cer KEK.cer db.cer dbx.esl stage0.replay.json os-release) +for f in "$DEPLOY" "$UKI" "$S2" "${S0_FILES[@]/#/$S0/}" \ + "stage1/tools/build-uki/$ARCH/stage1.replay.json" stage2/tools/stage2.replay.json; do + [ -e "$f" ] || die "missing $f (build it first; see the header of this script)" +done +dx() { make -s deploy-exec CMD="$1" 2>&1 | grep -v '^WARNING' || true; } + +R=$(head -c6 /dev/urandom | od -An -tx1 | tr -d ' \n') +C=cloudtest/$R +mkdir -p "$C/replay" +echo "$R" > cloudtest/CURRENT +: > "$C/teardown.txt" + +# What the replay reads, as it is now: a later stage0 build has different keys. +cp "${S0_FILES[@]/#/$S0/}" "stage1/tools/build-uki/$ARCH/stage1.replay.json" \ + stage2/tools/stage2.replay.json "$C/replay/" +{ + echo "run $R, $(date -u +%Y-%m-%dT%H:%M:%SZ), $ARCH" + for r in stage0 stage1 stage2; do + echo "$r $(git -C $r rev-parse --abbrev-ref HEAD) $(git -C $r rev-parse --short HEAD)$(git -C $r diff --quiet HEAD || echo ' +uncommitted')" + done + grep '^BUILD_ID=' "$S0/os-release" + sha256sum "$UKI" "$S2" +} > "$C/README.txt" + +BASE=http://storage.googleapis.com/$BUCKET/test/$R/chain +"$DEPLOY" create --arch "$ARCH" --uki "$UKI" --stage2 "$S2" --base-url "$BASE" --out "$C/chain" +"$DEPLOY" validate "$C/chain/user-data.json" + +GS=gs://$BUCKET/test/$R/chain/$ARCH +dx "gcloud storage cp $C/chain/$ARCH/linux.efi $C/chain/$ARCH/stage2 $GS/ >/dev/null 2>&1 && echo uploaded to $GS" +for f in linux.efi stage2; do echo "gcp gcsobject $PROJECT $GS/$f" >> "$C/teardown.txt"; done +for hop in _stage1 _stage2; do + url=$(jq -r ".$hop.$ARCH.payload.url" "$C/chain/user-data.json") + pin=$(jq -r ".$hop.$ARCH.payload.sha256" "$C/chain/user-data.json") + [ "$(curl -sf "$url" | sha256sum | cut -d' ' -f1)" = "$pin" ] \ + || die "$hop: $url does not serve the pinned bytes" + echo "served and pinned: $hop ${pin:0:16}" +done + +dx "stage0/tools/publish/gcp/create.sh --private --manifest $C/teardown.txt $ARCH 2>$C/create-$ARCH.err > $C/image-$ARCH.txt; echo create.sh rc=\$?" +[ -s "$C/image-$ARCH.txt" ] || die "no image created (see $C/create-$ARCH.err)" +echo "run $R: image $(cat "$C/image-$ARCH.txt")" +echo "teardown: $C/teardown.txt" diff --git a/tools/cloudtest/test-sev.sh b/tools/cloudtest/test-sev.sh new file mode 100755 index 0000000..ed43175 --- /dev/null +++ b/tools/cloudtest/test-sev.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# The release gate on GCP SEV (n2d-standard-2), one VM: launch and capture, delete, check. +# Needs a run (gcp-setup.sh) and an open `make deploy-shell-gcp`. One VM at a time, with the +# user's go-ahead (AGENTS.md "Cloud test runs"). +set -uo pipefail +cd "$(dirname "${BASH_SOURCE[0]}")" +./gcp-run.sh lb-sev n2d-standard-2 --confidential-compute-type=SEV; rc=$? +./gcp-delete.sh lb-sev +[ $rc -eq 0 ] || exit $rc +exec ./check-run.py lb-sev ../pcr-replay/platforms/gcp/gcp-n2d-standard-2-sev.replay.json diff --git a/tools/cloudtest/test-snp.sh b/tools/cloudtest/test-snp.sh new file mode 100755 index 0000000..8dcd258 --- /dev/null +++ b/tools/cloudtest/test-snp.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# The release gate on GCP SEV-SNP (n2d-standard-2), one VM: launch and capture, delete, check. +# Needs a run (gcp-setup.sh) and an open `make deploy-shell-gcp`. One VM at a time, with the +# user's go-ahead (AGENTS.md "Cloud test runs"). +set -uo pipefail +cd "$(dirname "${BASH_SOURCE[0]}")" +./gcp-run.sh lb-snp n2d-standard-2 --confidential-compute-type=SEV_SNP '--min-cpu-platform=AMD\ Milan'; rc=$? +./gcp-delete.sh lb-snp +[ $rc -eq 0 ] || exit $rc +exec ./check-run.py lb-snp ../pcr-replay/platforms/gcp/gcp-n2d-standard-2-sev-snp.replay.json diff --git a/tools/cloudtest/test-tdx.sh b/tools/cloudtest/test-tdx.sh new file mode 100755 index 0000000..4b110d1 --- /dev/null +++ b/tools/cloudtest/test-tdx.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# The release gate on GCP TDX (c3-standard-4), one VM: launch and capture, delete, check. +# Needs a run (gcp-setup.sh) and an open `make deploy-shell-gcp`. One VM at a time, with the +# user's go-ahead (AGENTS.md "Cloud test runs"). +set -uo pipefail +cd "$(dirname "${BASH_SOURCE[0]}")" +./gcp-run.sh lb-tdx c3-standard-4 --confidential-compute-type=TDX; rc=$? +./gcp-delete.sh lb-tdx +[ $rc -eq 0 ] || exit $rc +exec ./check-run.py lb-tdx ../pcr-replay/platforms/gcp/gcp-c3-standard-4-tdx.replay.json From f500cc2deea803e4439849686de869af98dfa064 Mon Sep 17 00:00:00 2001 From: HaRoLd <303926+HarryR@users.noreply.github.com> Date: Wed, 18 Nov 2026 09:23:19 +0000 Subject: [PATCH 10/13] remove a committed __pycache__ file; ignore __pycache__ Co-Authored-By: Claude --- .gitignore | 3 +++ .../__pycache__/check-run.cpython-313.pyc | Bin 12613 -> 0 bytes 2 files changed, 3 insertions(+) delete mode 100644 tools/cloudtest/__pycache__/check-run.cpython-313.pyc diff --git a/.gitignore b/.gitignore index 774d833..4110c3f 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,6 @@ CLAUDE.local.md # cloud test runs (tools/cloudtest): bundles, manifests, console logs /cloudtest/ + +# Python bytecode +__pycache__/ diff --git a/tools/cloudtest/__pycache__/check-run.cpython-313.pyc b/tools/cloudtest/__pycache__/check-run.cpython-313.pyc deleted file mode 100644 index a1a9028f5eba391789883e6f5068e8552df8eea9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12613 zcmcgydr%z5nV;GB`@!-C!SH4g%R{^bGLn{;0E^cS1F}I{54!`bg=W$0BBYJ)jPL#k zICsa&=S1sV>avPe(Ylf<<5a4QD_0kCNnJ=)QknHCfs84a>dv_;{ij&2+@&scxvyuL zU8F-OuevGd?&IIrX%{Wl4>lD!6Q^Vyf`}NST$I zG*y_^x8TW_r{$dCDI6B021ymB4Wx{elZqBavWhc7-=b7=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CpB>meZKX(0e{72(IFLbS)U+oE(gvs5OldC=JBWoitOliVUamVw` zvKal1%C|2k3@6~%BF9Ml6O(1#_qvbI?cN&uvFxXcA1M;1p;h@W3L6rZkq-+S!dJiD zy{QldW8LcdjyciXzugsY9=>Ib7dEUadCSPh=FETW=F8f*tckKNY3(`FKQ~;wZ_9g6 znJ8%emNM2DaYlks=UdBP9(+$3F97&xTkYO8XRN&%ZHaZi{oL*`BAWHqi(z@V_oi;o zU-bSR@Z)pa?TORl zpan0^#dGJ87Q8HK!DXZc7VBeMe&3w2ej_}y?qBmqn5ZjZs@^fx#!a=c3maU*)UnyL z*~OdAtjhPSwp)2`(;dLz^H?_x&_52y{ujIIX79@cy=kWUq)oSIAt|UAe z#cxi>6(wK})TXfYuRn(trjMM9wDaZTyotJ}nLxIt`s=crvoTd%SAS2@@UbOhwUJlk zMQ}*|>$8h8EVJklh67Hd5w3-AKEFM-4Tv?$7mV##TpwCo{|zbwM8ExX7{{!m_-{Vd zV1;b~bf@}Bv$KUMl>Op#*{ohARHz{RD9*+pvNC5@uKW+V63T+c?M7D{ zx7(i2y##%^>nOR5k`PK5l%RWY@)9aum}lV?93wssU4aEPJrfY`gHI$%RtavLGuULpFG_>0-DB#{6d5p{@B(4A;GY$7bH0duQ(5g?ARR%iG!o<%MnGc~ppL-Wp`@h^Bfv*4n From e0c2185d277bbdc9cb1fc72069186e4606800963 Mon Sep 17 00:00:00 2001 From: HaRoLd <303926+HarryR@users.noreply.github.com> Date: Wed, 18 Nov 2026 13:11:20 +0000 Subject: [PATCH 11/13] untrack pcr-replay's __pycache__ file Committed by mistake in a56e303. The workspace .gitignore has ignored __pycache__/ since f500cc2; that rule does not untrack a file already committed. Co-Authored-By: Claude --- .../__pycache__/pcr-replay.cpython-313.pyc | Bin 45586 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 tools/pcr-replay/__pycache__/pcr-replay.cpython-313.pyc diff --git a/tools/pcr-replay/__pycache__/pcr-replay.cpython-313.pyc b/tools/pcr-replay/__pycache__/pcr-replay.cpython-313.pyc deleted file mode 100644 index f8b80ca9ec9839710798bb4ca256a5ab8cd2657d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 45586 zcmc${3shTInkK5FHe#Pd)U)3-F%7?} zLxzJ!(a6eDA2JZ?FTc(OvGu$EI}t`3wkl9 zH_f>@-qyIMNFk)vanh@p_sBGcc$)lN1@aj46@sbPR!4(@M=W5W=?FC^g|1?u7KCOb zg|23yR)pG;Lf5cRJ3=#)Lf5j;EQDq!h4L&k2cfx1p@l3o525)kwL+6k5(g%MeykoiSZF;$ zw|JB^loMEo22)6cmpe?0i|r~-4+ga##gziWR-68Y| zJM$G!sl}bblfo|M+aAykMh!c)RQmadhhI)qe*&ILdr&!fD|c^R)|J!O46_FsA|=tD~`6J5ZiWE-zl|u~=*; zV!OT&>lDU>ZdRVKMv?dv#)ac7v_m)}Ji&Y}K@@tJuT$^|z0B7oOb92Kue zLgCgc6usR=3b}q>F{~U`Iwl{`C^)#N(e3q)O}HmU#=O3Eyz86XqoeNrQIA6zO&fGi zxCchvK3`NbG~yW@bZDZw!y^+O(LEY9wvSCXJ!d9IM9*L}t>ePDXK>%hz(iEz@}jJ$ zdcf_Qm`WcX5GzE__^A8Brn6NJbyV#;<*tfq;a1nxv)`Jnwd}X9s`^1L+B8+-t{d1~ z*Wj+IXsGqnR@A!PTPn70>94DB_gB@`4OI6JZQfEnRWeXDP+L`BU0+eRxpttUc5_2@ zg?qr=P*Gbo)KF93P*Yn|y>%cq)$At*>bQsN@%lYQuR`Pm1wc9{s@4I#_o@X|8Da!A zd>ZD{ike}aLmySUCWf{?a3C_O@=b_Q^(5XuwI^y+s#}JKxq}f0~R$rfw=4PPJ zJuxAU^iNKBe0_Z)4bwyXE23*AP_J)O(kLgqmE#vg8xk>x8t+So^G(H)A^rK*rL_Ee z>U@!xUam`a+x3G>Z9GHBH~@9iL?F+D$dFc4@kg^X%oqz zJaVIq<`)i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k6!(`wjaC#lcd|+vmKWb!#Lq9nXyI@eU4IUbNmY^VG6v_ z+Y8n^{5d#S-nlmr)F4;4ud}a{ZvF=wBB4Jgs71CGcF2M?gCP1UgDesb36BKV=7KgH zVIB#658*%L?ZCsGNGy1mj|5yU$$X|5(iVi(qK6Zh*5V=h7lQb=RmoVo15q22b|e8L zc;6-Xtu!BA6DEtLHyXXO=>7jDRvJL^E|T|<3?spx9=xBAcTj?D#6%wuWfW{d9r5xe zxcavOUCJM(kFY+q*p4GQf#fqJUm*Dk33_OhOo2BLZ9;M%3A)r2Gmu()^v5CKAO}$3 zN7RD^?Y@Mr9@3!owL+X&zmhs(eyJIj`bQf5=RkY+Y5eS|y8N!gpH)3$^RxO7r{v{=fmown44Ofs(`IbjbZuOvAN z-k-#T7{bM{NI(oSONbHcK!MmIQoaSTDf~9_O^EH`HpF(BRS_$;g#!Duid+&ClCJcb zF0*QqAwpXyWIZ7+k@oMR{P6xIzC)?+kXa2`jr~9&8wtr%^vQ#5SB+M&Dv}w^kM@oG z&la6;n5>gpeA1qdS!-U@8r=sMFTE6ON#oNY{<(7CVOtKkkY44a zy@=N!DWqJP2a$qUmXyl2Y+}3R<7BvNx)k(0iR;C>JRh0$m mmKcCIEF?`XSxeFvARI@d4-ZVMSN*JE-){h$Mw3lftNsT^k;Rn& From 10234ac1d8bd96e6f5b12a9c9f6f99e33865fc34 Mon Sep 17 00:00:00 2001 From: HaRoLd <303926+HarryR@users.noreply.github.com> Date: Wed, 18 Nov 2026 15:11:17 +0000 Subject: [PATCH 12/13] RELEASING: stage0 / stage1 / stage2 sections, tag-pinned verify; tracker and notes RELEASING.md gains a section per stage (assets and zip layout, what the attestation covers, the ghcr image, local build targets to compare against, stage0's image publish) and its verify commands pin the release's tag (--source-ref) and check the asset against the immutable release, as create.sh does. REPRODUCIBLE-BUILDS.md: the linker's debug record on UEFI targets as a third trap, and the commit-date yy.mm in the UKI's os-release. Tracker: resolved and decided items removed (decisions recorded under Notes), the selftest on the final trees, and what the next CI runs must confirm. AGENTS.md: GCE instances always set serial-port-enable=true. Co-Authored-By: Claude --- AGENTS.md | 2 ++ RELEASING.md | 75 +++++++++++++++++++++++++++++++++++++----- REPRODUCIBLE-BUILDS.md | 25 +++++++++++--- WIP-RELEASE-TODO.md | 74 ++++++++++++++++------------------------- 4 files changed, 118 insertions(+), 58 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index c2b58ca..dcca88c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -125,6 +125,8 @@ before bumping the Fedora major). single `--metadata`, so add the key to the existing list. Filter by `resource.labels.instance_id` (read the id before deleting), not the name: a reused VM name pulls in earlier runs' logs. +- Every GCE instance is created with metadata `serial-port-enable=true`: without it there is no + serial port and so no console output to read. Settled; not an open question. - GCP full-chain runs (stage1 onward) need a Confidential VM (SEV / SEV-SNP): stage1 attests before running stage2, and GCE provisions AK certificates only on Confidential VMs. Plain Shielded VMs are for stage0 probes only. diff --git a/RELEASING.md b/RELEASING.md index 7ffc72e..4f85612 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -19,26 +19,83 @@ Release repos: stage0, stage1, stage2, vaportpm. Release tags are plain `v*`. (vaportpm v0.4.0). - **Only a merged, tested changeset is tagged.** The tag goes on the merge commit on `main`, after every repo in the changeset has merged (see `AGENTS.md`, Git & PR workflow). +- **Every release is created as a prerelease** (`prerelease: true` in each workflow). Steps: -1. The version bump is part of the changeset's PR, not a separate one. +1. A version bump is part of the changeset's PR, not a separate one. 2. After the merge: `git checkout main && git pull --ff-only`, then `git tag vX.Y.Z` and `git push origin vX.Y.Z`. -3. Wait for the workflow's release job; it publishes the release. -4. Verify (below), then edit the notes: what changed and the pin line consumers use. -5. Repin the consumers (below) in their own PRs. +3. Wait for the workflow's release jobs. The first publishes the release; the others push the + container images, and in stage0 and stage2 append the image digest to the release notes. +4. Verify (below), then edit the notes: what changed and what consumers pin. +5. vaportpm only: repin the consumers in their own PRs. The stages do not pin each other. -Verify a release: +Verify a release. The provenance must come from a build of the release's own tag (only admins +create `v*` tags, and none can be moved), and each file must be an asset of the immutable release: ``` -gh release view vX.Y.Z -R lockboot/ --json isImmutable,assets +gh release view vX.Y.Z -R lockboot/ --json isImmutable,isDraft,assets gh release download vX.Y.Z -R lockboot/ -D -gh attestation verify --repo lockboot/ # each asset +# each asset: +gh attestation verify --repo lockboot/ --source-ref refs/tags/vX.Y.Z +gh release verify-asset vX.Y.Z -R lockboot/ +# each container image, by the digest in the release notes: +gh attestation verify oci://ghcr.io/lockboot/@sha256: --repo lockboot/ \ + --source-ref refs/tags/vX.Y.Z ``` -Then check that the assets are byte-identical to a local build of the tag: check out the tag and -build with the repo's Makefile release targets (`REPRODUCIBLE-BUILDS.md`), then sha256-compare. +Then compare with a local build of the tag: check out the tag, build with the Makefile targets the +repo's section names, and sha256-compare (`REPRODUCIBLE-BUILDS.md`). + +## stage0 + +- **Assets:** `stage0-x86_64.zip`, `stage0-aarch64.zip` and `qemu-test.sh`. A zip holds, flat: + `boot.disk`, the db-signed `BOOT*.EFI`, `efi-vars.{ovmf,aws}`, `dbx.esl`, `dbx.auth.bin`, the + `PK` / `KEK` / `db` certificates and owner GUIDs, `pcrs.json`, `stage0.replay.json` and + `os-release`. One build-provenance attestation covers the zips, every file inside them + (subjects named `/`) and `qemu-test.sh`, so an extracted file verifies on its own. +- **Secure Boot keys:** the build job mints PK / KEK / db and uploads only the certificates, so + every release has its own keys and the signed files differ between any two builds. +- **Version:** `crates/stage0`'s crate version is printed at boot (`stage0: version: ...`) and so + is part of the measured binary. +- **Image:** `ghcr.io/lockboot/stage0-harness:` (multi-arch QEMU test harness), attested. + `release-harness` appends its digest to the release notes; consumers pin the digest. +- **Local equivalents:** `make build-x86_64`, `make build-aarch64` (`build//`). The signed + files cannot match; compare PCR4 in `pcrs.json`, which follows from the Authenticode hash of + `BOOT*.EFI` and does not depend on the keys. +- **After the release:** a cloud image is made from the release, never from a local build. In the + deploy shell (`make deploy-shell-gcp`): `stage0/tools/publish/gcp/create.sh vX.Y.Z`. It + downloads the zip, runs the two checks above on it, and creates the image + `lockboot---` from the zip's `os-release`. EC2 is the same with + `ec2/create.sh`. One region; image IDs are not published; no deprecation step. + +## stage1 + +- **Assets:** `uki-x86_64.zip` and `uki-aarch64.zip`. A zip holds, flat: `linux.efi`, + `linux.efi.sha256`, `stage1.replay.json`, `os-release`, `busybox`, `stage1` and `stage2` (the + example stage2). One build-provenance attestation covers the zips and every file inside them + (subjects named `/`). +- **`linux.efi`** is the UKI stage0 admits by sha256 and the firmware measures. It is unsigned. +- **Image:** `ghcr.io/lockboot/stage1:` (multi-arch, busybox + `stage1`), attested by + `release-docker`. Its digest is not written to the release notes. +- **Version:** the `os-release` embedded in the UKI carries `yy.mm`, taken from the committer + date (UTC) of the commit being built, so the tag's commit fixes it. +- **Local equivalents:** `make x86_64 stage2-x86_64`, `make aarch64 stage2-aarch64` + (`tools/build-uki//`, and `build//stage2`); compare sha256 directly. +- The kernel and systemd-boot stub are pinned in `tools/build-uki/fedora-deps.mk` (`AGENTS.md`, + Ops). + +## stage2 + +- **Assets:** `stage2-loader-x86_64`, `stage2-loader-aarch64` and `stage2.replay.json`, covered by + one build-provenance attestation. +- **Image:** `ghcr.io/lockboot/stage2-erofs-builder:` (multi-arch, both loaders baked in), + attested. `release-erofs-builder` appends its digest and the loaders' sha256 to the release + notes; consumers pin the digest (stage2 `README.md`). +- **Local equivalents:** `make pack-x86_64`, `make pack-aarch64`. + `target/-unknown-linux-musl/release/bootstrap` is `stage2-loader-`, and + `tools/stage2.replay.json` is the replay file. ## vaportpm diff --git a/REPRODUCIBLE-BUILDS.md b/REPRODUCIBLE-BUILDS.md index 24ad26d..c97c6b8 100644 --- a/REPRODUCIBLE-BUILDS.md +++ b/REPRODUCIBLE-BUILDS.md @@ -4,7 +4,7 @@ Lock.Boot is a **measured** boot chain: stage0 and the stage1 UKI are hashed int attestation is checked against expected values. That only means anything if the same source produces the same bytes: a verifier (or an auditor rebuilding from source) must be able to reproduce the exact `stage0.efi` and `linux.efi` that CI published, and get the same PCRs. This file explains what makes -the builds bit-for-bit reproducible, the two non-obvious traps that broke it, and how to verify it. +the builds bit-for-bit reproducible, the non-obvious traps that broke it, and how to verify it. Scope: the chain repos `stage0` and `stage1`. Both build inside the shared `lockboot:build` image (`stage0/Dockerfile.build`, identical in stage1) via their Makefiles. @@ -19,7 +19,8 @@ Scope: the chain repos `stage0` and `stage1`. Both build inside the shared `lock 2. **`SOURCE_DATE_EPOCH=0`.** Set in both `Dockerfile.build`s and in `stage1/tools/build-uki/build.sh`, so any timestamp baked into an artifact is fixed. FAT timestamps in the boot disk are separately normalized (`stage0/tools/normalize-fat-timestamps.py`); the UKI is assembled deterministically by - `mkuki`. + `mkuki`. The `yy.mm` version in the UKI's embedded `os-release` is the committer date (UTC) of + the commit being built, passed in by stage1's Makefile, never the build date. 3. **Locked dependencies.** `Cargo.lock` is committed in every crate, and the build recipes pass `--locked` so a build can never silently resolve newer transitive deps. 4. **Deterministic linking.** Static musl / UEFI builds use `rust-lld` + `+crt-static` via per-target @@ -28,7 +29,7 @@ Scope: the chain repos `stage0` and `stage1`. Both build inside the shared `lock repo owns its rustflags (CI checks out each repo alone, so it must be self-sufficient). 5. **Path canonicalization** -- the subtle part, below. -## The two path traps +## The path traps rustc embeds absolute **source paths** into binaries (panic `Location` strings, some debuginfo). If those paths depend on the build environment, two environments building identical source produce @@ -68,6 +69,22 @@ remap covers every target arch. > `trim-paths` (the Cargo profile option) would replace all of this cleanly, but it is still > nightly-only as of Rust 1.91, so we use the stable `--remap-path-prefix`. +### 3. The linker's debug record (UEFI targets) + +rustc links the UEFI targets with `/DEBUG`. The linker then writes a `.pdb` and puts a debug record +in the image: the `.pdb`'s file name and a GUID that is a hash of the `.pdb`'s contents. The `.pdb` +records where the toolchain is installed -- the path of `rustc` and of the sysroot's rlibs, so +`/tmp/.rustup` in CI and `/src/.rustup` locally. The linker writes those paths, so +`--remap-path-prefix` does not reach them. `stage0.efi`, `ena.efi` and `gvnic.efi` each differed +between CI and a local build in exactly those 8 GUID bytes, which changes the Authenticode hash and +PCR4. Fix, in `stage0/.cargo/config.toml` for both UEFI targets: + +```toml +"-C", "link-arg=/DEBUG:NONE", +``` + +No `.pdb` is written and the image carries no debug record. + ## Bumping the toolchain (READ THIS) The rust-src remap hardcodes **the toolchain version** (FROM path) and **the rustc commit-hash** (TO). @@ -87,7 +104,7 @@ CI uploads build artifacts on every push to `main` and on PRs (`stage0/.github/w ```sh # 1. Build locally (same repo, same commit) and note the hashes: -# stage1: make x86_64 stage2-x86_64 -> tools/build-uki/x86_64/{linux.efi,stage2} +# stage1: make x86_64 stage2-x86_64 -> tools/build-uki/x86_64/linux.efi, build/x86_64/stage2 # stage0: make build/x86_64/stage0.efi # 2. Grab the CI artifacts from the run for that commit: gh run download -R lockboot/stage1 -n uki-x86_64 -D ci-s1 diff --git a/WIP-RELEASE-TODO.md b/WIP-RELEASE-TODO.md index a0de7fe..ddb6102 100644 --- a/WIP-RELEASE-TODO.md +++ b/WIP-RELEASE-TODO.md @@ -15,7 +15,8 @@ Scope: GCP Confidential VMs: n2d SEV / SEV-SNP and c3 TDX. EC2 and GCP Arm are o | stage2 | lockboot/stage2#5 | `grow-then-reboot` | | workspace | lockboot/workspace#6 | `pcr-replay-gpt-digest` | -vaportpm v0.4.1 is released; stage1 and stage2 pin it. All four PRs are draft with CI green. +vaportpm v0.4.1 is released; stage1 and stage2 pin it. All four PRs are ready for review, CI +green on the three stage repos (the workspace has no checks). In order: @@ -24,10 +25,10 @@ In order: `hkdf` module (nvme-auth no longer needs it), so `init` and `build.sh` drop it. `build.sh` extracts exactly the RPMs `fedora-deps.mk` pins, and `update-fedora-deps` removes the previous ones: before, a bump without a clean silently rebuilt the old kernel. - Working tree, uncommitted. -- [x] **Local `make selftest`, both arches** (2026-11-18): ALL PASS on the working trees, with - 7.2.11 confirmed in the boot logs. UKI sha256: x86_64 `e0bc2bbc860aa046`, aarch64 - `8c09afca2f37aebd`. +- [x] **Local `make selftest`, both arches** (2026-11-18): ALL PASS on the final trees (stage0 + without the debug record, commit-date `os-release` in stage0 and stage1, Fedora tag from + the pinned kernel). UKI sha256: x86_64 `fecbe639b4bb9fa0`, aarch64 `fef50d8d91a5510f`; + unsigned `stage0.efi`: x86_64 `888872691851329e`, aarch64 `d025bcc8739882e3`. - [x] **GCP gate on the final heads** (2026-11-18, cloudtest `be236c1f6330`, `tools/cloudtest/`): n2d SEV, n2d SEV-SNP and c3 TDX each GATE PASS. Per VM, on both payload boots: stage1's attestation verifies (vaportpm-verify v0.4.1), its nonce is sha256(stage2), @@ -36,52 +37,32 @@ In order: the reboot after the provisioning reboot. stage0 `stage0-45bb278f8fed` (stage0#14 head), UKI `e0bc2bbc860aa046` (= CI's build of stage1#22's head), stage2#5 head plus the pivot-init evidence printout. Shielded (non-confidential) VMs are not tested: no AK - certificate, so the chain stops at stage1. -- [ ] **Release tooling fixes** (working trees, uncommitted): `stage0/tools/publish/{ec2,gcp}/ - create.sh` verify with `--source-ref refs/tags/$VERSION` and `gh release verify-asset`, and - read `os-release` as data instead of sourcing it; `stage1/tools/publish.sh` deleted - (`lockboot-deploy create` replaces it); stage1 `release-docker` gains - `docker/setup-qemu-action`. Tested: the two `gh` checks against vaportpm v0.4.1, the - `os-release` parser on good, hostile and incomplete input. NOT tested: `create.sh`'s release - path end to end and the docker job, which need a stage0 release and a stage1 tag. + certificate, so the chain stops at stage1. The run predates two byte changes: stage0 without + the linker's debug record, and the UKI's `os-release` version string. Not re-run (decided + 2026-11-18): the mechanisms are unchanged and the replay is reproducible end to end. - [ ] Merge the four PRs together. -- [ ] **Tag stage0, stage1, stage2** (`RELEASING.md`). These are the first tags in those repos, so - confirm: the draft-then-publish release (proven only on vaportpm), the attestation subject - names (`gh attestation verify --format json`), the release-notes edits made by later jobs, - the first ghcr package push (org package-creation policy unknown), stage1's multi-arch - `release-docker` build, and `create.sh ` against the new stage0 release. +- [ ] **Confirm on the next CI runs** (stage0#14, stage1#22), for changes CI alone can show: + - stage0: CI's unsigned binaries equal a local build. They differed in the linker's debug + record (`REPRODUCIBLE-BUILDS.md`, trap 3); the UEFI targets now link with `/DEBUG:NONE`. A + local build under CI's settings (`CI=true`) already equals the normal local build on both + arches. Compare PCR4 in CI's `pcrs.json` with the local one. + - stage1: the `uki-` artifact is flat. `release-docker` extracts it into + `tools/build-uki/`, and since July the artifact had been rooted at the repo root, + which no tag has run. The docker job itself first runs at a tag. +- [ ] **Tag stage0, stage1, stage2** (`RELEASING.md`). Not yet: the user decides when, and the + versions (a crate version bump changes the UKI bytes; the release is what the tag builds). + These are the first tags under the release workflows, so confirm: the draft-then-publish + release (proven only on vaportpm), the attestation subject names (`gh attestation verify + --format json`), the release-notes edits made by later jobs, the first ghcr package push + (org package-creation policy unknown), stage1's multi-arch `release-docker` build with + `docker/setup-qemu-action`, and `stage0/tools/publish/{ec2,gcp}/create.sh ` + against the new stage0 release (its `--source-ref refs/tags/` and `gh release + verify-asset` checks are tested only against vaportpm v0.4.1). ## Open Which of these block the release is undecided. -Release tooling: - -- [ ] Publish per-release cloud image IDs and the owner account / project (release notes stay - editable under immutability). -- [ ] Single-region publish; no image deprecation / deregistration step - (`gcloud compute images deprecate`, `aws ec2 enable-image-deprecation`). -- [ ] stage1's pre-split releases `v0.1.0` / `v0.2.0` ship an aarch64 varstore trusting Debian's - public SnakeOil KEK + db. The user archives them in due time; check whether any AMI / GCP - image was published from them. -- [ ] Not yet reviewed: `stage0/tools/publish/cleanup.sh`, `gcp/get-console.sh`, - `gcp/install-gcloud.sh`. - -GCP: - -- [ ] **Firmware on a grown volume (untested).** After a PD resize the backup GPT is no longer at - the disk's end. Expect the firmware to measure the primary unchanged; if it repairs or - relocates the backup header, PCR5 / PCR2 move without stage2 writing anything. Test: stop, - grow the PD, start; confirm the GPT digest is unchanged before stage2 acts, then the grow + - reboot + reinit. -- [?] **`serial-port-enable=true`**: every run sets it, so whether output needs it is still - untested (one boot with, one without, compare `get-serial-port-output`). Docs: it controls - interactive access, off by default; if it must stay on, console input reaches the firmware - and kernel for anyone with the project's credentials. -- [ ] Stale image `lockboot-x86-64-26-02-fc41` (2026-02-09) in project `lockboot`: delete by hand. - -Docs and build: - - [ ] `CONSOLE-OUTPUT.md` matrix is out of date: local aarch64 UEFI ConOut is captured now (`stage0/build/aarch64/boot-*.log` carry the `stage0:` lines), and GCP x86_64 captured all three paths (2026-11-09/10). The EC2 rows wait on AWS (below). @@ -138,5 +119,8 @@ Docs and build: and `lockboot-test` are kept empty between runs. - Stopping the host `docker exec` does not stop the in-container process: run console followers under an in-container `timeout`. +- Decided 2026-11-18, pre-release software: no per-release cloud image IDs are published, images + are published to one region, and there is no image deprecation step. stage1's `v0.1.0` / + `v0.2.0` are pre-releases and stay as they are. - `lockboot-deploy create --args` applies to `_stage2` only. `_stage1.args` would become the UKI's LoadOptions, which it ignores under Secure Boot, so this is left as is. From 895f283297c223c37bc4ec7fd272b739074a8b10 Mon Sep 17 00:00:00 2001 From: HaRoLd <303926+HarryR@users.noreply.github.com> Date: Wed, 18 Nov 2026 16:00:37 +0000 Subject: [PATCH 13/13] tracker: CI builds match the local ones; the changeset merges The two things only CI could show are confirmed on stage0#14's and stage1#22's runs: stage0's CI build equals the local build on both arches (PCR4 and the unsigned body), and stage1's artifact is flat with every file byte-identical. What is left for this release is the tags. Co-Authored-By: Claude --- WIP-RELEASE-TODO.md | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/WIP-RELEASE-TODO.md b/WIP-RELEASE-TODO.md index ddb6102..f669833 100644 --- a/WIP-RELEASE-TODO.md +++ b/WIP-RELEASE-TODO.md @@ -8,15 +8,8 @@ has them. Every cloud-platform claim cites the doc or the observed behaviour it Scope: GCP Confidential VMs: n2d SEV / SEV-SNP and c3 TDX. EC2 and GCP Arm are out of scope (blocked, below) and do not hold the release. -| Repo | PR | Branch | -|---|---|---| -| stage0 | lockboot/stage0#14 | `gpt-digest` | -| stage1 | lockboot/stage1#22 | `gpt-digest` | -| stage2 | lockboot/stage2#5 | `grow-then-reboot` | -| workspace | lockboot/workspace#6 | `pcr-replay-gpt-digest` | - -vaportpm v0.4.1 is released; stage1 and stage2 pin it. All four PRs are ready for review, CI -green on the three stage repos (the workspace has no checks). +The changeset is merged (2026-11-18): lockboot/stage0#14, lockboot/stage1#22, lockboot/stage2#5 +and lockboot/workspace#6, on vaportpm v0.4.1, which stage1 and stage2 pin. In order: @@ -28,7 +21,9 @@ In order: - [x] **Local `make selftest`, both arches** (2026-11-18): ALL PASS on the final trees (stage0 without the debug record, commit-date `os-release` in stage0 and stage1, Fedora tag from the pinned kernel). UKI sha256: x86_64 `fecbe639b4bb9fa0`, aarch64 `fef50d8d91a5510f`; - unsigned `stage0.efi`: x86_64 `888872691851329e`, aarch64 `d025bcc8739882e3`. + unsigned `stage0.efi`: x86_64 `888872691851329e`, aarch64 `d025bcc8739882e3`. CI's builds + of the same heads are byte-identical on both arches (stage0 through PCR4 and the unsigned + body; every file in stage1's artifact). - [x] **GCP gate on the final heads** (2026-11-18, cloudtest `be236c1f6330`, `tools/cloudtest/`): n2d SEV, n2d SEV-SNP and c3 TDX each GATE PASS. Per VM, on both payload boots: stage1's attestation verifies (vaportpm-verify v0.4.1), its nonce is sha256(stage2), @@ -40,15 +35,6 @@ In order: certificate, so the chain stops at stage1. The run predates two byte changes: stage0 without the linker's debug record, and the UKI's `os-release` version string. Not re-run (decided 2026-11-18): the mechanisms are unchanged and the replay is reproducible end to end. -- [ ] Merge the four PRs together. -- [ ] **Confirm on the next CI runs** (stage0#14, stage1#22), for changes CI alone can show: - - stage0: CI's unsigned binaries equal a local build. They differed in the linker's debug - record (`REPRODUCIBLE-BUILDS.md`, trap 3); the UEFI targets now link with `/DEBUG:NONE`. A - local build under CI's settings (`CI=true`) already equals the normal local build on both - arches. Compare PCR4 in CI's `pcrs.json` with the local one. - - stage1: the `uki-` artifact is flat. `release-docker` extracts it into - `tools/build-uki/`, and since July the artifact had been rooted at the repo root, - which no tag has run. The docker job itself first runs at a tag. - [ ] **Tag stage0, stage1, stage2** (`RELEASING.md`). Not yet: the user decides when, and the versions (a crate version bump changes the UKI bytes; the release is what the tag builds). These are the first tags under the release workflows, so confirm: the draft-then-publish