Kernel Update fails Secure Boot
Performed tdnf update on a Photon VM, which updated linux-esx to 4.19.87-5.ph3 Upon restarting the VM, the bootloader reports invalid signature on the primary and the fallback entries, performs a restart, and hangs at the boot splash screen. Escaping the boot splash screen will show that it's dropped into the GRUB shell.
It can be worked around by disabling Secure Boot setting on the Virtual Machine.
Same problem here!
Issue persists in 4.19.97-1.ph3
I downgraded to the 4.19.87-1 kernel to get back up and running with UEFI Secure Boot enabled, testing each version along the way. So far the following versions all fail to boot:
4.19.87-4 4.19.87-5 4.19.97-1
Seems support requests are not getting attention, I'll just fallback to more supported OS distro like CentOS.
Reason: Secure boot certificate in the virtual firmware has expired.
Solution: Now we sign kernel images with new key, and its certificate has to be added to firmware manually, as for now, here is a link: https://github.com/vmware/photon/wiki/Frequently-Asked-Questions#q-after-updating-Kernel-rpm-VM-fails-to-boot-with-secure-boot
@YustasSwamp thanks for the update. This sounds like it's going to need to be resolved through an update of the hosting ESXi-based product. (vSphere, Fusion, Workstation), is this already in the pipeline or should we be submitting support tickets for those products?
You are right. There are 2 possible solutions to resolve it.
- update of the hosting ESXi-based product, as you've mentioned - will be available soon.
- update Photon's shim to include new certificate - in process, there is some delay on shim-review side: https://github.com/rhboot/shim-review/issues/75
Thanks @YustasSwamp for the clarification and the workaround, I think you've put us all at ease explaining the problem, and letting us know there's a fix in the pipeline, and knowing that this ticket isn't just going to go stale.
Running into the same issue. Disabling secure boot seems not working (will be enabled automatically again :(
@Megachip try this:
- power off VM
- disable secure boot
- remove .nvram file in VM folder
- power on VM
This fixed it for me: https://github.com/vmware/photon/wiki/Frequently-Asked-Questions#q-after-updating-kernel-rpm-vm-fails-to-boot-with-secure-boot
That's a useful workaround, @ElanHasson, thanks! Unfortunately it doesn't scale well, so I'm still hoping for an ESXi update to land soon.
Fresh install of OVA, update... dead. That shouldn't happen :(
Agree. Fix here is to release new shim (with updated certificate) signed by UEFI CA. And it is blocked at shim-review stage for several months already ((
So, current workaround is to inject current certificate to the firmware as describer here: https://github.com/vmware/photon/wiki/Frequently-Asked-Questions#q-after-updating-Kernel-rpm-VM-fails-to-boot-with-secure-boot
The workaround in the FAQ did not resolve this for me. I had to disable secure boot by deleting these lines from the VMX file:
uefi.secureBoot.enabled = "TRUE"
uefi.secureBoot.dbDefault.file0 = "vmware_sb2017.der"
@mmlakin did you remove nvram file? What was the error, when it didn't boot?
Yes, I deleted the .nvram file every time I tried a change. It gives the same error as before:
error: /boot/vmlinuz-4.19.132-4.ph3-esx has invalid signature.
I downloaded the certificate file again, deleted and re-uploaded the modified .vmx file a few times, tried all this again after a successful boot with secure boot disabled, and every time it gives the same error. The only way I can get it to boot is with a .vmx file that doesn't contain the eufi.secureBoot parameters. I only set this up about a month ago using the hw13 OVA.
Thanks for update. We switched to different certificate because of BootHole issue. Will provide solution/update shortly.
@mmlakin bootloader binaries (with fixed BootHole vulnerability) have to be updated on your system Please follow updated instructions: https://github.com/vmware/photon/wiki/Frequently-Asked-Questions#q-after-updating-kernel-rpm-vm-fails-to-boot-with-secure-boot No needs to add vmware_sb2017.der certificate, but it does not harm.
Thanks for your quick responses!
Following those directions did not resolve my problem, and left me with an unbootable system. I restored from backup so I'm all good now.
First, wget was not found so I used curl -O instead, and the directory on my system was BOOT and not Boot as listed in the instructions. The shasum did change after replacing them with the newly downloaded binaries, but did not match the output in the instructions.
root@photon-machine [ ~ ]# cp bootx64.efi /boot/efi/EFI/BOOT
root@photon-machine [ ~ ]# cp grubx64.efi /boot/efi/EFI/BOOT
root@photon-machine [ ~ ]# sha256sum /boot/efi/EFI/Boot/*.efi
5559cec34ff09e7dc75e757cbf64f6a0655f24c4cbd825890abc66ea9c4c6fe3 /boot/efi/EFI/Boot/bootx64.efi
ff8c14de51ec089265ed14d8a97227226b1f866304241d34b824670dc7cfb609 /boot/efi/EFI/Boot/grubx64.efi
Also, I was able to download the dbxupdate, but when running the command I got the following error:
root@photon-machine [ ~ ]# dbxtool -a ./dbxupdate_x64.bin
dbxtool only supports timestamped updates
Since I had a recent backup, I rebooted just to test it and my system could no longer boot, even with secure boot disabled. No error message about signature this time, just a splash screen showing boot entries it tried, and then it showed a BIOS screen. I restored and tried the entire process again, for good measure, deleting the old .efi files and re-downloading them in place and got the same result. I've restored again and I'm just leaving secure boot off for now.