notes

The sealed pair: checking a kernel against its archive on the host

Name: provisional, minted 2026-10-24 (UTC) by comments/929-crates-17.

A kernel image and the userspace archive beside it are one sealed set. The build compiles the digests of the archive entries the kernel may enter into its .rodata (kernel/build.rs), and the kernel refuses userspace whose bytes do not match (kernel::trust::require). A mismatched pair boots, prints MEASURED BOOT REFUSED and halts, and that is discovered only after a walk to the board. crates/sealed_pair asks the same question on the host, where the answer costs nothing.

Searching bytes, not parsing them

inspect hashes each entry the kernel would hand over: the boot programs and the measurement table. It then looks for each digest's 32 raw bytes inside the kernel image. That is what the trust root compiles to, and a chance match is not worth a sentence. It needs no knowledge of where the array landed, so one function reads a flat booti image, an ELF, and a UEFI boot file with the pair embedded. Finding a digest proves the kernel vouches for those bytes. Not finding one cannot say what the kernel expected instead, which is why a refusal names the archive's digest and never the kernel's; cargo xtask card-check recovers the other by comparing against the tree's own build.

inspect also checks the archive's measurement table against the archive's own contents. That is a separate refusal, the one the progenitor would make one level up.

One list of boot programs

BOOT_PROGRAMS has three readers: xtask::measure writes the manifest from it, uefi_loader's build refuses an unsealed pair against it, and inspect reads a card with it. With one list, a kernel cannot measure a name the checkers do not know about, which would be invisible to them. It holds progenitor alone, and inspect reads it as the one program every archive must carry. Milestone 19 (run a real workload)'s six ELF child builders, which kernel::user::spawn_elf_child_builder enters for the system tests, are not on it: the kernel measures each through the archive's table, so the table's own check in inspect covers them.

What it cannot see