Skip to content

Commit cde312e

Browse files
javiercarrascocruzgregkh
authored andcommitted
iio: imu: kmx61: fix information leak in triggered buffer
commit 6ae0531 upstream. The 'buffer' local array 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 array to zero before using it to avoid pushing uninitialized information to userspace. Cc: [email protected] Fixes: c3a23ec ("iio: imu: kmx61: Add support for data ready triggers") Signed-off-by: Javier Carrasco <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a15ea87 commit cde312e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iio/imu/kmx61.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,7 @@ static irqreturn_t kmx61_trigger_handler(int irq, void *p)
11921192
struct kmx61_data *data = kmx61_get_data(indio_dev);
11931193
int bit, ret, i = 0;
11941194
u8 base;
1195-
s16 buffer[8];
1195+
s16 buffer[8] = { };
11961196

11971197
if (indio_dev == data->acc_indio_dev)
11981198
base = KMX61_ACC_XOUT_L;

0 commit comments

Comments
 (0)