Skip to content

Commit f57fb37

Browse files
committed
efi: libstub: Remove zboot signing from build options
The zboot decompressor series introduced a feature to sign the PE/COFF kernel image for secure boot as part of the kernel build. This was necessary because there are actually two images that need to be signed: the kernel with the EFI stub attached, and the decompressor application. This is a bit of a burden, because it means that the images must be signed on the the same system that performs the build, and this is not realistic for distros. During the next cycle, we will introduce changes to the zboot code so that the inner image no longer needs to be signed. This means that the outer PE/COFF image can be handled as usual, and be signed later in the release process. Let's remove the associated Kconfig options now so that they don't end up in a LTS release while already being deprecated. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
1 parent 9abf231 commit f57fb37

File tree

2 files changed

+4
-47
lines changed

2 files changed

+4
-47
lines changed

drivers/firmware/efi/Kconfig

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -124,28 +124,6 @@ config EFI_ZBOOT
124124
is supported by the encapsulated image. (The compression algorithm
125125
used is described in the zboot image header)
126126

127-
config EFI_ZBOOT_SIGNED
128-
def_bool y
129-
depends on EFI_ZBOOT_SIGNING_CERT != ""
130-
depends on EFI_ZBOOT_SIGNING_KEY != ""
131-
132-
config EFI_ZBOOT_SIGNING
133-
bool "Sign the EFI decompressor for UEFI secure boot"
134-
depends on EFI_ZBOOT
135-
help
136-
Use the 'sbsign' command line tool (which must exist on the host
137-
path) to sign both the EFI decompressor PE/COFF image, as well as the
138-
encapsulated PE/COFF image, which is subsequently compressed and
139-
wrapped by the former image.
140-
141-
config EFI_ZBOOT_SIGNING_CERT
142-
string "Certificate to use for signing the compressed EFI boot image"
143-
depends on EFI_ZBOOT_SIGNING
144-
145-
config EFI_ZBOOT_SIGNING_KEY
146-
string "Private key to use for signing the compressed EFI boot image"
147-
depends on EFI_ZBOOT_SIGNING
148-
149127
config EFI_ARMSTUB_DTB_LOADER
150128
bool "Enable the DTB loader"
151129
depends on EFI_GENERIC_STUB && !RISCV && !LOONGARCH

drivers/firmware/efi/libstub/Makefile.zboot

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,11 @@ zboot-size-len-y := 4
2020
zboot-method-$(CONFIG_KERNEL_GZIP) := gzip
2121
zboot-size-len-$(CONFIG_KERNEL_GZIP) := 0
2222

23-
quiet_cmd_sbsign = SBSIGN $@
24-
cmd_sbsign = sbsign --out $@ $< \
25-
--key $(CONFIG_EFI_ZBOOT_SIGNING_KEY) \
26-
--cert $(CONFIG_EFI_ZBOOT_SIGNING_CERT)
27-
28-
$(obj)/$(EFI_ZBOOT_PAYLOAD).signed: $(obj)/$(EFI_ZBOOT_PAYLOAD) FORCE
29-
$(call if_changed,sbsign)
30-
31-
ZBOOT_PAYLOAD-y := $(EFI_ZBOOT_PAYLOAD)
32-
ZBOOT_PAYLOAD-$(CONFIG_EFI_ZBOOT_SIGNED) := $(EFI_ZBOOT_PAYLOAD).signed
33-
34-
$(obj)/vmlinuz: $(obj)/$(ZBOOT_PAYLOAD-y) FORCE
23+
$(obj)/vmlinuz: $(obj)/$(EFI_ZBOOT_PAYLOAD) FORCE
3524
$(call if_changed,$(zboot-method-y))
3625

3726
OBJCOPYFLAGS_vmlinuz.o := -I binary -O $(EFI_ZBOOT_BFD_TARGET) \
38-
--rename-section .data=.gzdata,load,alloc,readonly,contents
27+
--rename-section .data=.gzdata,load,alloc,readonly,contents
3928
$(obj)/vmlinuz.o: $(obj)/vmlinuz FORCE
4029
$(call if_changed,objcopy)
4130

@@ -53,18 +42,8 @@ LDFLAGS_vmlinuz.efi.elf := -T $(srctree)/drivers/firmware/efi/libstub/zboot.lds
5342
$(obj)/vmlinuz.efi.elf: $(obj)/vmlinuz.o $(ZBOOT_DEPS) FORCE
5443
$(call if_changed,ld)
5544

56-
ZBOOT_EFI-y := vmlinuz.efi
57-
ZBOOT_EFI-$(CONFIG_EFI_ZBOOT_SIGNED) := vmlinuz.efi.unsigned
58-
59-
OBJCOPYFLAGS_$(ZBOOT_EFI-y) := -O binary
60-
$(obj)/$(ZBOOT_EFI-y): $(obj)/vmlinuz.efi.elf FORCE
45+
OBJCOPYFLAGS_vmlinuz.efi := -O binary
46+
$(obj)/vmlinuz.efi: $(obj)/vmlinuz.efi.elf FORCE
6147
$(call if_changed,objcopy)
6248

6349
targets += zboot-header.o vmlinuz vmlinuz.o vmlinuz.efi.elf vmlinuz.efi
64-
65-
ifneq ($(CONFIG_EFI_ZBOOT_SIGNED),)
66-
$(obj)/vmlinuz.efi: $(obj)/vmlinuz.efi.unsigned FORCE
67-
$(call if_changed,sbsign)
68-
endif
69-
70-
targets += $(EFI_ZBOOT_PAYLOAD).signed vmlinuz.efi.unsigned

0 commit comments

Comments
 (0)