The EFI changes for this cycle are:

 - preliminary changes for RISC-V
 - Add support for setting the resolution on the EFI framebuffer
 - Simplify kernel image loading for arm64
 - Move .bss into .data via the linker script instead of relying on symbol
   annotations.
 - Get rid of __pure getters to access global variables
 - Clean up the config table matching arrays
 - Rename pr_efi/pr_efi_err to efi_info/efi_err, and use them consistently
 - Simplify and unify initrd loading
 - Parse the builtin command line on x86 (if provided)
 - Implement printk() support, including support for wide character strings
 - Simplify GDT handling in early mixed mode thunking code
 - Some other minor fixes and cleanups

Signed-off-by: Ingo Molnar <mingo@kernel.org>
efi/x86: Don't blow away existing initrd

Commit

  987053a30016 ("efi/x86: Move command-line initrd loading to efi_main")

moved the command-line initrd loading into efi_main(), with a check
to ensure that it was attempted only if the EFI stub was booted via
efi_pe_entry rather than the EFI handover entry.

However, in the case where it was booted via handover entry, and thus an
initrd may have already been loaded by the bootloader, it then wrote 0
for the initrd address and size, removing any existing initrd.

Fix this by checking if size is positive before setting the fields in
the bootparams structure.

Fixes: 987053a30016 ("efi/x86: Move command-line initrd loading to efi_main")
Reported-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Tested-by: Dan Williams <dan.j.williams@intel.com>
Link: https://lkml.kernel.org/r/20200527232602.21596-1-nivedita@alum.mit.edu
1 file changed