linux/drivers/firmware
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
..
arm_scmi firmware: arm_scmi/perf: Replace zero-length array with flexible-array member 2020-02-20 17:12:24 +00:00
broadcom ioremap changes for 5.6 2020-01-27 13:03:00 -08:00
efi efi/x86: Don't blow away existing initrd 2020-05-28 14:18:43 +02:00
google firmware: google: Probe for a GSMI handler in firmware 2020-01-14 21:46:48 +01:00
imx firmware: imx: fix compile-testing 2020-04-17 09:57:44 +02:00
meson firmware: meson_sm: Add secure power domain support 2020-02-14 11:37:34 -08:00
psci firmware: psci: Replace cpu_up/down() with add/remove_cpu() 2020-03-25 12:59:37 +01:00
tegra firmware: tegra: Fix a typo in Kconfig 2020-02-17 08:54:09 +01:00
xilinx firmware: xilinx: make firmware_debugfs_root static 2020-04-15 10:25:20 +02:00
arm_scpi.c firmware: arm_scpi: Replace zero-length array with flexible-array member 2020-02-20 17:13:59 +00:00
arm_sdei.c firmware: arm_sdei: clean up sdei_event_create() 2020-02-27 17:14:18 +00:00
dmi-id.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 191 2019-05-30 11:29:21 -07:00
dmi-sysfs.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
dmi_scan.c firmware: dmi: Add macro SMBIOS_ENTRY_POINT_SCAN_START 2020-03-23 15:44:04 +01:00
edd.c edd: Use scnprintf() for avoiding potential buffer overflow 2020-04-02 20:42:29 +02:00
iscsi_ibft.c iscsi_ibft: Don't limits Targets and NICs to two 2020-01-12 13:16:04 -05:00
iscsi_ibft_find.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 287 2019-06-05 17:36:37 +02:00
Kconfig firmware: intel_stratix10_service: add depend on agilex 2020-03-18 12:24:18 +01:00
Makefile firmware: qcom_scm: Dynamically support SMCCC and legacy conventions 2020-01-07 22:14:43 -08:00
memmap.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 287 2019-06-05 17:36:37 +02:00
pcdp.c efi/ia64: Move HCDP and MPS table handling into IA64 arch code 2020-02-23 21:59:42 +01:00
pcdp.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
qcom_scm-legacy.c firmware: qcom_scm: Dynamically support SMCCC and legacy conventions 2020-01-07 22:14:43 -08:00
qcom_scm-smc.c firmware: qcom_scm: Dynamically support SMCCC and legacy conventions 2020-01-07 22:14:43 -08:00
qcom_scm.c firmware: qcom_scm: Dynamically support SMCCC and legacy conventions 2020-01-07 22:14:43 -08:00
qcom_scm.h firmware: qcom_scm: Dynamically support SMCCC and legacy conventions 2020-01-07 22:14:43 -08:00
qemu_fw_cfg.c media: headers: fix linux/mod_devicetable.h inclusions 2018-08-02 18:30:54 -04:00
raspberrypi.c firmware: raspberrypi: register clk device 2019-06-25 16:04:26 -07:00
scpi_pm_domain.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 201 2019-05-30 11:29:52 -07:00
stratix10-rsu.c firmware: Fix incompatible function behavior for RSU driver 2019-11-14 13:11:32 +08:00
stratix10-svc.c firmware: stratix10-svc: add the compatible value for intel agilex 2020-03-18 12:24:18 +01:00
ti_sci.c firmware: ti_sci: Allow for device shared and exclusive requests 2019-09-04 20:44:33 +02:00
ti_sci.h ARM: SoC-related driver updates 2019-07-19 17:13:56 -07:00
trusted_foundations.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
turris-mox-rwtm.c firmware: turris-mox-rwtm: small white space cleanup 2020-01-08 10:35:23 +01:00