diff options
author | Vlad Tsyrklevich <vlad@tsyrklevich.net> | 2017-01-09 10:53:36 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-01-19 14:18:02 -0500 |
commit | ab8957396a692d46a357aec8ff57abc9bd5a878a (patch) | |
tree | 9f6cd882038171f8f9e07602907e56867dee14a9 | |
parent | 93c94ec23faeea8d9a501b6188c701fc282672b1 (diff) |
i2c: fix kernel memory disclosure in dev interface
commit 30f939feaeee23e21391cfc7b484f012eb189c3c upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/i2c/i2c-dev.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c index 66f323fd3982..6f638bbc922d 100644 --- a/drivers/i2c/i2c-dev.c +++ b/drivers/i2c/i2c-dev.c | |||
@@ -331,7 +331,7 @@ static noinline int i2cdev_ioctl_smbus(struct i2c_client *client, | |||
331 | unsigned long arg) | 331 | unsigned long arg) |
332 | { | 332 | { |
333 | struct i2c_smbus_ioctl_data data_arg; | 333 | struct i2c_smbus_ioctl_data data_arg; |
334 | union i2c_smbus_data temp; | 334 | union i2c_smbus_data temp = {}; |
335 | int datasize, res; | 335 | int datasize, res; |
336 | 336 | ||
337 | if (copy_from_user(&data_arg, | 337 | if (copy_from_user(&data_arg, |