Open squarooticus opened 1 year ago
@grawity may find this one interesting.
@grawity: Andrei's comment checks out. It looks like the stub is measuring the kernel blob again, even if it's part of the EFI application that has already been measured by the firmware. Since this is a vendor-specific GUID, I'm guessing there will need to be explicit logic in tpm_futurepcr to simulate this.
This is complicated because the same device path is used no matter where the kernel comes from. For my purposes, it needs to objcopy -O binary --only-section=.linux loader.efi /tmp/kernel_image
and measure /tmp/kernel_image
because I create loaders with the kernel in the .linux
section... but this is hardly universal. It might need to replicate all of the stub's logic for finding the kernel to boot, which seems annoying at best.
I'm actually not sure whether I will continue maintaining tpm_futurepcr at all, as AFAIK systemd-measure
is supposed to do the same thing but with better compatibility.
In that case, I may maintain my own fork until and unless I decide to switch to systemd's EFI boot implementation. My main interest is in not losing access to remote sites when there's an extended power outage: reliability in booting without intervention is my first priority, the enemy of which is complexity (q.v. systemd).
Recent systemd EFI stubs have changed their behavior re: extending PCR 4 in a way that tpm_futurepcr doesn't handle (or at least handle in the naïve way this code leverages it). From an email exchange with Andrei Borzenkov on the systemd mailing list:
As a result, I have backed off to using the stub from systemd v247 until I can figure out how to get this working.