linux/drivers/iio
Jonathan Cameron 8db4afe163 iio:pressure:ms5611 Fix buffer element alignment
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.
Here there is no data leak possibility so use an explicit structure
on the stack to ensure alignment and nice readable fashion.

The forced alignment of ts isn't strictly necessary in this driver
as the padding will be correct anyway (there isn't any).  However
it is probably less fragile to have it there and it acts as
documentation of the requirement.

Fixes: 713bbb4efb ("iio: pressure: ms5611: Add triggered buffer support")
Reported-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Tomasz Duszynski <tomasz.duszynski@octakon.com>
Cc: <Stable@vger.kernel.org>
2020-07-05 14:22:48 +01:00
..
accel iio: mma8452: Add missed iio_device_unregister() call in mma8452_probe() 2020-06-14 12:32:23 +01:00
adc iio: adc: adi-axi-adc: Fix object reference counting 2020-07-04 17:05:50 +01:00
afe
amplifiers
buffer
chemical Merge 5.7-rc7 into staging-next 2020-05-25 09:11:19 +02:00
common
dac Staging/IIO driver patches for 5.8-rc1 2020-06-07 10:45:08 -07:00
dummy iio: dummy_evgen: Fix use after free on error in iio_dummy_evgen_create() 2020-05-20 13:11:41 +01:00
frequency
gyro
health iio:health:afe4404 Fix timestamp alignment and prevent data leak. 2020-06-14 12:32:22 +01:00
humidity iio:humidity:hts221 Fix alignment and data leak issues 2020-07-05 14:22:48 +01:00
imu Merge 5.7-rc7 into staging-next 2020-05-25 09:11:19 +02:00
light iio: light: gp2ap002: Take runtime PM reference on light read 2020-05-22 17:19:41 +01:00
magnetometer iio:magnetometer:ak8974: Fix alignment and data leak issues 2020-07-05 14:22:48 +01:00
multiplexer
orientation
position
potentiometer
potentiostat
pressure iio:pressure:ms5611 Fix buffer element alignment 2020-07-05 14:22:48 +01:00
proximity iio: proximity: ping: pass reference to IIO device as param to ping_read() 2020-05-21 19:39:25 +01:00
resolver
temperature
trigger
iio_core_trigger.h
iio_core.h
industrialio-buffer.c iio: buffer: remove attrcount_orig var from sysfs creation 2020-05-16 17:57:15 +01:00
industrialio-configfs.c
industrialio-core.c iio: core: add missing IIO_MOD_H2/ETHANOL string identifiers 2020-06-14 14:34:19 +01:00
industrialio-event.c
industrialio-sw-device.c
industrialio-sw-trigger.c
industrialio-trigger.c
industrialio-triggered-event.c
inkern.c
Kconfig
Makefile
TODO