Skip to content

Commit

Permalink
i2c: fix kernel memory disclosure in dev interface
Browse files Browse the repository at this point in the history
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 <vlad@tsyrklevich.net>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: stable@kernel.org
  • Loading branch information
Vlad Tsyrklevich authored and Wolfram Sang committed Jan 12, 2017
1 parent a121103 commit 30f939f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/i2c/i2c-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ static noinline int i2cdev_ioctl_smbus(struct i2c_client *client,
unsigned long arg)
{
struct i2c_smbus_ioctl_data data_arg;
union i2c_smbus_data temp;
union i2c_smbus_data temp = {};
int datasize, res;

if (copy_from_user(&data_arg,
Expand Down

0 comments on commit 30f939f

Please sign in to comment.