linux/drivers/iio
Jonathan Cameron db8f06d97e iio:adc:max1118 Fix alignment of timestamp 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() data.

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

The explicit alignment of ts is necessary to ensure correct padding
on architectures where s64 is only 4 bytes aligned such as x86_32.

Fixes: a9e9c7153e ("iio: adc: add max1117/max1118/max1119 ADC driver")
Reported-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Akinobu Mita <akinobu.mita@gmail.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:max1118 Fix alignment of timestamp 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
industrialio-buffer.c iio: buffer: fix attach/detach pollfunc order 2020-07-15 13:04:44 +01:00
industrialio-configfs.c
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
industrialio-sw-trigger.c
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
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