1
0
Fork 0
remarkable-linux/drivers/firmware
Ard Biesheuvel 7fd683812e 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:38:10 +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:38:10 +02:00
google firmware: vpd: Fix section enabled flag on vpd_section_destroy 2018-09-19 22:43:40 +02:00
meson firmware: meson-sm: Allow 0 as valid return value 2017-03-23 12:22:40 -07:00
tegra firmware: tegra: set drvdata earlier 2017-08-17 13:08:08 +02:00
Kconfig firmware: arm_scpi: Add hardware dependencies 2017-01-30 21:09:43 -08:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
arm_scpi.c ARM SCPI fixes for v4.14 2017-08-24 15:51:54 +02:00
dcdbas.c firmware/dcdbas: Constify attribute_group structures 2017-08-21 09:43:51 +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-id.c firmware: dmi: Fix permissions of product_family 2017-06-15 13:46:01 +02:00
dmi-sysfs.c x86, mpparse, x86/acpi, x86/PCI, x86/dmi, SFI: Use memremap() for RAM mappings 2017-07-18 11:37:58 +02:00
dmi_scan.c firmware: dmi_scan: Fix UUID length safety check 2018-05-30 07:52:22 +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.c ibft: Expose iBFT acpi header via sysfs 2016-05-16 11:14:29 -04:00
iscsi_ibft_find.c efi: Make 'efi_enabled' a function to query EFI facilities 2013-01-30 11:51:59 -08:00
memmap.c drivers/firmware/memmap.c: fix kernel-doc format 2015-06-25 17:00:41 -07:00
pcdp.c x86, mpparse, x86/acpi, x86/PCI, x86/dmi, SFI: Use memremap() for RAM mappings 2017-07-18 11:37:58 +02: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-02-16 20:22:56 +01:00
psci_checker.c sched/headers: Prepare for new header dependencies before moving code to <uapi/linux/sched/types.h> 2017-03-02 08:42:27 +01:00
qcom_scm-32.c firmware: qcom_scm: add two scm calls for iommu secure page table 2017-03-28 16:03:21 -05:00
qcom_scm-64.c firmware: qcom_scm: add two scm calls for iommu secure page table 2017-03-28 16:03:21 -05:00
qcom_scm.c firmware: qcom_scm: add two scm calls for iommu secure page table 2017-03-28 16:03:21 -05:00
qcom_scm.h firmware: qcom_scm: add two scm calls for iommu secure page table 2017-03-28 16:03:21 -05:00
qemu_fw_cfg.c fw_cfg: fix driver remove 2018-08-17 21:01:11 +02: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
ti_sci.c firmware: ti_sci: fix strncat length check 2017-05-19 10:31:36 +02:00
ti_sci.h firmware: ti_sci: Add support for reboot core service 2016-10-27 12:09:12 +03:00