Skip to content

stage1 admission: discriminated union (payload | manifest) + reproducible boot-test matrix#6

Merged
HarryR merged 1 commit into
mainfrom
manifest-resolve
Jul 8, 2026
Merged

stage1 admission: discriminated union (payload | manifest) + reproducible boot-test matrix#6
HarryR merged 1 commit into
mainfrom
manifest-resolve

Conversation

@HarryR

@HarryR HarryR commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

What

Mirrors the stage1 rework on stage0's _stage1 admission. Each per-arch entry is a discriminated union, exactly one of:

  • payload -- admit a UEFI binary now: sha256 pin or ed25519-signed (sig_url), with inline or signed LoadOptions (args / args_url).
  • manifest -- fetch a signed manifest (a _stage1 fragment), verify its detached signature against the pinned ed25519 key, deep-merge it, and re-evaluate. Resolution loops through a chain of signed manifests (per-hop key delegation) until a payload is reached; a repeated (url, sha256) is a cycle and fails closed.

stage0 forwards no document (the UKI re-fetches its own metadata), so the merged doc drives only re-evaluation. Closes the ed25519 mix-and-match malleability (#2) without dropping the flexible url/sha256/ed25519/sig_url/args_url paths. config.rs mirrors stage1's metadata types (http-only, Deserialize-only).

Reproducible boot-test suite (Makefile-driven, no manual docker)

  • boot-% -- mode-aware (SIGN / SIGN_ARGS / MANIFEST / FALLBACK / ARGS), serves a staging dir so payload, signed args, and a signed manifest are all served uniformly at http://SERVE_HOST/<file>.
  • smoke-boot-% -- boots every admission mode stage0 -> test-payload and asserts the payload actually chain-loaded (fetch -> admit -> PCR-measure -> chain-load), with a per-mode PASS/FAIL summary.
  • Fast by default: the test payload powers off at the end instead of returning to stage0 (so stage0's ~90s fail-closed drain is never hit), and skips its EC2-only ~60s serial-flush hold when its LoadOptions carry --nosleep (a runtime flag the harness passes -- no separate build; a real EC2 deploy keeps the full hold). The whole matrix runs in ~2 min.

Verification

  • Compiles clean for x86_64-unknown-uefi via make.
  • make smoke-boot-x86_64: all 5 modes PASS (sha256, ed25519 sig, signed args, signed manifest, mirror fallback) in ~2 min.

Rebuilt from main as a purely additive change; supersedes #5. Pairs with lockboot/stage1#16.

🤖 Generated with Claude Code

…ible boot-test matrix

Mirror stage1's _stage2 rework on stage0's _stage1 admission: each per-arch
entry is a discriminated union, a `payload` (sha256 pin or ed25519-signed, with
inline or signed LoadOptions) or a `manifest` (fetch a signed manifest, verify
it against the pinned key, deep-merge it, and re-evaluate). Resolution loops
through a chain of signed manifests (per-hop key delegation) until a payload is
reached; a repeated (url, sha256) is a cycle and fails closed. stage0 forwards
no document (the UKI re-fetches its own metadata), so the merged doc drives only
re-evaluation. Closes the ed25519 mix-and-match malleability (#2)
without dropping the flexible url/sha256/ed25519/sig_url/args_url paths.

Also add a reproducible, asserting boot-test suite driven entirely by the
Makefile (no manual docker):

- boot-%: mode-aware (SIGN / SIGN_ARGS / MANIFEST / FALLBACK / ARGS), serving a
  staging dir so payload, signed args, and a signed manifest are served uniformly
- smoke-boot-%: boots every admission mode stage0 -> test-payload and asserts the
  payload chain-loaded, with a per-mode PASS/FAIL summary (~2 min for the matrix)
- the test payload powers off instead of returning to stage0 (avoids stage0's
  fail-closed drain) and skips its EC2-only serial-flush hold when LoadOptions
  carry --nosleep (a runtime flag, no separate build); a real EC2 deploy passes
  no flag and keeps the hold

README updated.

Supersedes #5 (rebuilt from main as an additive change).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@HarryR HarryR merged commit 63c691d into main Jul 8, 2026
3 checks passed
@HarryR HarryR deleted the manifest-resolve branch July 8, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant