linux/drivers/iio
Jonathan Cameron a661b571e3 iio:adc:ti-adc084s021 Fix alignment and data leak issues.
One of a class of bugs pointed out by Lars in a recent review.
iio_push_to_buffers_with_timestamp assumes the buffer used is aligned
to the size of the timestamp (8 bytes).  This is not guaranteed in
this driver which uses an array of smaller elements on the stack.
As Lars also noted this anti pattern can involve a leak of data to
userspace and that indeed can happen here.  We close both issues by
moving to a suitable structure in the iio_priv().

This data is allocated with kzalloc so no data can leak apart from
previous readings.

The force alignment of ts is not strictly necessary in this case
but reduces the fragility of the code.

Fixes: 3691e5a694 ("iio: adc: add driver for the ti-adc084s021 chip")
Reported-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Mårten Lindahl <martenli@axis.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: <Stable@vger.kernel.org>
2020-08-31 10:47:52 +01:00
..
accel iio:accel:mma7455: Fix timestamp alignment and prevent data leak. 2020-08-22 11:38:52 +01:00
adc iio:adc:ti-adc084s021 Fix alignment and data leak issues. 2020-08-31 10:47:52 +01:00
afe iio: remove explicit IIO device parent assignment 2020-06-14 11:49:59 +01:00
amplifiers iio: remove left-over parent assignments 2020-06-14 11:50:04 +01:00
buffer iio: Move attach/detach of the poll func to the core 2020-06-20 17:34:44 +01:00
chemical iio:chemical:ccs811: Fix timestamp alignment and prevent data leak. 2020-08-22 11:38:55 +01:00
common iio: cros_ec: Set Gyroscope default frequency to 25Hz 2020-08-22 11:38:41 +01:00
dac iio: dac: ad5592r: fix unbalanced mutex unlocks in ad5592r_read_raw() 2020-07-22 14:51:54 +01:00
dummy iio: dummy: iio_simple_dummy_buffer: Demote file header and correct misspelling 2020-07-20 09:02:58 +01:00
frequency iio: remove explicit IIO device parent assignment 2020-06-14 11:49:59 +01:00
gyro iio: gyro: fxas21002c: Move 'fxas21002c_reg_fields' to the only file its used 2020-07-20 09:03:25 +01:00
health Linux 5.8-rc6 2020-07-20 09:37:31 +02:00
humidity Linux 5.8-rc6 2020-07-20 09:37:31 +02:00
imu iio: imu: st_lsm6dsx: reset hw ts after resume 2020-07-22 14:55:43 +01:00
light iio:light:ltr501 Fix timestamp alignment issue. 2020-08-22 11:38:58 +01:00
magnetometer iio:magnetometer:ak8975 Fix alignment and data leak issues. 2020-08-22 11:39:00 +01:00
multiplexer iio: remove explicit IIO device parent assignment 2020-06-14 11:49:59 +01:00
orientation iio: remove left-over parent assignments 2020-06-14 11:50:04 +01:00
position iio: remove explicit IIO device parent assignment 2020-06-14 11:49:59 +01:00
potentiometer Replace HTTP links with HTTPS ones: drivers/iio 2020-07-13 15:05:59 +01:00
potentiostat iio: Move attach/detach of the poll func to the core 2020-06-20 17:34:44 +01:00
pressure Linux 5.8-rc6 2020-07-20 09:37:31 +02:00
proximity iio:proximity:mb1232: Fix timestamp alignment and prevent data leak. 2020-08-22 11:38:54 +01:00
resolver iio: remove explicit IIO device parent assignment 2020-06-14 11:49:59 +01:00
temperature iio: temperature: mlx90632: Function parameter descriptions must match exactly 2020-07-20 09:03:18 +01:00
trigger iio: Remove superfluous of_node assignments 2020-06-14 14:20:08 +01:00
iio_core_trigger.h iio: Move attach/detach of the poll func to the core 2020-06-20 17:34:44 +01:00
iio_core.h iio: buffer: rename 'read_first_n' callback to 'read' 2019-12-29 15:20:09 +00:00
industrialio-buffer.c iio: buffer: fix attach/detach pollfunc order 2020-07-15 13:04:44 +01:00
industrialio-configfs.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
industrialio-core.c iio: core: fix/re-introduce back parent assignment 2020-07-22 14:36:23 +01:00
industrialio-event.c iio: core: move event interface on the opaque struct 2020-07-07 20:24:07 +01:00
industrialio-sw-device.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
industrialio-sw-trigger.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
industrialio-trigger.c iio: Move attach/detach of the poll func to the core 2020-06-20 17:34:44 +01:00
industrialio-triggered-event.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
inkern.c iio: inkern: drop devm_iio_channel_release{_all} API calls 2020-04-19 16:56:37 +01:00
Kconfig iio: position: Add support for Azoteq IQS624/625 angle sensors 2020-03-27 08:25:59 +00:00
Makefile iio: position: Add support for Azoteq IQS624/625 angle sensors 2020-03-27 08:25:59 +00:00
TODO iio: add a TODO 2020-03-08 17:28:53 +00:00