Bug 2561554
| Summary: | systemd-bootx64.efi is signed with a self-signed certificate | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | kompost <lars.bohl> |
| Component: | systemd-boot | Assignee: | Zbigniew Jędrzejewski-Szmek <zbyszek> |
| Status: | NEW --- | QA Contact: | |
| Severity: | high | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 45 | CC: | amessina, fedora, jeremy.linton, kraxel, zbyszek |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | --- | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | Type: | --- | |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
kompost
2026-10-27 07:01:46 UTC
Yeah, that is intended. There was no agreement to sign systemd-boot with the real key integrated in the normal SecureBoot hierarchy. The idea here is that people can do self-enrollment of the certificate and then used systemd-boot after that. At some point we'll want to change this, but for now, things are as they are. Yes, thank you. I've been reading the forge thread again, and indeed, this is the intended outcome. Some users may have expected the "real thing" though, a signed sdboot that works "same as grub" and gets installed right away when you pass "inst.sdboot" to the Everything- (or Server-) installer. Is there another bugzilla to track these requirements? In this case, please close this bugzilla as a duplicate. I understand, at least for f45, we have to enroll a new certificate in our secureboot "db". Is there a convenient location where we can download the new certificate, or do we have to extract it from the rpm first? Not afaik, I've got a bit of code which actually was generating a key, signing the unsigned systemd-boot, and enrolling it and the fedora key so the kernel also is accepted, but if we sign them with the same key then all that is needed is enrolling the key, but... its sorta sketchy to do automatically. Maybe the sdubby package should include a "enroll-sdboot-keys.sh" script or similar, then the user can enroll them after the first boot, and take the machine out of setup mode. Another thing came up. Apparently there are two different "interpretations" of secureboot, and only one of them can be made to accept a self-signed certificate (unless one signs the kernel, too). See "Background" below. In practice this means we have to disable secureboot on some devices. (And by the way, grub is still not possible, because of grub's unresolved problem with tpm and measured boot, see https://bugzilla.redhat.com/show_bug.cgi?id=1975891). Background: We are using a "systemd-bootx64.efi.signed" which is signed by our own "my-db" key. "my-db" is enrolled and signed by "my-KEK", which is signed by our self-signed "my-PK". So we are already using "customized secureboot keys". Our kernel however is not signed with "my-db". We're using the stock fedora kernel, which is signed by "fedoraca". Fedoraca is also enrolled (also signed by "my-KEK"), so this boots successfully with secureboot enabled (on lenovo). Here's a the picture of our boot process: EFI ==> systemd-bootx64.efi ==> kernel (contains my-db AND fedoraca) (signed by my-db) (signed by fedoraca) The problem, as far as we understand it: There are two DIFFERENT signers in this boot chain. Apparently on some devices, this is rejected by their secureboot implementation. On said devices, we still get to the sdboot boot-menu. But then the kernel does *not* boot, we get a secureboot violation error. Some (or all) of our fujitsu laptops seem to be affected by this. By contrast, the boot process DOES work on some (or all) lenovo laptops. So far, none of the possible solutions are very tempting: * install windows on the fujitsu laptops (unironically this could be the most feasible route, considering the alternatives below) * disable measured boot, switch to grub (major hurdle, not only because we'd have to securely distribute the disk encryption key to users) * get rid of full disk encryption on fujitsu, use plain partitions (can't do this because of regulations) * disable secure boot on fujitsu (can't do this, regulations) * contact fujitsu, hope for bios update (pray) * create a redhat bugzilla (they won't ignore it, if it has high priority, right? ;) * sign the kernel with my-db too (major hurdle because we'd have to sign every kernel update, we don't have the infra for that) placing shim.efi in the loop might get around the firmware bugs, i.e. EFI -> shim -> sdboot -> kernel also you can just add the fedora signer certificate to 'db' instead of re-signing with your own key. It took a while to put the shim in our boot chain, but this was the solution. It is working fine now, both on Lenovo and Fujitsu. Thanks for nudging us in the right direction. This github issue was also helpful: https://github.com/systemd/systemd/issues/27234 Anyways, we still had generate and enroll our own keys and sign systemd-bootx64.efi (from systemd-boot-unsigned). Not exactly a smooth ride compared to grub. How do we improve this? Bake the current self-signed key into shim? Or sign systemd-bootx64.efi with kernel-signer? kraxel@fedora ~# sudo dnf install virt-firmware kraxel@fedora ~# pe-inspect --extract /usr/lib/systemd/boot/efi/systemd-bootx64.efi.signed # file: /usr/lib/systemd/boot/efi/systemd-bootx64.efi.signed # header: size=0x400 imagesize=0x2e000 nx-compat=yes # section: file 0x00000400 +0x00007800 virt 0x00001000 +0x000077b1 r-- (.rodata) # section: file 0x00007c00 +0x0001e400 virt 0x00009000 +0x0001e2a6 r-x (.text) # section: file 0x00026000 +0x00001000 virt 0x00028000 +0x00000ee0 r-- (.rodata) # section: file 0x00027000 +0x00000200 virt 0x00029000 +0x000000f8 rw- (.data) # section: file 0x00027200 +0x00000200 virt 0x0002a000 +0x000000e5 r-- (.sbat) # sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md # systemd-boot,1,The systemd Developers,systemd,262,https://systemd.io/ # systemd-boot.fedora,1,Fedora Linux,systemd,262-1.fc45,https://bugzilla.redhat.com/ # section: file 0x00027400 +0x00000200 virt 0x0002b000 +0x0000002d r-- (.sdmagic) # #### LoaderInfo: systemd-boot 262-1.fc45 #### # section: file 0x00027600 +0x00000200 virt 0x0002c000 +0x00000044 r-- (.osrel) # section: file 0x00027800 +0x00000200 virt 0x0002d000 +0x000000a4 r-- (.reloc) # sigdata: addr 0x00027a00 +0x00000a40 # signature: len 0xa3f, type 0x2 # >>> systemd-bootx64.efi.signed.sig1 # certificate # subject CN: fedora-signer-20250530 # issuer CN: fedora-ca-20250530 # >>> fedorasigner20250530.pem ^^^^^^^^^^^^^^^^^^^^^^^^ enroll this in 'db' |