Merge tag 'efi-fixes-for-v6.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 24 Mar 2024 20:54:06 +0000 (13:54 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 24 Mar 2024 20:54:06 +0000 (13:54 -0700)
Pull EFI fixes from Ard Biesheuvel:

 - Fix logic that is supposed to prevent placement of the kernel image
   below LOAD_PHYSICAL_ADDR

 - Use the firmware stack in the EFI stub when running in mixed mode

 - Clear BSS only once when using mixed mode

 - Check efi.get_variable() function pointer for NULL before trying to
   call it

* tag 'efi-fixes-for-v6.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi:
  efi: fix panic in kdump kernel
  x86/efistub: Don't clear BSS twice in mixed mode
  x86/efistub: Call mixed mode boot services on the firmware's stack
  efi/libstub: fix efi_random_alloc() to allocate memory at alloc_min or higher address

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

index 57888614e90f16b34f1e8b9cedd1341eca0697e5,1edf93e638975cdad5f42dc2cb113e894149c5bd..6a6ffc6707bd0eb31e9dd13a995095760883e47c
@@@ -476,7 -476,8 +476,8 @@@ efi_status_t __efiapi efi_pe_entry(efi_
        efi_status_t status;
        char *cmdline_ptr;
  
-       memset(_bss, 0, _ebss - _bss);
+       if (efi_is_native())
+               memset(_bss, 0, _ebss - _bss);
  
        efi_system_table = sys_table_arg;
  
@@@ -897,9 -898,6 +898,9 @@@ void __noreturn efi_stub_entry(efi_hand
                }
        }
  
 +      if (efi_mem_encrypt > 0)
 +              hdr->xloadflags |= XLF_MEM_ENCRYPTION;
 +
        status = efi_decompress_kernel(&kernel_entry);
        if (status != EFI_SUCCESS) {
                efi_err("Failed to decompress kernel\n");