stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "gpio: Fix kernel stack leak to userspace" has been added to the 4.14-stable tree
@ 2018-02-01 12:44 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2018-02-01 12:44 UTC (permalink / raw)
  To: linus.walleij, arnd, brgl, gregkh; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    gpio: Fix kernel stack leak to userspace

to the 4.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     gpio-fix-kernel-stack-leak-to-userspace.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 24bd3efc9d1efb5f756a7c6f807a36ddb6adc671 Mon Sep 17 00:00:00 2001
From: Linus Walleij <linus.walleij@linaro.org>
Date: Mon, 22 Jan 2018 13:19:28 +0100
Subject: gpio: Fix kernel stack leak to userspace

From: Linus Walleij <linus.walleij@linaro.org>

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 <arnd@arndb.de>
Reviewed-by: Bartosz Golaszewski <brgl@bgdev.pl>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -723,6 +723,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);
 


Patches currently in stable-queue which might be from linus.walleij@linaro.org are

queue-4.14/gpio-iop-add-missing-module_description-author-license.patch
queue-4.14/tools-gpio-fix-build-error-with-musl-libc.patch
queue-4.14/gpio-fix-kernel-stack-leak-to-userspace.patch
queue-4.14/gpio-ath79-add-missing-module_description-license.patch
queue-4.14/gpio-stmpe-i2c-transfer-are-forbiden-in-atomic-context.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-02-01 12:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-01 12:44 Patch "gpio: Fix kernel stack leak to userspace" has been added to the 4.14-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).