From: Greg Kroah-Hartman Date: Sat, 18 Jan 2025 09:14:13 +0000 (+0100) Subject: 6.12-stable patches X-Git-Tag: v6.1.126~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3ddcde707f1bfb097fd1c5ad865464e9373cd2e9;p=thirdparty%2Fkernel%2Fstable-queue.git 6.12-stable patches added patches: efi-zboot-limit-compression-options-to-gzip-and-zstd.patch series --- diff --git a/queue-6.12/efi-zboot-limit-compression-options-to-gzip-and-zstd.patch b/queue-6.12/efi-zboot-limit-compression-options-to-gzip-and-zstd.patch new file mode 100644 index 0000000000..cf52b4b5e5 --- /dev/null +++ b/queue-6.12/efi-zboot-limit-compression-options-to-gzip-and-zstd.patch @@ -0,0 +1,82 @@ +From 0b2c29fb68f8bf3e87a9d88404aa6fdd486223e5 Mon Sep 17 00:00:00 2001 +From: Ard Biesheuvel +Date: Fri, 6 Dec 2024 11:41:40 +0100 +Subject: efi/zboot: Limit compression options to GZIP and ZSTD + +From: Ard Biesheuvel + +commit 0b2c29fb68f8bf3e87a9d88404aa6fdd486223e5 upstream. + +For historical reasons, the legacy decompressor code on various +architectures supports 7 different compression types for the compressed +kernel image. + +EFI zboot is not a compression library museum, and so the options can be +limited to what is likely to be useful in practice: + +- GZIP is tried and tested, and is still one of the fastest at + decompression time, although the compression ratio is not very high; + moreover, Fedora is already shipping EFI zboot kernels for arm64 that + use GZIP, and QEMU implements direct support for it when booting a + kernel without firmware loaded; + +- ZSTD has a very high compression ratio (although not the highest), and + is almost as fast as GZIP at decompression time. + +Reducing the number of options makes it less of a hassle for other +consumers of the EFI zboot format (such as QEMU today, and kexec in the +future) to support it transparently without having to carry 7 different +decompression libraries. + +Acked-by: Gerd Hoffmann +Signed-off-by: Ard Biesheuvel +Signed-off-by: Greg Kroah-Hartman +--- + drivers/firmware/efi/Kconfig | 4 ---- + drivers/firmware/efi/libstub/Makefile.zboot | 18 ++++++------------ + 2 files changed, 6 insertions(+), 16 deletions(-) + +--- a/drivers/firmware/efi/Kconfig ++++ b/drivers/firmware/efi/Kconfig +@@ -76,10 +76,6 @@ config EFI_ZBOOT + bool "Enable the generic EFI decompressor" + depends on EFI_GENERIC_STUB && !ARM + select HAVE_KERNEL_GZIP +- select HAVE_KERNEL_LZ4 +- select HAVE_KERNEL_LZMA +- select HAVE_KERNEL_LZO +- select HAVE_KERNEL_XZ + select HAVE_KERNEL_ZSTD + help + Create the bootable image as an EFI application that carries the +--- a/drivers/firmware/efi/libstub/Makefile.zboot ++++ b/drivers/firmware/efi/libstub/Makefile.zboot +@@ -12,22 +12,16 @@ quiet_cmd_copy_and_pad = PAD $@ + $(obj)/vmlinux.bin: $(obj)/$(EFI_ZBOOT_PAYLOAD) FORCE + $(call if_changed,copy_and_pad) + +-comp-type-$(CONFIG_KERNEL_GZIP) := gzip +-comp-type-$(CONFIG_KERNEL_LZ4) := lz4 +-comp-type-$(CONFIG_KERNEL_LZMA) := lzma +-comp-type-$(CONFIG_KERNEL_LZO) := lzo +-comp-type-$(CONFIG_KERNEL_XZ) := xzkern +-comp-type-$(CONFIG_KERNEL_ZSTD) := zstd22 +- + # in GZIP, the appended le32 carrying the uncompressed size is part of the + # format, but in other cases, we just append it at the end for convenience, + # causing the original tools to complain when checking image integrity. +-# So disregard it when calculating the payload size in the zimage header. +-zboot-method-y := $(comp-type-y)_with_size +-zboot-size-len-y := 4 ++comp-type-y := gzip ++zboot-method-y := gzip ++zboot-size-len-y := 0 + +-zboot-method-$(CONFIG_KERNEL_GZIP) := gzip +-zboot-size-len-$(CONFIG_KERNEL_GZIP) := 0 ++comp-type-$(CONFIG_KERNEL_ZSTD) := zstd ++zboot-method-$(CONFIG_KERNEL_ZSTD) := zstd22_with_size ++zboot-size-len-$(CONFIG_KERNEL_ZSTD) := 4 + + $(obj)/vmlinuz: $(obj)/vmlinux.bin FORCE + $(call if_changed,$(zboot-method-y)) diff --git a/queue-6.12/series b/queue-6.12/series new file mode 100644 index 0000000000..a2f60826d5 --- /dev/null +++ b/queue-6.12/series @@ -0,0 +1 @@ +efi-zboot-limit-compression-options-to-gzip-and-zstd.patch