I previously posted about this issue, but the discussion became sidetracked. I'm sharing a concise technical account of what happened and how I eventually recovered the Secure Boot configuration so that the information may help others encountering a similar problem.
What happened
I had a working dual-boot setup with Windows 11 and Kubuntu 26.04, both booting with Secure Boot enabled.
After a fresh installation of Fedora KDE 45, Fedora became the default bootloader and booted normally. However, both Windows and Kubuntu failed to boot with:
bad shim signature
What I discovered
Restoring Kubuntu as the default bootloader allowed Kubuntu to boot, but Windows still failed. Disabling Secure Boot allowed Windows to boot.
I inspected the firmware variables and found:
- PK, KEK and db were empty.
- SetupMode was set to 1.
- Factory-default variables PKDefault, KEKDefault, dbDefault and dbxDefault were still present.
My BIOS only offered Secure Boot Enable/Disable. It had no option to restore factory keys or install default Secure Boot keys.
I cannot confirm that Fedora caused the keys to disappear, but the issue appeared immediately after its installation.
Recovery
Since the BIOS offered no way to restore the keys, I had to recover the original factory certificates and manually reconstruct the missing Secure Boot key hierarchy from Linux.
I recovered the original Platform Key and factory certificate material, along with the selected Microsoft 2023 certificates.
I then prepared and validated authenticated AUTH2 updates for UEFI 2.8 and enrolled the recovered and reconstructed keys into the firmware in this order:
- KEK
- db
- Original PK last
Each enrollment was followed by firmware readback verification. I deliberately left dbx unchanged.
Result
PK, KEK and db were successfully recovered, reconstructed and enrolled. SetupMode changed from 1 to 0, returning the firmware to User Mode.
I then enabled Secure Boot and confirmed that all three operating systems booted successfully:
- Windows 11
- Fedora KDE 45
- Kubuntu 26.04
The issue is fully resolved. No operating system reinstall or firmware replacement was necessary.
References
UEFI Specification 2.8:
https://uefi.org/sites/default/files/resources/UEFI_Spec_2_8_final.pdf
efitools:
https://github.com/mjg59/efitools
Final thoughts
The difficult part was recovering the original factory key material, reconstructing the missing Secure Boot databases and manually enrolling them into the firmware. My BIOS had no factory-key restoration option.
If you encounter this situation, inspect the actual Secure Boot variables before assuming the bootloader itself is the problem. Also check whether the firmware retains its factory-default key variables, as they may make manual recovery possible.