mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 08:19:28 +00:00
gpio: Fix kernel stack leak to userspace
commit 24bd3efc9d
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>
This commit is contained in:
parent
460c5b9745
commit
c5845e0254
1 changed files with 3 additions and 0 deletions
|
@ -723,6 +723,9 @@ static irqreturn_t lineevent_irq_thread(int irq, void *p)
|
||||||
struct gpioevent_data ge;
|
struct gpioevent_data ge;
|
||||||
int ret, level;
|
int ret, level;
|
||||||
|
|
||||||
|
/* Do not leak kernel stack to userspace */
|
||||||
|
memset(&ge, 0, sizeof(ge));
|
||||||
|
|
||||||
ge.timestamp = ktime_get_real_ns();
|
ge.timestamp = ktime_get_real_ns();
|
||||||
level = gpiod_get_value_cansleep(le->desc);
|
level = gpiod_get_value_cansleep(le->desc);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue