linux-stable/drivers/iio
Alison Schofield d5d24bcc0a iio: trigger: close race condition in acquiring trigger reference
In iio_trigger_write_current() we find the trigger we want while
holding mutex on the list of triggers, but we don't actually do a
get on it while holding mutex.  We wait until further validations
are completed and we're sure it's the one we want.  Race condition
is that it could be freed by the time we do the get.

Solution is to grab the trigger (iio_trigger_get) as soon as we
find it while holding mutex on the list of triggers.  If later
we decide it's not the right one, put it back. (iio_trigger_put).

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Suggested-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-01-22 13:21:41 +00:00
..
accel iio:kfifo_buf header include push down. 2017-01-10 19:54:53 +00:00
adc iio: adc: max1363: Export OF device ID table as module aliases 2017-01-22 13:21:30 +00:00
amplifiers
buffer iio:buffer.h - split into buffer.h and buffer_impl.h 2017-01-10 19:54:55 +00:00
chemical iio:chemical:atlas-ph-sensor: Fix use of 32 bit int to hold 16 bit big endian value 2016-10-23 22:18:27 +01:00
common iio:kfifo_buf header include push down. 2017-01-10 19:54:53 +00:00
counter iio: 104-quad-8: Add IIO support for the ACCES 104-QUAD-8 2016-10-01 17:06:21 +01:00
dac iio: dac: ad5593r: Add ACPI support 2016-12-30 17:20:14 +00:00
dummy iio:dummy: Stop enabling timestamp by default. 2017-01-10 19:54:55 +00:00
frequency iio: frequency: ad9523: use unsigned int rather then bare unsigned 2016-04-17 10:31:03 +01:00
gyro iio:kfifo_buf header include push down. 2017-01-10 19:54:53 +00:00
health iio: health: max30100: use msleep() for long uncritical delays 2017-01-22 13:21:28 +00:00
humidity iio: humidity: Support acpi probe for hts211 2016-12-03 08:56:28 +00:00
imu iio: imu: st_lsm6dsx: fix typo in gyro sensitivity definition 2017-01-22 13:21:41 +00:00
light iio: light: opt3001: Export OF device ID table as module aliases 2017-01-22 13:21:29 +00:00
magnetometer iio: magnetometer: mag3110: claim direct mode during raw writes 2017-01-21 12:20:40 +00:00
orientation iio: orientation: hid-sensor-rotation: Add PM function (fix non working driver) 2016-11-05 17:47:47 +00:00
potentiometer iio: potentiometer: mcp4531: Export OF device ID table as module aliases 2017-01-22 13:21:29 +00:00
potentiostat iio: potentiostat: add LMP91000 support 2016-09-27 20:33:03 +01:00
pressure iio: pressure: ms5611: claim direct mode during oversampling changes 2017-01-21 12:31:05 +00:00
proximity iio: proximity: sx9500: claim direct mode during raw proximity reads 2017-01-21 12:21:53 +00:00
temperature iio:temperature: Add support for TI TMP007 sensor 2017-01-14 10:45:05 +00:00
trigger iio:trigger: Experimental kthread tight loop trigger (thread only) 2016-06-03 13:18:44 +01:00
iio_core.h iio:core: timestamping clock selection support 2016-06-30 19:41:38 +01:00
iio_core_trigger.h
industrialio-buffer.c iio:buffer.h - split into buffer.h and buffer_impl.h 2017-01-10 19:54:55 +00:00
industrialio-configfs.c
industrialio-core.c iio:buffer.h - split into buffer.h and buffer_impl.h 2017-01-10 19:54:55 +00:00
industrialio-event.c iio: iio_push_event(): Don't crash if the event interface is not registered 2016-09-10 16:40:44 +01:00
industrialio-sw-device.c iio: Add support for creating IIO devices via configfs 2016-05-04 11:43:54 +01:00
industrialio-sw-trigger.c
industrialio-trigger.c iio: trigger: close race condition in acquiring trigger reference 2017-01-22 13:21:41 +00:00
industrialio-triggered-event.c
inkern.c iio: inkern: pass through raw values if no scaling 2017-01-14 12:20:18 +00:00
Kconfig iio: 104-quad-8: Add IIO support for the ACCES 104-QUAD-8 2016-10-01 17:06:21 +01:00
Makefile iio: 104-quad-8: Add IIO support for the ACCES 104-QUAD-8 2016-10-01 17:06:21 +01:00