linux/drivers/base/regmap
Cheng-Yu Lee 4b58aac989
regmap: Fix race condition in hwspinlock irqsave routine
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>
2026-01-12 12:25:29 +00:00
..
Kconfig
Makefile
internal.h regcache: Add ->populate() callback to separate from ->init() 2025-10-31 12:01:51 +00:00
regcache-flat.c regcache: flat: Split ->populate() from ->init() 2025-10-31 12:01:54 +00:00
regcache-maple.c regmap: maple: free entry on mas_store_gfp() failure 2026-01-05 13:14:50 +00:00
regcache-rbtree.c regcache: rbtree: Split ->populate() from ->init() 2025-10-31 12:01:52 +00:00
regcache.c regcache: Add ->populate() callback to separate from ->init() 2025-10-31 12:01:51 +00:00
regmap-ac97.c
regmap-debugfs.c
regmap-fsi.c
regmap-i2c.c
regmap-i3c.c I3C for 6.19 2025-12-08 11:25:14 +09:00
regmap-irq.c
regmap-kunit.c regmap: add flat cache with sparse validity 2025-10-29 12:54:04 +00:00
regmap-mdio.c
regmap-mmio.c
regmap-ram.c
regmap-raw-ram.c
regmap-sccb.c
regmap-sdw-mbq.c regmap: Updates for v6.19 2025-12-04 11:16:44 -08:00
regmap-sdw.c
regmap-slimbus.c regmap: slimbus: fix bus_context pointer in regmap init calls 2025-10-23 15:19:58 +01:00
regmap-spi-avmm.c
regmap-spi.c
regmap-spmi.c
regmap-w1.c
regmap.c regmap: Fix race condition in hwspinlock irqsave routine 2026-01-12 12:25:29 +00:00
trace.h