Skip to content

Commit 30f939f

Browse files
vlad902Wolfram Sang
authored andcommitted
i2c: fix kernel memory disclosure in dev interface
i2c_smbus_xfer() does not always fill an entire block, allowing kernel stack memory disclosure through the temp variable. Clear it before it's read to. Signed-off-by: Vlad Tsyrklevich <[email protected]> Signed-off-by: Wolfram Sang <[email protected]> Cc: [email protected]
1 parent a121103 commit 30f939f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/i2c/i2c-dev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ static noinline int i2cdev_ioctl_smbus(struct i2c_client *client,
331331
unsigned long arg)
332332
{
333333
struct i2c_smbus_ioctl_data data_arg;
334-
union i2c_smbus_data temp;
334+
union i2c_smbus_data temp = {};
335335
int datasize, res;
336336

337337
if (copy_from_user(&data_arg,

0 commit comments

Comments
 (0)