From: Vlad Tsyrklevich Date: Mon, 9 Jan 2017 15:53:36 +0000 (+0700) Subject: i2c: fix kernel memory disclosure in dev interface X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=30f939feaeee23e21391cfc7b484f012eb189c3c;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Wolfram Sang Cc: stable@kernel.org --- 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, 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,