linux-stable/drivers/firmware
Guilherme G. Piccoli c6ce163bb8 firmware: google: Test spinlock on panic path to avoid lockups
[ Upstream commit 3e081438b8 ]

Currently the gsmi driver registers a panic notifier as well as
reboot and die notifiers. The callbacks registered are called in
atomic and very limited context - for instance, panic disables
preemption and local IRQs, also all secondary CPUs (not executing
the panic path) are shutdown.

With that said, taking a spinlock in this scenario is a dangerous
invitation for lockup scenarios. So, fix that by checking if the
spinlock is free to acquire in the panic notifier callback - if not,
bail-out and avoid a potential hang.

Fixes: 74c5b31c66 ("driver: Google EFI SMI")
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: David Gow <davidgow@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Julius Werner <jwerner@chromium.org>
Cc: Petr Mladek <pmladek@suse.com>
Reviewed-by: Evan Green <evgreen@chromium.org>
Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Link: https://lore.kernel.org/r/20220909200755.189679-1-gpiccoli@igalia.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-10-24 09:57:57 +02:00
..
arm_ffa firmware: arm_ffa: Remove incorrect assignment of driver_data 2022-04-29 14:51:46 +01:00
arm_scmi firmware: arm_scmi: Add SCMI PM driver remove routine 2022-10-12 09:51:23 +02:00
broadcom firmware: tee_bnxt: Use UUID API for exporting the UUID 2022-05-05 18:14:29 -07:00
cirrus firmware: cs_dsp: Fix overrun of unterminated control name string 2022-04-12 17:57:04 +01:00
efi efi: libstub: drop pointless get_memory_map() call 2022-10-24 09:56:58 +02:00
google firmware: google: Test spinlock on panic path to avoid lockups 2022-10-24 09:57:57 +02:00
imx firmware: imx: scu-pd: imx8q: add vpu mu resources 2022-02-20 14:55:32 +08:00
meson
psci firmware/psci: fix application of sizeof to pointer 2021-10-26 17:40:54 -05:00
smccc printk: stop including cache.h from printk.h 2022-05-13 07:20:07 -07:00
tegra firmware: tegra: bpmp: Do only aligned access to IPC memory area 2022-09-05 10:31:26 +02:00
xilinx firmware: xilinx: enable feature check for ZynqMP 2022-04-22 17:20:03 +02:00
Kconfig sound updates for 5.19-rc1 2022-05-25 16:55:16 -07:00
Makefile Follow-up tweaks for the EFI changes in v5.19 2022-06-03 13:39:30 -07:00
arm_scpi.c firmware: arm_scpi: Ensure scpi_info is not assigned if the probe fails 2022-08-17 15:16:07 +02:00
arm_sdei.c ACPI: APEI: explicit init of HEST and GHES in apci_init() 2022-03-03 20:24:22 +01:00
dmi-id.c firmware: dmi: Move product_sku info to the end of the modalias 2021-09-02 17:28:53 +02:00
dmi-sysfs.c firmware: dmi-sysfs: Fix memory leak in dmi_sysfs_register_handle 2022-05-19 18:56:56 +02:00
dmi_scan.c
edd.c edd: simplify the check of 'attr->test' in edd_populate_dir() 2022-05-19 18:57:04 +02:00
iscsi_ibft.c iscsi_ibft: Fix isa_bus_to_virt not working under ARM 2021-09-02 16:22:00 -04:00
iscsi_ibft_find.c iscsi_ibft: fix warning in reserve_ibft_region() 2021-08-05 19:47:57 -04:00
memmap.c firmware: memmap: use default_groups in kobj_type 2022-01-05 19:17:29 +01:00
mtk-adsp-ipc.c firmware: mediatek: Add adsp ipc protocol interface 2022-05-16 12:58:11 +01:00
pcdp.c
pcdp.h
qcom_scm-legacy.c
qcom_scm-smc.c
qcom_scm.c firmware: qcom_scm: Add compatible for MSM8976 SoC 2022-04-12 21:36:19 -05:00
qcom_scm.h firmware: qcom: scm: Add support for MC boot address API 2022-02-03 21:54:48 -06:00
qemu_fw_cfg.c firmware: qemu_fw_cfg: remove sysfs entries explicitly 2022-01-14 18:50:52 -05:00
raspberrypi.c firmware: raspberrypi: Fix a leak in 'rpi_firmware_get()' 2021-08-18 16:02:08 +02:00
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 firmware: stratix10-svc: fix a missing check on list iterator 2022-04-24 17:31:20 +02:00
sysfb.c firmware: sysfb: Add sysfb_disable() helper function 2022-06-29 09:51:41 +02:00
sysfb_simplefb.c firmware: sysfb: Make sysfb_create_simplefb() return a pdev pointer 2022-06-29 09:51:31 +02:00
ti_sci.c firmware: ti_sci: Switch transport to polled mode during system suspend 2022-05-03 06:52:11 -05:00
ti_sci.h
trusted_foundations.c
turris-mox-rwtm.c