Skip to content

Commit 2f43d52

Browse files
javiercarrascocruzjic23
authored andcommitted
iio: temperature: tmp006: 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 two 16-bit data channels and the timestamp. This hole is never initialized. Initialize the struct to zero before using it to avoid pushing uninitialized information to userspace. Fixes: 91f75cc ("iio: temperature: tmp006: add triggered buffer support") Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com> Link: https://patch.msgid.link/20241204-iio_memset_scan_holes-v2-1-3f941592a76d@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent 64f4389 commit 2f43d52

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/iio/temperature/tmp006.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ static irqreturn_t tmp006_trigger_handler(int irq, void *p)
252252
} scan;
253253
s32 ret;
254254

255+
memset(&scan, 0, sizeof(scan));
256+
255257
ret = i2c_smbus_read_word_data(data->client, TMP006_VOBJECT);
256258
if (ret < 0)
257259
goto err;

0 commit comments

Comments
 (0)