linux/drivers/iio
Jonathan Cameron eb1a148ef4 iio:chemical:ccs811: Fix timestamp alignment and prevent data leak.
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 with alignment
explicitly requested.  This data is allocated with kzalloc so no
data can leak appart from previous readings.

The explicit alignment of ts is necessary to ensure consistent
padding for x86_32 in which the ts would otherwise be 4 byte aligned.

Fixes: 283d26917a ("iio: chemical: ccs811: Add triggered buffer support")
Reported-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Narcisa Ana Maria Vasile <narcisaanamaria12@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-22 11:38:55 +01:00
..
accel iio:accel:mma7455: Fix timestamp alignment and prevent data leak. 2020-08-22 11:38:52 +01:00
adc iio: adc: rockchip_saradc: select IIO_TRIGGERED_BUFFER 2020-08-22 11:38:45 +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: stk3310: add chip id for STK3311-X variant 2020-07-20 09:03:38 +01:00
magnetometer iio: magnetometer: ak8974: Add description for ak8974's 'scan' attribute 2020-07-20 09:03:32 +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
Makefile
TODO