Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1423897
| From | Linus Walleij <linus.walleij@linaro.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] gpiolib: avoid uninitialized data in gpio kfifo |
| Date | 2016-06-16 12:10 +0200 |
| Message-ID | <rKCpk-72x-31@gated-at.bofh.it> (permalink) |
| References | <rKBtf-6qC-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thu, Jun 16, 2016 at 11:02 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> gcc reports a theoretical case for returning uninitialized data in
> the kfifo when a GPIO interrupt happens and neither
> GPIOEVENT_REQUEST_RISING_EDGE nor GPIOEVENT_REQUEST_FALLING_EDGE
> are set:
>
> drivers/gpio/gpiolib.c: In function 'lineevent_irq_thread':
> drivers/gpio/gpiolib.c:683:87: error: 'ge.id' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>
> This case should not happen, but to be on the safe side, let's
> return from the irq handler without adding data to the FIFO
> to ensure we can never leak stack data to user space.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 61f922db7221 ("gpio: userspace ABI for reading GPIO line events")
Patch applied, good catch, thanks!
Yours,
Linus Walleij
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] gpiolib: avoid uninitialized data in gpio kfifo Arnd Bergmann <arnd@arndb.de> - 2016-06-16 11:10 +0200 Re: [PATCH] gpiolib: avoid uninitialized data in gpio kfifo Linus Walleij <linus.walleij@linaro.org> - 2016-06-16 12:10 +0200
csiph-web