Skip to content

Commit

Permalink
Merge tag 'efi-fixes-for-v6.9-1' of git://git.kernel.org/pub/scm/linu…
Browse files Browse the repository at this point in the history
…x/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
  • Loading branch information
Linus Torvalds committed Mar 17, 2024
2 parents 8048ba2 + b3810c5 commit 906a93b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/firmware/efi/libstub/x86-stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include "efistub.h"
#include "x86-stub.h"

extern char _bss[], _ebss[];

const efi_system_table_t *efi_system_table;
const efi_dxe_services_table_t *efi_dxe_table;
static efi_loaded_image_t *image = NULL;
Expand Down Expand Up @@ -474,6 +476,8 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle,
efi_status_t status;
char *cmdline_ptr;

memset(_bss, 0, _ebss - _bss);

efi_system_table = sys_table_arg;

/* Check if we were booted by the EFI firmware */
Expand Down Expand Up @@ -970,8 +974,6 @@ void __noreturn efi_stub_entry(efi_handle_t handle,
void efi_handover_entry(efi_handle_t handle, efi_system_table_t *sys_table_arg,
struct boot_params *boot_params)
{
extern char _bss[], _ebss[];

memset(_bss, 0, _ebss - _bss);
efi_stub_entry(handle, sys_table_arg, boot_params);
}
Expand Down

0 comments on commit 906a93b

Please sign in to comment.