linux-stable/drivers/firmware
Guilherme G. Piccoli 55ced28cac 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-26 13:15:43 +02:00
..
broadcom tree-wide: replace config_enabled() with IS_ENABLED() 2016-08-04 08:50:07 -04:00
efi efivars: Respect "block" flag in efivar_entry_set_safe() 2022-03-08 19:00:58 +01:00
google firmware: google: Test spinlock on panic path to avoid lockups 2022-10-26 13:15:43 +02:00
meson firmware: Amlogic: Add secure monitor driver 2016-09-01 14:23:39 -07:00
Kconfig firmware: qcom-scm: Fix QCOM_SCM configuration 2021-05-22 10:40:24 +02:00
Makefile firmware: Amlogic: Add secure monitor driver 2016-09-01 14:23:39 -07:00
arm_scpi.c firmware: arm_scpi: add missing of_node_put after calling of_parse_phandle 2016-08-08 14:31:09 +01:00
dcdbas.c dcdbas: Make use of smp_call_on_cpu() 2016-09-05 13:52:40 +02:00
dcdbas.h
dell_rbu.c
dmi-id.c dmi-id: don't free dev structure after calling device_register 2016-09-08 10:35:50 +02:00
dmi-sysfs.c firmware: dmi-sysfs: Fix memory leak in dmi_sysfs_register_handle 2022-06-14 16:52:38 +02:00
dmi_scan.c firmware: dmi_scan: Fix handling of empty DMI strings 2018-05-30 07:50:24 +02:00
edd.c
iscsi_ibft.c iscsi_ibft: make ISCSI_IBFT dependson ACPI instead of ISCSI_IBFT_FIND 2019-08-25 10:51:23 +02:00
iscsi_ibft_find.c
memmap.c
pcdp.c
pcdp.h
psci.c arm/arm64: smccc/psci: add arm_smccc_1_1_get_conduit() 2022-03-11 10:03:31 +01:00
qcom_scm-32.c firmware: qcom: scm: Expose PAS command 10 as reset-controller 2016-06-24 22:53:52 -05:00
qcom_scm-64.c firmware: qcom: scm: Ensure 'a0' status code is treated as signed 2019-12-21 10:42:17 +01:00
qcom_scm.c firmware: qcom_scm: make it explicitly non-modular 2016-08-23 15:46:32 -05:00
qcom_scm.h firmware: qcom: scm: Expose PAS command 10 as reset-controller 2016-06-24 22:53:52 -05:00
qemu_fw_cfg.c firmware: qemu_fw_cfg: fix kobject leak in probe error path 2022-03-08 19:00:58 +01:00
raspberrypi.c
scpi_pm_domain.c firmware: arm_scpi: Fix string overflow in SCPI genpd driver 2021-12-22 09:05:15 +01:00