[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdYTKZo8jvwMFKh_j17KXNetz=-qHmLd+Y380rNMV6VMeg@mail.gmail.com>
Date: Mon, 17 Dec 2018 23:09:47 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: "Gustavo A. R. Silva" <gustavo@...eddedor.com>,
Bartosz Golaszewski <bgolaszewski@...libre.com>
Cc: "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] gpiolib: Fix potential Spectre v1 vulnerabilities
On Mon, Dec 17, 2018 at 10:34 PM Gustavo A. R. Silva
<gustavo@...eddedor.com> wrote:
> offset and lineinfo.line_offset are indirectly controlled by user-space,
> hence leading to a potential exploitation of the Spectre variant 1
> vulnerability.
Goodness gracious me!
> This issue was detected with the help of Smatch:
>
> drivers/gpio/gpiolib.c:580 linehandle_create() warn: potential spectre issue 'gdev->descs' [r] (local cap)
> drivers/gpio/gpiolib.c:927 lineevent_create() warn: potential spectre issue 'gdev->descs' [r] (local cap)
> drivers/gpio/gpiolib.c:1053 gpio_ioctl() warn: potential spectre issue 'gdev->descs' [r] (local cap)
>
> Fix this by sanitizing both offset and lineinfo.line_offset before
> using them to index gdev->descs.
>
> Notice that given that speculation windows are large, the policy is
> to kill the speculation on the first load and not worry if it can be
> completed with a dependent load/store [1].
>
> [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2
>
> Cc: stable@...r.kernel.org
> Signed-off-by: Gustavo A. R. Silva <gustavo@...eddedor.com>
Bartosz can you take this for a ride with libgpiod and see if we get
performance regressions from this speculation killing?
If you get some data on that I would like to include it with
the changelog.
Yours,
Linus Walleij
Powered by blists - more mailing lists