4.15-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Linus Walleij <[email protected]>

commit 24bd3efc9d1efb5f756a7c6f807a36ddb6adc671 upstream.

The GPIO event descriptor was leaking kernel stack to
userspace because we don't zero the variable before
use. Ooops. Fix this.

Reported-by: Arnd Bergmann <[email protected]>
Reviewed-by: Bartosz Golaszewski <[email protected]>
Reviewed-by: Arnd Bergmann <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/gpio/gpiolib.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -732,6 +732,9 @@ static irqreturn_t lineevent_irq_thread(
        struct gpioevent_data ge;
        int ret, level;
 
+       /* Do not leak kernel stack to userspace */
+       memset(&ge, 0, sizeof(ge));
+
        ge.timestamp = ktime_get_real_ns();
        level = gpiod_get_value_cansleep(le->desc);
 


Reply via email to