linux_dsm_epyc7002/drivers/firmware/efi/libstub
Arvind Sankar e9524fb97a efi/x86: Don't blow away existing initrd
Commit

  987053a300 ("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: 987053a300 ("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
2020-05-28 14:18:43 +02:00
..
alignedmem.c efi/libstub: Add API function to allocate aligned memory 2020-04-24 14:52:16 +02:00
arm32-stub.c efi/libstub: Move pr_efi/pr_efi_err into efi namespace 2020-05-01 09:40:02 +02:00
arm64-stub.c efi/libstub: Move pr_efi/pr_efi_err into efi namespace 2020-05-01 09:40:02 +02:00
efi-stub-helper.c efi/libstub: Use pool allocation for the command line 2020-05-22 17:05:08 +02:00
efi-stub.c More EFI changes for v5.8: 2020-05-25 15:11:14 +02:00
efistub.h More EFI changes for v5.8: 2020-05-25 15:11:14 +02:00
fdt.c efi/libstub: Move pr_efi/pr_efi_err into efi namespace 2020-05-01 09:40:02 +02:00
file.c efi/libstub: Use %ls for filename 2020-05-20 19:09:20 +02:00
gop.c efi/gop: Add an option to list out the available GOP modes 2020-05-20 19:09:20 +02:00
hidden.h efi/libstub: Use hidden visibility for all source files 2020-02-23 21:57:12 +01:00
Makefile efi/libstub: Optimize for size instead of speed 2020-05-19 10:30:52 +02:00
mem.c Linux 5.7-rc7 2020-05-25 15:10:37 +02:00
pci.c efi/libstub: Correct comment typos 2020-05-06 11:27:55 +02:00
random.c efi/libstub: Describe RNG functions 2020-02-23 21:57:19 +01:00
randomalloc.c efi/libstub/random: Increase random alloc granularity 2020-04-23 20:15:06 +02:00
relocate.c efi/libstub: Correct comment typos 2020-05-06 11:27:55 +02:00
secureboot.c efi/libstub: Move pr_efi/pr_efi_err into efi namespace 2020-05-01 09:40:02 +02:00
skip_spaces.c efi/libstub: Clean up command line parsing routine 2020-02-23 21:57:15 +01:00
string.c efi/libstub: Clean up command line parsing routine 2020-02-23 21:57:15 +01:00
tpm.c More EFI changes for v5.8: 2020-05-25 15:11:14 +02:00
vsprintf.c efi/printf: Add support for wchar_t (UTF-16) 2020-05-20 19:09:20 +02:00
x86-stub.c efi/x86: Don't blow away existing initrd 2020-05-28 14:18:43 +02:00