linux/drivers/base
Cheng-Yu Lee 766e243ae8 regmap: Fix race condition in hwspinlock irqsave routine
[ Upstream commit 4b58aac989 ]

Previously, the address of the shared member '&map->spinlock_flags' was
passed directly to 'hwspin_lock_timeout_irqsave'. This creates a race
condition where multiple contexts contending for the lock could overwrite
the shared flags variable, potentially corrupting the state for the
current lock owner.

Fix this by using a local stack variable 'flags' to store the IRQ state
temporarily.

Fixes: 8698b93647 ("regmap: Add hardware spinlock support")
Signed-off-by: Cheng-Yu Lee <cylee12@realtek.com>
Co-developed-by: Yu-Chun Lin <eleanor.lin@realtek.com>
Signed-off-by: Yu-Chun Lin <eleanor.lin@realtek.com>
Link: https://patch.msgid.link/20260109032633.8732-1-eleanor.lin@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-02-06 16:41:54 +01:00
..
firmware_loader firmware_loader: Block path traversal 2024-10-17 15:11:12 +02:00
power PM: runtime: Do not clear needs_force_resume with enabled runtime PM 2026-01-19 13:09:53 +01:00
regmap regmap: Fix race condition in hwspinlock irqsave routine 2026-02-06 16:41:54 +01:00
test driver core: test_async: fix an error code 2023-09-19 12:22:45 +02:00
arch_numa.c memblock: drop memblock_free_early_nid() and memblock_free_early() 2025-03-13 12:50:07 +01:00
arch_topology.c arch_topology: Fix incorrect error check in topology_parse_cpu_capacity() 2025-10-29 14:03:15 +01:00
attribute_container.c driver core: attribute_container: fix W=1 warnings 2021-05-14 13:37:10 +02:00
auxiliary.c Merge 5.14-rc3 into driver-core-next 2021-07-27 09:22:08 +02:00
base.h software nodes: Split software_node_notify() 2021-07-16 19:17:05 +02:00
bus.c driver core: bus: Fix double free in driver API bus_register() 2024-12-14 19:51:14 +01:00
cacheinfo.c cacheinfo: clear cache_leaves(cpu) in free_cache_attributes() 2021-07-21 17:29:40 +02:00
class.c class: fix possible memory leak in __class_register() 2022-12-31 13:14:27 +01:00
component.c drivers: base: component: fix memory leak with using debugfs_lookup() 2023-03-11 13:57:38 +01:00
container.c driver core: Remove redundant license text 2017-12-07 18:36:44 +01:00
core.c driver core: Introduce device_find_any_child() helper 2024-12-14 19:50:59 +01:00
cpu.c x86/vmscape: Enable the mitigation 2025-09-11 17:17:17 +02:00
dd.c driver core: Release all resources during unbind before updating device links 2023-11-28 16:56:36 +00:00
devcoredump.c devcoredump: Fix circular locking dependency with devcd->mutex. 2025-10-29 14:03:15 +01:00
devres.c drivers: base: devres: Allow to release group on device release 2025-05-02 07:43:57 +02:00
devtmpfs.c devtmpfs regression fix: reconfigure on each mount 2022-01-20 09:13:13 +01:00
driver.c driver: platform: Add helper for safer setting of driver_override 2023-11-08 17:26:43 +01:00
firmware.c driver core: Remove redundant license text 2017-12-07 18:36:44 +01:00
hypervisor.c driver core: Remove redundant license text 2017-12-07 18:36:44 +01:00
init.c init: Initialize noop_backing_dev_info early 2022-06-22 14:22:02 +02:00
isa.c bus: Make remove callback return void 2021-07-21 11:53:42 +02:00
Kconfig RISC-V Patches for the 5.12 Merge Window 2021-02-26 10:28:35 -08:00
Makefile devres: Enable trace events 2021-06-15 17:14:36 +02:00
map.c driver: base: Prefer unsigned int to bare use of unsigned 2021-07-21 17:30:09 +02:00
memory.c mm/hwpoison: avoid the impact of hwpoison_filter() return value on mce handler 2022-07-12 16:35:05 +02:00
module.c Revert "driver core: Fix uevent_show() vs driver detach race" 2024-11-08 16:25:54 +01:00
node.c drivers/base/node: fix double free in register_one_node() 2025-10-19 16:21:37 +02:00
pinctrl.c driver core: Remove redundant license text 2017-12-07 18:36:44 +01:00
platform-msi.c platform-msi: Add ABI to show msi_irqs of platform devices 2021-08-24 09:16:20 +02:00
platform.c driver: platform: Add helper for safer setting of driver_override 2023-11-08 17:26:43 +01:00
property.c device property: Add fwnode_irq_get_byname 2024-10-17 15:11:43 +02:00
soc.c soc: fix comment for freeing soc_dev_attr 2020-12-09 19:46:31 +01:00
swnode.c software node: Correct a OOB check in software_node_get_reference_args() 2025-06-27 11:05:32 +01:00
syscore.c syscore: Use pm_pr_dbg() for syscore_{suspend,resume}() 2020-09-08 13:32:06 +02:00
topology.c topology: Keep the cpumask unchanged when printing cpumap 2025-01-23 17:15:53 +01:00
trace.c devres: Enable trace events 2021-06-15 17:14:36 +02:00
trace.h devres: Enable trace events 2021-06-15 17:14:36 +02:00
transport_class.c drivers: base: transport_class: fix resource leak when transport_add_device() fails 2023-03-10 09:39:39 +01:00