2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/drivers/firmware/efi
Vitaly Kuznetsov f8b53cc917 efi: Fix .data section size calculations when .sbat is present
Commit 0f9a1739dd ("efi: zboot specific mechanism for embedding SBAT
section") neglected to adjust the sizes of the .data section when
CONFIG_EFI_SBAT_FILE is set. As the result, the produced PE binary is
incorrect and some tools complain about it. E.g. 'sbsign' reports:

 # sbsign --key my.key --cert my.crt arch/arm64/boot/vmlinuz.efi
 warning: file-aligned section .data extends beyond end of file
 warning: checksum areas are greater than image size. Invalid section table?

Note, '__data_size' is also used in the PE optional header and it is not
entirely clear whether .sbat needs to be accounted as part of
SizeOfInitializedData or not. As the header seems to be unused by the real
world firmware, keeping the field equal to __data_size.

Fixes: 0f9a1739dd ("efi: zboot specific mechanism for embedding SBAT section")
Reported-by: Heinrich Schuchardt <heinrich.schuchardt@gmx.de>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-06-20 13:36:14 +02:00
..
libstub efi: Fix .data section size calculations when .sbat is present 2025-06-20 13:36:14 +02:00
stmm efi: Add tee-based EFI variable driver 2023-12-11 11:19:18 +01:00
test efi/efi_test: Fix missing pending status update in getwakeuptime 2025-05-21 15:39:30 +02:00
apple-properties.c efi: fix return value of __setup handlers 2022-03-01 09:02:21 +01:00
arm-runtime.c efi: runtime: Fix potential overflow of soft-reserved region size 2024-02-02 19:31:24 +01:00
capsule-loader.c [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
capsule.c efi: capsule: clean scatter-gather entries from the D-cache 2020-12-09 08:37:27 +01:00
cper_cxl.c efi/cper, cxl: Remove cper_cxl.h 2025-02-06 11:27:16 -07:00
cper-arm.c efi/cper: Fix cper_arm_ctx_info alignment 2025-02-23 17:30:05 +01:00
cper-x86.c efi/cper: Fix cper_ia_proc_ctx alignment 2025-02-23 17:30:04 +01:00
cper.c efi/cper, cxl: Remove cper_cxl.h 2025-02-06 11:27:16 -07:00
dev-path-parser.c driver core: Constify API device_find_child() and adapt for various usages 2025-01-03 11:19:35 +01:00
earlycon.c fbcon: Increase maximum font width x height to 64 x 128 2024-03-16 08:29:48 +01:00
efi-bgrt.c
efi-init.c efi: Don't add memblocks for soft-reserved memory 2024-02-02 19:31:24 +01:00
efi-pstore.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
efi.c efi: Export symbol efi_mem_desc_lookup 2025-04-09 09:03:15 +02:00
efibc.c efi: efibc: change kmalloc(size * count, ...) to kmalloc_array() 2025-03-10 18:22:47 +01:00
embedded-firmware.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
esrt.c efi/esrt: remove esre_attribute::store() 2024-12-13 08:43:58 +01:00
fdtparams.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
Kconfig efi: zboot specific mechanism for embedding SBAT section 2025-05-21 15:31:42 +02:00
Makefile efi: Add tee-based EFI variable driver 2023-12-11 11:19:18 +01:00
memattr.c efi/memattr: Ignore table if the size is clearly bogus 2024-11-15 12:03:29 +01:00
memmap.c efi: Improve logging around memmap init 2025-05-09 11:07:28 +02:00
mokvar-table.c Linux 6.14-rc6 2025-03-10 17:37:25 +01:00
rci2-table.c efi: rci2: mark bin_attribute as __ro_after_init 2025-02-21 09:20:32 +01:00
reboot.c efi: Fix efi_power_off() not being run before acpi_power_off() when necessary 2022-07-10 17:41:06 +02:00
riscv-runtime.c riscv: dmi: Add SMBIOS/DMI support 2024-06-26 08:02:33 -07:00
runtime-wrappers.c efi: Add missing __nocfi annotations to runtime wrappers 2024-06-05 10:18:58 +02:00
sysfb_efi.c efi: sysfb_efi: fix W=1 warnings when EFI is not set 2025-01-14 08:35:28 +01:00
tpm.c tpm: fix unsigned/signed mismatch errors related to __calc_tpm2_event_size 2024-10-15 20:27:29 +02:00
unaccepted_memory.c mm: rework accept memory helpers 2024-09-01 20:26:07 -07:00
vars.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00