linux-stable/drivers/firmware
Borislav Petkov 06a9092f66 efi/mokvar: Reserve the table only if it is in boot services data
[ Upstream commit 47e1e233e9 ]

One of the SUSE QA tests triggered:

  localhost kernel: efi: Failed to lookup EFI memory descriptor for 0x000000003dcf8000

which comes from x86's version of efi_arch_mem_reserve() trying to
reserve a memory region. Usually, that function expects
EFI_BOOT_SERVICES_DATA memory descriptors but the above case is for the
MOKvar table which is allocated in the EFI shim as runtime services.

That lead to a fix changing the allocation of that table to boot services.

However, that fix broke booting SEV guests with that shim leading to
this kernel fix

  8d651ee9c7 ("x86/ioremap: Map EFI-reserved memory as encrypted for SEV")

which extended the ioremap hint to map reserved EFI boot services as
decrypted too.

However, all that wasn't needed, IMO, because that error message in
efi_arch_mem_reserve() was innocuous in this case - if the MOKvar table
is not in boot services, then it doesn't need to be reserved in the
first place because it is, well, in runtime services which *should* be
reserved anyway.

So do that reservation for the MOKvar table only if it is allocated
in boot services data. I couldn't find any requirement about where
that table should be allocated in, unlike the ESRT which allocation is
mandated to be done in boot services data by the UEFI spec.

Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-08-08 09:05:23 +02:00
..
arm_scmi firmware: arm_scmi: Fix range check for the maximum number of pending messages 2021-07-31 08:16:12 +02:00
broadcom
efi efi/mokvar: Reserve the table only if it is in boot services data 2021-08-08 09:05:23 +02:00
google
imx firmware: imx: select SOC_BUS to fix firmware build 2021-02-03 23:28:46 +01:00
meson
psci
smccc
tegra firmware: tegra: bpmp: Fix Tegra234-only builds 2021-07-25 14:36:15 +02:00
xilinx firmware: xilinx: Fix dereferencing freed memory 2021-05-14 09:50:05 +02:00
arm_scpi.c firmware: arm_scpi: Prevent the ternary sign expansion bug 2021-05-26 12:06:47 +02:00
arm_sdei.c
dmi-id.c
dmi-sysfs.c
dmi_scan.c
edd.c
iscsi_ibft.c
iscsi_ibft_find.c
Kconfig firmware: arm_scmi: Add SMCCC discovery dependency in Kconfig 2021-07-25 14:36:14 +02:00
Makefile
memmap.c
pcdp.c
pcdp.h
qcom_scm-legacy.c
qcom_scm-smc.c firmware: qcom_scm: Reduce locking section for __get_convention() 2021-05-14 09:50:14 +02:00
qcom_scm.c firmware: qcom_scm: Workaround lack of "is available" call on SC7180 2021-05-14 09:50:14 +02:00
qcom_scm.h firmware: qcom_scm: Reduce locking section for __get_convention() 2021-05-14 09:50:14 +02:00
qemu_fw_cfg.c qemu_fw_cfg: Make fw_cfg_rev_attr a proper kobj_attribute 2021-07-19 09:44:59 +02:00
raspberrypi.c
scpi_pm_domain.c
stratix10-rsu.c
stratix10-svc.c firmware: stratix10-svc: Fix a resource leak in an error handling path 2021-07-14 16:56:39 +02:00
ti_sci.c ARM: SoC-related driver updates 2020-10-24 10:39:22 -07:00
ti_sci.h
trusted_foundations.c
turris-mox-rwtm.c firmware: turris-mox-rwtm: add marvell,armada-3700-rwtm-firmware compatible string 2021-07-25 14:36:17 +02:00