linux-brain/drivers/firmware/efi
Marc Zyngier 379d8da335 firmware/efi: Tell memblock about EFI iomem reservations
commit 2bab693a608bdf614b9fcd44083c5100f34b9f77 upstream.

kexec_load_file() relies on the memblock infrastructure to avoid
stamping over regions of memory that are essential to the survival
of the system.

However, nobody seems to agree how to flag these regions as reserved,
and (for example) EFI only publishes its reservations in /proc/iomem
for the benefit of the traditional, userspace based kexec tool.

On arm64 platforms with GICv3, this can result in the payload being
placed at the location of the LPI tables. Shock, horror!

Let's augment the EFI reservation code with a memblock_reserve() call,
protecting our dear tables from the secondary kernel invasion.

Reported-by: Moritz Fischer <mdf@kernel.org>
Tested-by: Moritz Fischer <mdf@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: stable@vger.kernel.org
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: James Morse <james.morse@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-07-28 13:31:00 +02:00
..
libstub efi/libstub/x86: Work around LLVM ELF quirk build regression 2020-06-22 09:30:52 +02:00
test efi/efi_test: Lock down /dev/efi_test and require CAP_SYS_ADMIN 2019-10-31 09:40:21 +01:00
Kconfig efi: EFI_EARLYCON should depend on EFI 2020-12-02 08:49:53 +01:00
Makefile efi: Export Runtime Configuration Interface table to sysfs 2019-08-08 11:10:25 +03:00
apple-properties.c efi: Replace GPL license boilerplate with SPDX headers 2019-02-04 08:27:25 +01:00
arm-init.c efi: Replace GPL license boilerplate with SPDX headers 2019-02-04 08:27:25 +01:00
arm-runtime.c efi: Unify DMI setup code over the arm/arm64, ia64 and x86 architectures 2019-03-29 07:35:00 +01:00
capsule-loader.c efi: Replace GPL license boilerplate with SPDX headers 2019-02-04 08:27:25 +01:00
capsule.c efi: Replace GPL license boilerplate with SPDX headers 2019-02-04 08:27:25 +01:00
cper-arm.c efi: Replace GPL license boilerplate with SPDX headers 2019-02-04 08:27:25 +01:00
cper-x86.c efi: Decode IA32/X64 Context Info structure 2018-05-14 08:57:48 +02:00
cper.c efi: cper: fix snprintf() use in cper_dimm_err_location() 2021-06-10 13:37:03 +02:00
dev-path-parser.c bus_find_device: Unify the match callback with class_find_device 2019-06-24 05:22:31 +02:00
earlycon.c efi/earlycon: Fix write-combine mapping on x86 2020-01-23 08:22:38 +01:00
efi-bgrt.c efi/bgrt: Drop BGRT status field reserved bits check 2019-06-11 16:13:05 +02:00
efi-pstore.c efi: Replace GPL license boilerplate with SPDX headers 2019-02-04 08:27:25 +01:00
efi.c firmware/efi: Tell memblock about EFI iomem reservations 2021-07-28 13:31:00 +02:00
efibc.c efibc: Replace variable set function in notifier call 2019-06-22 10:24:57 +02:00
efivars.c efi/efivars: Add missing kobject_put() in sysfs entry creation error path 2020-06-17 16:40:26 +02:00
esrt.c efi/esrt: Fix reference count leak in esre_create_sysfs_entry. 2020-06-30 15:36:54 -04:00
fake_mem.c efi: Replace GPL license boilerplate with SPDX headers 2019-02-04 08:27:25 +01:00
memattr.c efi: Allow EFI_MEMORY_XP and EFI_MEMORY_RO both to be cleared 2021-06-10 13:37:02 +02:00
memmap.c efi/arm: Revert deferred unmap of early memmap mapping 2018-11-15 10:04:46 +01:00
rci2-table.c efi: Don't attempt to map RCI2 config table if it doesn't exist 2020-01-09 10:20:07 +01:00
reboot.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
runtime-map.c efi: Replace GPL license boilerplate with SPDX headers 2019-02-04 08:27:25 +01:00
runtime-wrappers.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 428 2019-06-05 17:37:16 +02:00
tpm.c efi/tpm: Differentiate missing and invalid final event log table. 2021-07-28 13:30:56 +02:00
vars.c efi: Replace GPL license boilerplate with SPDX headers 2019-02-04 08:27:25 +01:00