linux-brain/drivers/firmware
Ard Biesheuvel a2a380bcf4 efi/esrt: Only call efi_mem_reserve() for boot services memory
[ Upstream commit 61f0d55569 ]

The following commit:

  7e1550b8f2 ("efi: Drop type and attribute checks in efi_mem_desc_lookup()")

refactored the implementation of efi_mem_desc_lookup() so that the type
check is moved to the callers, one of which is the x86 version of
efi_arch_mem_reserve(), where we added a modified check that only takes
EFI_BOOT_SERVICES_DATA regions into account.

This is reasonable, since it is the only memory type that requires this,
but doing so uncovered some unexpected behavior in the ESRT code, which
permits the ESRT table to reside in other types of memory than what the
UEFI spec mandates (i.e., EFI_BOOT_SERVICES_DATA), and unconditionally
calls efi_mem_reserve() on the region in question. This may result in
errors such as

  esrt: Reserving ESRT space from 0x000000009c810318 to 0x000000009c810350.
  efi: Failed to lookup EFI memory descriptor for 0x000000009c810318

when the ESRT table is not in EFI_BOOT_SERVICES_DATA memory, but we try
to reserve it nonetheless.

So make the call to efi_mem_reserve() conditional on the memory type.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Jones <pjones@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-26 08:36:38 +02:00
..
broadcom tree-wide: replace config_enabled() with IS_ENABLED() 2016-08-04 08:50:07 -04:00
efi efi/esrt: Only call efi_mem_reserve() for boot services memory 2018-09-26 08:36:38 +02:00
google firmware-gsmi: Delete an unnecessary check before the function call "dma_pool_destroy" 2016-09-09 16:08:45 +01:00
meson firmware: Amlogic: Add secure monitor driver 2016-09-01 14:23:39 -07:00
arm_scpi.c firmware: arm_scpi: add missing of_node_put after calling of_parse_phandle 2016-08-08 14:31:09 +01:00
dcdbas.c dcdbas: Make use of smp_call_on_cpu() 2016-09-05 13:52:40 +02:00
dcdbas.h dcdbas: export functionality for use in other drivers 2009-01-08 08:31:12 -08:00
dell_rbu.c sysfs: add struct file* to bin_attr callbacks 2010-05-21 09:37:31 -07:00
dmi_scan.c firmware: dmi_scan: Fix handling of empty DMI strings 2018-05-30 07:50:24 +02:00
dmi-id.c dmi-id: don't free dev structure after calling device_register 2016-09-08 10:35:50 +02:00
dmi-sysfs.c firmware: dmi_scan: add SBMIOS entry and DMI tables 2015-06-25 09:06:56 +02:00
edd.c [SCSI] edd: Treat "XPRS" host bus type the same as "PCI" 2011-10-31 13:26:19 +04:00
iscsi_ibft_find.c efi: Make 'efi_enabled' a function to query EFI facilities 2013-01-30 11:51:59 -08:00
iscsi_ibft.c ibft: Expose iBFT acpi header via sysfs 2016-05-16 11:14:29 -04:00
Kconfig firmware: Amlogic: Add secure monitor driver 2016-09-01 14:23:39 -07:00
Makefile firmware: Amlogic: Add secure monitor driver 2016-09-01 14:23:39 -07:00
memmap.c drivers/firmware/memmap.c: fix kernel-doc format 2015-06-25 17:00:41 -07:00
pcdp.c serial: 8250_early: Remove setup_early_serial8250_console() 2015-03-26 17:25:27 +01:00
pcdp.h Update broken web addresses in the kernel. 2010-10-18 11:03:14 +02:00
psci.c firmware/psci: Expose SMCCC version through psci_ops 2018-04-20 08:21:05 +02:00
qcom_scm-32.c firmware: qcom: scm: Expose PAS command 10 as reset-controller 2016-06-24 22:53:52 -05:00
qcom_scm-64.c firmware: qcom: scm: Fix interrupted SCM calls 2017-04-12 12:41:21 +02:00
qcom_scm.c firmware: qcom_scm: make it explicitly non-modular 2016-08-23 15:46:32 -05:00
qcom_scm.h firmware: qcom: scm: Expose PAS command 10 as reset-controller 2016-06-24 22:53:52 -05:00
qemu_fw_cfg.c driver core update for 4.7-rc1 2016-05-20 21:26:15 -07:00
raspberrypi.c ARM: bcm2835: Add the Raspberry Pi firmware driver 2015-10-14 15:30:06 -07:00
scpi_pm_domain.c firmware: scpi: add device power domain support using genpd 2016-06-21 10:26:51 +01:00