linux/drivers/iio/imu
Lars-Peter Clausen dc275a6eb9 iio: adis_buffer: Fix out-of-bounds memory access
commit d590faf9e8 upstream.

The SPI tx and rx buffers are both supposed to be scan_bytes amount of
bytes large and a common allocation is used to allocate both buffers. This
puts the beginning of the tx buffer scan_bytes bytes after the rx buffer.
The initialization of the tx buffer pointer is done adding scan_bytes to
the beginning of the rx buffer, but since the rx buffer is of type __be16
this will actually add two times as much and the tx buffer ends up pointing
after the allocated buffer.

Fix this by using scan_count, which is scan_bytes / 2, instead of
scan_bytes when initializing the tx buffer pointer.

Fixes: aacff892cb ("staging:iio:adis: Preallocate transfer message")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2016-02-25 12:01:17 -08:00
..
inv_mpu6050 Merge 4.2-rc3 into staging-next 2015-07-20 13:21:28 -07:00
adis.c iio:imu: Add support for the ADIS16480 and similar IMUs 2012-11-20 21:28:51 +00:00
adis16400.h iio: adis16400: Fix burst transfer for adis16448 2015-05-16 11:01:20 +01:00
adis16400_buffer.c iio: adis16400: Fix burst transfer for adis16448 2015-05-16 11:01:20 +01:00
adis16400_core.c spi: Drop owner assignment from spi_drivers 2015-10-28 10:30:17 +09:00
adis16480.c spi: Drop owner assignment from spi_drivers 2015-10-28 10:30:17 +09:00
adis_buffer.c iio: adis_buffer: Fix out-of-bounds memory access 2016-02-25 12:01:17 -08:00
adis_trigger.c iio: imu: Use iio_trigger_get for indio_dev->trig assignment 2015-03-28 13:51:40 +00:00
Kconfig iio: imu: kmx61: Add support for data ready triggers 2014-12-12 13:49:30 +00:00
kmx61.c iio: remove gpio interrupt probing from drivers that use a single interrupt 2015-10-03 12:05:51 +01:00
Makefile iio: imu: Add support for Kionix KMX61 sensor 2014-12-12 13:43:54 +00:00