Skip to content

Commit 75f339d

Browse files
javiercarrascocruzjic23
authored andcommitted
iio: adc: ti-ads1119: fix information leak in triggered buffer
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@vger.kernel.org Fixes: a930688 ("iio: adc: ti-ads1119: Add driver") Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com> Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com> Link: https://patch.msgid.link/20241125-iio_memset_scan_holes-v1-2-0cb6e98d895c@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent 6007d10 commit 75f339d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/iio/adc/ti-ads1119.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,8 @@ static irqreturn_t ads1119_trigger_handler(int irq, void *private)
506506
unsigned int index;
507507
int ret;
508508

509+
memset(&scan, 0, sizeof(scan));
510+
509511
if (!iio_trigger_using_own(indio_dev)) {
510512
index = find_first_bit(indio_dev->active_scan_mask,
511513
iio_get_masklength(indio_dev));

0 commit comments

Comments
 (0)