WSL2-Linux-Kernel/drivers/firmware
Ard Biesheuvel f5390cd0b4 efi: runtime: avoid EFIv2 runtime services on Apple x86 machines
Aditya reports [0] that his recent MacbookPro crashes in the firmware
when using the variable services at runtime. The culprit appears to be a
call to QueryVariableInfo(), which we did not use to call on Apple x86
machines in the past as they only upgraded from EFI v1.10 to EFI v2.40
firmware fairly recently, and QueryVariableInfo() (along with
UpdateCapsule() et al) was added in EFI v2.00.

The only runtime service introduced in EFI v2.00 that we actually use in
Linux is QueryVariableInfo(), as the capsule based ones are optional,
generally not used at runtime (all the LVFS/fwupd firmware update
infrastructure uses helper EFI programs that invoke capsule update at
boot time, not runtime), and not implemented by Apple machines in the
first place. QueryVariableInfo() is used to 'safely' set variables,
i.e., only when there is enough space. This prevents machines with buggy
firmwares from corrupting their NVRAMs when they run out of space.

Given that Apple machines have been using EFI v1.10 services only for
the longest time (the EFI v2.0 spec was released in 2006, and Linux
support for the newly introduced runtime services was added in 2011, but
the MacbookPro12,1 released in 2015 still claims to be EFI v1.10 only),
let's avoid the EFI v2.0 ones on all Apple x86 machines.

[0] https://lore.kernel.org/all/6D757C75-65B1-468B-842D-10410081A8E4@live.com/

Cc: <stable@vger.kernel.org>
Cc: Jeremy Kerr <jk@ozlabs.org>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Reported-by: Aditya Garg <gargaditya08@live.com>
Tested-by: Orlando Chamberlain <redecorating@protonmail.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Tested-by: Aditya Garg <gargaditya08@live.com>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=215277
2022-01-23 10:31:27 +01:00
..
arm_ffa firmware: arm_ffa: Remove unused 'compat_version' variable 2021-10-26 12:46:15 +01:00
arm_scmi virtio: wrap config->reset calls 2022-01-14 18:50:52 -05:00
broadcom
cirrus firmware: cs_dsp: Clear core reset for cache 2022-01-05 13:53:53 +00:00
efi efi: runtime: avoid EFIv2 runtime services on Apple x86 machines 2022-01-23 10:31:27 +01:00
google firmware: Update Kconfig help text for Google firmware 2021-12-21 10:12:31 +01:00
imx
meson
psci firmware/psci: fix application of sizeof to pointer 2021-10-26 17:40:54 -05:00
smccc firmware: smccc: Fix check for ARCH_SOC_ID not implemented 2021-11-22 11:42:59 +01:00
tegra firmware: tegra: Fix error application of sizeof() to pointer 2021-10-18 16:04:01 +02:00
xilinx Char/Misc and other driver changes for 5.17-rc1 2022-01-14 16:02:28 +01:00
Kconfig Linux 5.15-rc6 2021-10-18 13:50:42 +01:00
Makefile
arm_scpi.c
arm_sdei.c
dmi-id.c
dmi-sysfs.c firmware: dmi-sysfs: use default_groups in kobj_type 2022-01-06 14:28:22 +01:00
dmi_scan.c
edd.c firmware: edd: remove empty default_attrs array 2022-01-06 14:28:42 +01:00
iscsi_ibft.c
iscsi_ibft_find.c
memmap.c firmware: memmap: use default_groups in kobj_type 2022-01-05 19:17:29 +01:00
pcdp.c
pcdp.h
qcom_scm-legacy.c
qcom_scm-smc.c
qcom_scm.c Revert "firmware: qcom: scm: Add support for MC boot address API" 2021-10-27 16:25:07 +02:00
qcom_scm.h Revert "firmware: qcom: scm: Add support for MC boot address API" 2021-10-27 16:25:07 +02:00
qemu_fw_cfg.c firmware: qemu_fw_cfg: remove sysfs entries explicitly 2022-01-14 18:50:52 -05:00
raspberrypi.c
scpi_pm_domain.c firmware: arm_scpi: Fix string overflow in SCPI genpd driver 2021-12-13 15:17:37 +01:00
stratix10-rsu.c
stratix10-svc.c exit/kthread: Have kernel threads return instead of calling do_exit 2021-10-29 14:31:33 -05:00
sysfb.c
sysfb_simplefb.c drivers/firmware: Add missing platform_device_put() in sysfb_create_simplefb 2022-01-06 15:47:45 +01:00
ti_sci.c firmware: ti_sci: rm: remove unneeded semicolon 2021-11-22 19:41:36 -06:00
ti_sci.h
trusted_foundations.c
turris-mox-rwtm.c