iio: adc: ti-ads1119: fix information leak in triggered buffer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Javier Carrasco <javier.carrasco.cruz@xxxxxxxxx>

commit 75f339d3ecd38cb1ce05357d647189d4a7f7ed08 upstream.

The 'scan' local struct is used to push data to user space from a
triggered buffer, but it has a hole between the sample (unsigned int)
and the timestamp. This hole is never initialized.

Initialize the struct to zero before using it to avoid pushing
uninitialized information to userspace.

Cc: stable@xxxxxxxxxxxxxxx
Fixes: a9306887eba4 ("iio: adc: ti-ads1119: Add driver")
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@xxxxxxxxx>
Reviewed-by: Francesco Dolcini <francesco.dolcini@xxxxxxxxxxx>
Link: https://patch.msgid.link/20241125-iio_memset_scan_holes-v1-2-0cb6e98d895c@xxxxxxxxx
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/iio/adc/ti-ads1119.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/iio/adc/ti-ads1119.c b/drivers/iio/adc/ti-ads1119.c
index e9d9d4d46d38..2615a275acb3 100644
--- a/drivers/iio/adc/ti-ads1119.c
+++ b/drivers/iio/adc/ti-ads1119.c
@@ -506,6 +506,8 @@ static irqreturn_t ads1119_trigger_handler(int irq, void *private)
 	unsigned int index;
 	int ret;
 
+	memset(&scan, 0, sizeof(scan));
+
 	if (!iio_trigger_using_own(indio_dev)) {
 		index = find_first_bit(indio_dev->active_scan_mask,
 				       iio_get_masklength(indio_dev));
-- 
2.48.0



Patches currently in stable-queue which might be from javier.carrasco.cruz@xxxxxxxxx are

queue-6.12/iio-pressure-zpa2326-fix-information-leak-in-triggered-buffer.patch
queue-6.12/iio-adc-ti-ads1119-fix-sample-size-in-scan-struct-for-triggered-buffer.patch
queue-6.12/iio-adc-ti-ads1119-fix-information-leak-in-triggered-buffer.patch
queue-6.12/iio-dummy-iio_simply_dummy_buffer-fix-information-leak-in-triggered-buffer.patch
queue-6.12/iio-imu-kmx61-fix-information-leak-in-triggered-buffer.patch
queue-6.12/iio-adc-rockchip_saradc-fix-information-leak-in-triggered-buffer.patch
queue-6.12/cpuidle-riscv-sbi-fix-device-node-release-in-early-e.patch
queue-6.12/iio-light-bh1745-fix-information-leak-in-triggered-buffer.patch
queue-6.12/iio-light-vcnl4035-fix-information-leak-in-triggered-buffer.patch
queue-6.12/iio-adc-ti-ads8688-fix-information-leak-in-triggered-buffer.patch




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux