Skip to content

Commit 906a93b

Browse files
committed
Merge tag 'efi-fixes-for-v6.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi
Pull EFI fix from Ard Biesheuvel: "This fixes an oversight on my part in the recent EFI stub rework for x86, which is needed to get Linux/x86 distro builds signed again for secure boot by Microsoft. For this reason, most of this work is being backported to v6.1, which is therefore also affected by this regression. - Explicitly wipe BSS in the native EFI entrypoint, so that globals shared with the legacy decompressor are zero-initialized correctly" * tag 'efi-fixes-for-v6.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi: x86/efistub: Clear decompressor BSS in native EFI entrypoint
2 parents 8048ba2 + b3810c5 commit 906a93b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/firmware/efi/libstub/x86-stub.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
#include "efistub.h"
2222
#include "x86-stub.h"
2323

24+
extern char _bss[], _ebss[];
25+
2426
const efi_system_table_t *efi_system_table;
2527
const efi_dxe_services_table_t *efi_dxe_table;
2628
static efi_loaded_image_t *image = NULL;
@@ -474,6 +476,8 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle,
474476
efi_status_t status;
475477
char *cmdline_ptr;
476478

479+
memset(_bss, 0, _ebss - _bss);
480+
477481
efi_system_table = sys_table_arg;
478482

479483
/* Check if we were booted by the EFI firmware */
@@ -970,8 +974,6 @@ void __noreturn efi_stub_entry(efi_handle_t handle,
970974
void efi_handover_entry(efi_handle_t handle, efi_system_table_t *sys_table_arg,
971975
struct boot_params *boot_params)
972976
{
973-
extern char _bss[], _ebss[];
974-
975977
memset(_bss, 0, _ebss - _bss);
976978
efi_stub_entry(handle, sys_table_arg, boot_params);
977979
}

0 commit comments

Comments
 (0)