i2c: fix kernel memory disclosure in dev interface
authorVlad Tsyrklevich <vlad@tsyrklevich.net>
Mon, 9 Jan 2017 15:53:36 +0000 (22:53 +0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Jan 2017 19:17:20 +0000 (20:17 +0100)
commitae76af2518067cfbd9c3912f3c2558e5235b6e02
treea5cf99b083196a3e066a11bc93454790b82de341
parentf64b9acc368c3a535510291aaf4e86787f8d10d3
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>
drivers/i2c/i2c-dev.c