Skip to content

efi: support HP pre-OS PCR measurements - #556

Open
ebrig wants to merge 2 commits into
canonical:masterfrom
ebrig:hp-preboot-dma-pcr7
Open

efi: support HP pre-OS PCR measurements#556
ebrig wants to merge 2 commits into
canonical:masterfrom
ebrig:hp-preboot-dma-pcr7

Conversation

@ebrig

@ebrig ebrig commented Jul 26, 2026

Copy link
Copy Markdown

Summary

HP firmware can produce two pre-OS measurements that are not currently represented in generated EFI PCR profiles:

  • a vendor-defined PCR2 event after EV_SEPARATOR, but before the initial OS loader is authorized or launched
  • an EV_EFI_ACTION in PCR7 containing the enabled SVM and DMA protection configuration when additional DMA settings are measured to PCR7

This causes the generated profile to diverge from the TPM values and prevents a resealed key from unlocking normally.

This change:

  • replays vendor-defined PCR2 events only within the interval between the PCR2 separator and the first OS authorization or application launch
  • requires that an OS boundary is observed rather than accepting a truncated log
  • recognizes HP's exact enabled SVM/DMA/all-PCIe pre-boot protection event in PCR7
  • validates the PCR7 event digest and accepts the event only once, before Secure Boot configuration measurements
  • applies the same rules in profile generation and preinstall validation

Hardware validation

Tested on an HP ZBook Ultra G1a 14 inch Mobile Workstation PC with BIOS X89 01.05.07 (2026-05-05), using:

  • SVM CPU Virtualization: Enable
  • DMA protection: Enable
  • Pre-boot DMA protection: All PCIe devices
  • Measure Additional DMA Settings: PCR7

After resealing with the patched package, TPM-passphrase unlock succeeded across a reboot.

Tests

  • GOTOOLCHAIN=go1.23.12 ./run-tests --with-mssim
  • go build ./... with Go 1.18.10 and Go 1.23.12
  • go vet with Go 1.18.10 and Go 1.23.12
  • focused PCR2 and PCR7 tests with Go 1.18.10 and Go 1.23.12

Some firmware extends vendor-defined events into PCR2 after EV_SEPARATOR but before the initial OS loader is authorized or launched. Continue replaying those events within that pre-OS interval so generated profiles match the TPM, and apply the same boundary in preinstall validation.
@ebrig
ebrig marked this pull request as ready for review July 26, 2026 12:57
@ebrig

ebrig commented Jul 26, 2026

Copy link
Copy Markdown
Author

@chrisccoulson @valentindavid, would either of you be able to review this when you have a chance?

HP firmware can measure enabled SVM and DMA protection settings into PCR7 as an EV_EFI_ACTION before the Secure Boot variables. Recognize only the exact protected configuration, validate its digest, replay it once in the profile, and mirror the acceptance rule in preinstall validation.
@ebrig
ebrig force-pushed the hp-preboot-dma-pcr7 branch from 71236d4 to ef00edc Compare July 26, 2026 13:42
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