linux-yocto/drivers/iio
Luca Ceresoli 748ebd8e61 iio: light: opt3001: fix deadlock due to concurrent flag access
[ Upstream commit f063a28002 ]

The threaded IRQ function in this driver is reading the flag twice: once to
lock a mutex and once to unlock it. Even though the code setting the flag
is designed to prevent it, there are subtle cases where the flag could be
true at the mutex_lock stage and false at the mutex_unlock stage. This
results in the mutex not being unlocked, resulting in a deadlock.

Fix it by making the opt3001_irq() code generally more robust, reading the
flag into a variable and using the variable value at both stages.

Fixes: 94a9b7b180 ("iio: light: add support for TI's opt3001 light sensor")
Cc: stable@vger.kernel.org
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://patch.msgid.link/20250321-opt3001-irq-fix-v1-1-6c520d851562@bootlin.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
[ Adjust context ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-09 18:54:19 +02:00
..
accel iio: accel: fxls8962af: Fix use after free in fxls8962af_fifo_flush 2025-07-24 08:51:50 +02:00
adc iio: adc: ad_sigma_delta: change to buffer predisable 2025-08-28 16:26:06 +02:00
addac
afe
amplifiers
buffer
cdc
chemical iio: chemical: pms7003: use aligned_s64 for timestamp 2025-09-09 18:54:19 +02:00
common
dac iio: dac: ad3552r: clear reset status flag 2025-03-13 12:53:23 +01:00
dummy
filter iio: filter: admv8818: Support frequencies >= 2^32 2025-06-27 11:07:16 +01:00
frequency
gyro
health
humidity
imu iio: imu: inv_icm42600: change invalid data error to -EBUSY 2025-08-28 16:26:16 +02:00
light iio: light: opt3001: fix deadlock due to concurrent flag access 2025-09-09 18:54:19 +02:00
magnetometer
multiplexer
orientation
position
potentiometer
potentiostat
pressure iio: pressure: bmp280: Use IS_ERR() in bmp280_common_probe() 2025-08-28 16:26:14 +02:00
proximity iio: proximity: isl29501: fix buffered read on big-endian systems 2025-08-28 16:26:14 +02:00
resolver
temperature iio: temperature: maxim_thermocouple: use DMA-safe buffer for spi_read() 2025-08-28 16:26:16 +02:00
test
trigger
iio_core_trigger.h
iio_core.h
industrialio-buffer.c
industrialio-configfs.c
industrialio-core.c
industrialio-event.c
industrialio-sw-device.c
industrialio-sw-trigger.c
industrialio-trigger.c
industrialio-triggered-event.c
inkern.c
Kconfig
Makefile
TODO