Repository navigation
Correct the Secure Boot db enrolment table from measurement - #148
Merged
Merged
Conversation
The table said an OS-side enrolment "needs PK, KEK and db", and that a Setup Mode write is "unauthenticated". Both were mechanism-based reasoning, which issue 1267 was opened to check. Measured against edk2-ovmf under QEMU with SMM, writing through efivarfs in both Setup and User Mode: - "Unauthenticated" means the signature is not *verified*, not that the update is unsigned. A raw .esl/.der write is EINVAL even in Setup Mode -- the authenticated-variable wrapper is always required. That is the real reason a firmware picker takes MOK.der while FOG ships .auth files. - db alone, with no PK anywhere, lands and survives a reboot -- and leaves the platform in Setup Mode with SecureBoot=0. So "db alone" presupposes that the firmware or hypervisor supplies the PK. - In User Mode against a platform holding Microsoft's PK, writes to db, KEK and PK were all refused with EACCES. The OS route is not "three variables instead of one", it is closed; supplying all three is not a workaround. FOG's task works because it runs with the platform in Setup/Custom Mode, which is the same precondition as the firmware-menu row. - Once FOG's own PK and KEK are enrolled, a later db update from the OS is accepted on a KEK-signed update alone -- which is what the .auth files buy. Also confirmed FOG's own published PK/KEK/db.auth are well formed: written in Setup Mode they land and a reboot comes up SecureBoot=1. Physical firmware menus, PowerShell Set-SecureBootUEFI and BitLocker/PCR 7 remain untested, and the callouts still ask for those reports. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the measurement half of fogproject#1267.
The table in these two pages was mechanism-based reasoning from one measured
cell, and #1267 was opened to check it. I measured it. Two of its claims were
wrong, and the correction changes the advice.
Rig
QEMU 10.2.2,
q35,smm=on(SMM matters — it is what protects the varstore fromthe guest), edk2-ovmf 20260508, writing through
efivarfsfrom a Linux guest.Two starting states:
OVMF_VARS_4M.qcow2— no PK → Setup ModeOVMF_VARS_4M.secboot.qcow2— Microsoft's PK/KEK/db → User Mode, and a PKwhose private key I do not hold: the real-hardware situation
Every run produces successes and denials in the same boot, so a denial is
firmware policy rather than a broken rig.
What changed in the docs
1. "The write is unauthenticated" → unverified, not unsigned.
Setup Mode skips the signature check. It does not accept a bare certificate: a
raw
.esl/.derwrite todb, KEK or PK isEINVALeven in Setup Mode. Theauthenticated-variable wrapper is always required. This is the actual reason a
firmware file picker takes
MOK.der(it builds the wrapper) while FOG ships.authfiles (its task cannot).2. "A running OS needs PK, KEK and db" → the count was never the point.
EACCESEACCESEACCESEACCESEINVALEACCESEACCESEINVALOn a machine holding a vendor PK you do not control, you cannot write
db, KEKor PK. The route is closed, not "more expensive" — writing all three is not a
workaround. FOG's task works because it runs with the platform in Setup/Custom
Mode, which is the same precondition as the firmware-menu row. And once FOG's
own PK and KEK are enrolled, a later
dbupdate is accepted on a KEK-signedupdate alone — which is what the
.authfiles actually buy.3.
dbalone presupposes someone else supplies the PK.FOG's real
db.authwritten by itself lands (8494 bytes) and survives a reboot,and the platform stays in Setup Mode with
SecureBoot=0. Written together withan unrelated PK and no KEK at all, the reboot comes up
SecureBoot=1withFOG's certificate in
db— which is exactly the VMwaredbDefault.file0shape,now confirmed on a second platform.
Also confirmed
FOG's own published
PK.auth/KEK.auth/db.authare well formed: written inSetup Mode all three land, and the next boot is
SetupMode=0 SecureBoot=1.Still untested, and the callouts still ask for it
Physical firmware menus, PowerShell
Set-SecureBootUEFI, and whether changingthese variables trips BitLocker recovery in practice.
🤖 Generated with Claude Code