Commit 24bd3efc authored by Linus Walleij's avatar Linus Walleij

gpio: Fix kernel stack leak to userspace

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

Cc: stable@vger.kernel.org
Reported-by: default avatarArnd Bergmann <arnd@arndb.de>
Reviewed-by: default avatarBartosz Golaszewski <brgl@bgdev.pl>
Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 2046362c
......@@ -744,6 +744,9 @@ static irqreturn_t lineevent_irq_thread(int irq, void *p)
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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment