Skip to content

Commit 64b79af

Browse files
javiercarrascocruzgregkh
authored andcommitted
iio: adc: rockchip_saradc: fix information leak in triggered buffer
commit 38724591364e1e3b278b4053f102b49ea06ee17c upstream. The 'data' local struct is used to push data to user space from a triggered buffer, but it does not set values for inactive channels, as it only uses iio_for_each_active_channel() to assign new values. Initialize the struct to zero before using it to avoid pushing uninitialized information to userspace. Cc: [email protected] Fixes: 4e130dc ("iio: adc: rockchip_saradc: Add support iio buffers") Signed-off-by: Javier Carrasco <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]> Signed-off-by: Bin Lan <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d3e2518 commit 64b79af

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/iio/adc/rockchip_saradc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@ static irqreturn_t rockchip_saradc_trigger_handler(int irq, void *p)
270270
int ret;
271271
int i, j = 0;
272272

273+
memset(&data, 0, sizeof(data));
274+
273275
mutex_lock(&i_dev->mlock);
274276

275277
for_each_set_bit(i, i_dev->active_scan_mask, i_dev->masklength) {

0 commit comments

Comments
 (0)