Commit 82c9bff
committed
dstack-mr: derive bootorder fw_cfg digest from the linuxboot ROM path
OVMF's `EV_PLATFORM_CONFIG_FLAGS` event for the `bootorder` fw_cfg key
hashes the raw fw_cfg blob (verified in
OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgCacheInit.c:208-228:
TpmMeasureAndLogData hashes ItemData, the fw_cfg buffer).
QEMU produces that blob in hw/i386/x86.c::x86_load_linux when `-kernel`
is in use: it appends a single option ROM (`linuxboot.bin` or
`linuxboot_dma.bin`, depending on whether fw_cfg DMA is enabled) with
`bootindex = 0`. dstack-vmm always uses q35, which enables fw_cfg DMA,
so the DMA variant ROM is used. No other dstack device gets an implicit
bootindex.
Confirmed by gdb-attaching the live dstack510 QEMU and calling
get_boot_devices_list() — it returned exactly
`/rom@genroms/linuxboot_dma.bin\0` (31 bytes), and sha384 of those bytes
equals the digest we'd captured before.
Replaces the previously-hardcoded `bootorder_fwcfg_hash` with that
derivation and removes the "if you change host_share_mode you must
recapture" warning — that condition isn't actually load-bearing for
this measurement.1 parent 5aac58f commit 82c9bff
1 file changed
Lines changed: 13 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
357 | 362 | | |
358 | 363 | | |
359 | 364 | | |
| |||
0 commit comments