linux/drivers/iio/accel
Lars-Peter Clausen cd00822357 iio: mma8452: Fix trigger reference couting
The mma8452 driver directly assigns a trigger to the struct iio_dev. The
IIO core when done using this trigger will call `iio_trigger_put()` to drop
the reference count by 1.

Without the matching `iio_trigger_get()` in the driver the reference count
can reach 0 too early, the trigger gets freed while still in use and a
use-after-free occurs.

Fix this by getting a reference to the trigger before assigning it to the
IIO device.

Fixes: ae6d9ce056 ("iio: mma8452: Add support for interrupt driven triggers.")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20211024092700.6844-1-lars@metafoo.de
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-11-17 17:52:34 +00:00
..
adis16201.c iio: adis: Cleanout unused headers 2021-06-04 09:28:10 +01:00
adis16209.c iio: adis: Cleanout unused headers 2021-06-04 09:28:10 +01:00
adxl313_core.c iio: accel: Add driver support for ADXL313 2021-09-14 12:00:35 +01:00
adxl313_i2c.c iio: accel: Add driver support for ADXL313 2021-09-14 12:00:35 +01:00
adxl313_spi.c iio: accel: Add driver support for ADXL313 2021-09-14 12:00:35 +01:00
adxl313.h iio: accel: Add driver support for ADXL313 2021-09-14 12:00:35 +01:00
adxl345_core.c iio: accel: adxl345: convert probe to device-managed functions 2021-07-19 09:51:59 +01:00
adxl345_i2c.c iio: accel: adxl345: convert probe to device-managed functions 2021-07-19 09:51:59 +01:00
adxl345_spi.c iio: accel: adxl345: convert probe to device-managed functions 2021-07-19 09:51:59 +01:00
adxl345.h iio: accel: adxl345: convert probe to device-managed functions 2021-07-19 09:51:59 +01:00
adxl355_core.c iio: accel: adxl355: Add triggered buffer support 2021-09-14 12:00:35 +01:00
adxl355_i2c.c iio: accel: Add driver support for ADXL355 2021-09-14 12:00:30 +01:00
adxl355_spi.c iio: accel: Add driver support for ADXL355 2021-09-14 12:00:30 +01:00
adxl355.h iio: accel: Add driver support for ADXL355 2021-09-14 12:00:30 +01:00
adxl372_i2c.c iio: adxl372_i2c: Add OF device ID table 2020-08-22 10:53:16 +01:00
adxl372_spi.c iio: adxl372_spi: change indentation for of_table 2020-08-22 10:53:15 +01:00
adxl372.c iio: triggered-buffer: extend support to configure output buffers 2021-10-19 08:30:45 +01:00
adxl372.h
bma180.c iio: accel: bma180/bmc150: Move BMA254 to bmc150-accel driver 2021-06-13 17:00:18 +01:00
bma220_spi.c iio: accel: bma220: make suspend state setting more robust 2021-07-19 09:51:59 +01:00
bma400_core.c iio: accel: bma400: Make bma400_remove() return void 2021-10-19 08:30:45 +01:00
bma400_i2c.c iio: accel: bma400: Make bma400_remove() return void 2021-10-19 08:30:45 +01:00
bma400_spi.c iio: accel: bma400: Make bma400_remove() return void 2021-10-19 08:30:45 +01:00
bma400.h iio: accel: bma400: Make bma400_remove() return void 2021-10-19 08:30:45 +01:00
bmc150-accel-core.c iio: accel: bmc150: Make bmc150_accel_core_remove() return void 2021-10-19 08:30:45 +01:00
bmc150-accel-i2c.c iio: accel: bmc150: Make bmc150_accel_core_remove() return void 2021-10-19 08:30:45 +01:00
bmc150-accel-spi.c iio: accel: bmc150: Make bmc150_accel_core_remove() return void 2021-10-19 08:30:45 +01:00
bmc150-accel.h iio: accel: bmc150: Make bmc150_accel_core_remove() return void 2021-10-19 08:30:45 +01:00
bmi088-accel-core.c iio: accel: bmi088: Make bmi088_accel_core_remove() return void 2021-10-19 08:30:45 +01:00
bmi088-accel-spi.c iio: accel: bmi088: Make bmi088_accel_core_remove() return void 2021-10-19 08:30:45 +01:00
bmi088-accel.h iio: accel: bmi088: Make bmi088_accel_core_remove() return void 2021-10-19 08:30:45 +01:00
cros_ec_accel_legacy.c iio: cros: unify hw fifo attributes without API changes 2021-03-25 19:13:52 +00:00
da280.c iio: accel: da280: convert probe to device-managed functions 2021-07-17 18:57:55 +01:00
da311.c iio: accel: da311: convert probe to device-managed functions 2021-07-17 18:53:53 +01:00
dmard06.c
dmard09.c
dmard10.c iio: accel: dmard10: convert probe to device-managed functions 2021-07-17 18:52:52 +01:00
fxls8962af-core.c First set of IIO new device and feature support for the 5.16 cycle 2021-10-19 11:44:28 +02:00
fxls8962af-i2c.c iio: accel: add support for FXLS8962AF/FXLS8964AF accelerometers 2021-05-17 13:54:23 +01:00
fxls8962af-spi.c iio: accel: add support for FXLS8962AF/FXLS8964AF accelerometers 2021-05-17 13:54:23 +01:00
fxls8962af.h iio: accel: add support for FXLS8962AF/FXLS8964AF accelerometers 2021-05-17 13:54:23 +01:00
hid-sensor-accel-3d.c iio: hid-sensors: bind IIO channels alloc to device object 2021-07-13 18:21:53 +01:00
Kconfig iio: accel: adxl355: Add triggered buffer support 2021-09-14 12:00:35 +01:00
kxcjk-1013.c iio: accel: kxcjk-1013: Fix possible memory leak in probe and remove 2021-11-17 17:52:32 +00:00
kxsd9-i2c.c iio: accel: kxsd9: Make kxsd9_common_remove() return void 2021-10-19 08:30:45 +01:00
kxsd9-spi.c iio: accel: kxsd9: Make kxsd9_common_remove() return void 2021-10-19 08:30:45 +01:00
kxsd9.c iio: kxsd9: Don't return error code in trigger handler 2021-11-17 17:52:33 +00:00
kxsd9.h iio: accel: kxsd9: Make kxsd9_common_remove() return void 2021-10-19 08:30:45 +01:00
Makefile iio: accel: Add driver support for ADXL313 2021-09-14 12:00:35 +01:00
mc3230.c iio: Remove kernel-doc keyword in file header comment 2021-03-25 19:13:49 +00:00
mma7455_core.c iio: accel: mma7455: Make mma7455_core_remove() return void 2021-10-19 08:30:45 +01:00
mma7455_i2c.c iio: accel: mma7455: Make mma7455_core_remove() return void 2021-10-19 08:30:45 +01:00
mma7455_spi.c iio: accel: mma7455: Make mma7455_core_remove() return void 2021-10-19 08:30:45 +01:00
mma7455.h iio: accel: mma7455: Make mma7455_core_remove() return void 2021-10-19 08:30:45 +01:00
mma7660.c iio: accel: mma7660: Mark acpi match table as maybe unused 2021-10-17 11:05:54 +01:00
mma8452.c iio: mma8452: Fix trigger reference couting 2021-11-17 17:52:34 +00:00
mma9551_core.c iio: accel: mma9551/3: Balance untime pm + use pm_runtime_resume_and_get() 2021-05-17 13:54:25 +01:00
mma9551_core.h
mma9551.c iio: accel: mma9551/3: Balance untime pm + use pm_runtime_resume_and_get() 2021-05-17 13:54:25 +01:00
mma9553.c iio: accel: mma9551/3: Balance untime pm + use pm_runtime_resume_and_get() 2021-05-17 13:54:25 +01:00
mxc4005.c iio: accel: mxc4005: Fix overread of data and alignment issue. 2021-05-17 13:54:28 +01:00
mxc6255.c
sca3000.c iio: accel: sca3000: Use sign_extend32() instead of opencoding sign extension. 2021-10-20 14:43:53 +01:00
sca3300.c iio: accel: Add driver for Murata SCA3300 accelerometer 2021-05-17 13:49:09 +01:00
ssp_accel_sensor.c iio: make use of devm_iio_kfifo_buffer_setup() helper 2021-03-11 20:47:01 +00:00
st_accel_buffer.c iio: accel: st_accel: use devm_iio_triggered_buffer_setup() for buffer 2021-07-24 16:35:05 +01:00
st_accel_core.c iio: st_sensors: remove reference to parent device object on st_sensor_data 2021-09-14 12:00:32 +01:00
st_accel_i2c.c iio: st_sensors: remove all driver remove functions 2021-09-14 12:00:31 +01:00
st_accel_spi.c iio: st_sensors: remove all driver remove functions 2021-09-14 12:00:31 +01:00
st_accel.h iio: accel: st_accel: use devm_iio_triggered_buffer_setup() for buffer 2021-07-24 16:35:05 +01:00
stk8ba50.c iio: accel: stk8ba50: Fix buffer alignment in iio_push_to_buffers_with_timestamp() 2021-05-17 13:54:28 +01:00
stk8312.c iio: accel: stk8312: Fix buffer alignment in iio_push_to_buffers_with_timestamp() 2021-05-17 13:54:28 +01:00