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 iio: amplifiers: ad8366: add support for HMC1119 Attenuator 2020-03-08 17:28:43 +00:00
buffer iio: buffer: drop devm_iio_kfifo_free() API call 2020-04-19 16:56:38 +01:00
chemical Merge 5.7-rc7 into staging-next 2020-05-25 09:11:19 +02:00
common Second set of new device support, cleanups and features for IIO in the 5.8 cycle 2020-05-15 16:03:28 +02:00
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 iio: adf4350: Convert to use GPIO descriptor 2019-12-15 11:42:16 +00:00
gyro iio: hid-sensors: move triggered buffer setup into hid_sensor_setup_trigger 2020-05-10 09:35:53 +01:00
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 iio: hid-sensors: move triggered buffer setup into hid_sensor_setup_trigger 2020-05-10 09:35:53 +01:00
position iio: position: Add support for Azoteq IQS624/625 angle sensors 2020-03-27 08:25:59 +00:00
potentiometer
potentiostat iio: potentiostat: lmp9100: fix iio_triggered_buffer_{predisable,postenable} positions 2020-03-08 17:28:53 +00:00
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 iio: ad2s1200: Drop legacy include 2019-12-15 11:42:15 +00:00
temperature iio: hid-sensors: move triggered buffer setup into hid_sensor_setup_trigger 2020-05-10 09:35:53 +01:00
trigger First set of new IIO device support, features and cleanup for the 5.8 cycle 2020-04-23 11:06:48 +02:00
iio_core_trigger.h
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: 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 iio: core: drop devm_iio_trigger_free() API call 2020-04-19 16:56:37 +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