acrn-kernel/drivers/iio
Matti Vaittinen a10a0f385a iio: bmc150-accel-core: Fix unsafe buffer attributes
The iio_triggered_buffer_setup_ext() was changed by
commit 15097c7a1a ("iio: buffer: wrap all buffer attributes into iio_dev_attr")
to silently expect that all attributes given in buffer_attrs array are
device-attributes. This expectation was not forced by the API - and some
drivers did register attributes created by IIO_CONST_ATTR().

The added attribute "wrapping" does not copy the pointer to stored
string constant and when the sysfs file is read the kernel will access
to invalid location.

Change the IIO_CONST_ATTRs from the driver to IIO_DEVICE_ATTR in order
to prevent the invalid memory access.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Fixes: 15097c7a1a ("iio: buffer: wrap all buffer attributes into iio_dev_attr")
Link: https://lore.kernel.org/r/cf8a56658fc38db8bed64f456d898f5ad5a2814f.1664782676.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-10-17 08:51:26 +01:00
..
accel iio: bmc150-accel-core: Fix unsafe buffer attributes 2022-10-17 08:51:26 +01:00
adc iio: at91-sama5d2_adc: Fix unsafe buffer attributes 2022-10-17 08:51:26 +01:00
addac
afe
amplifiers
buffer
cdc
chemical
common
dac Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
dummy
filter
frequency
gyro
health
humidity
imu Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
light iio: light: tsl2583: Fix module unloading 2022-10-17 08:51:26 +01:00
magnetometer Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
multiplexer
orientation
position
potentiometer
potentiostat
pressure Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
proximity Char/Misc and other driver changes for 6.1-rc1 2022-10-08 08:56:37 -07:00
resolver
temperature iio: temperature: ltc2983: allocate iio channels once 2022-10-17 08:51:26 +01:00
test
trigger
Kconfig
Makefile
TODO
iio_core.h
iio_core_trigger.h
industrialio-buffer.c
industrialio-configfs.c
industrialio-core.c iio: add support for binary attributes 2022-09-21 18:42:55 +01:00
industrialio-event.c iio: Add new event type gesture and use direction for single and double tap 2022-09-05 18:08:42 +01:00
industrialio-sw-device.c
industrialio-sw-trigger.c
industrialio-trigger.c
industrialio-triggered-event.c
inkern.c