[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACRpkdaif9UJ2SwyMFuYXB6U2b2ikT8QtCy9Se9zfswLkaJNkA@mail.gmail.com>
Date: Tue, 2 Mar 2021 16:40:22 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: Johan Hovold <johan@...nel.org>
Cc: Bartosz Golaszewski <bgolaszewski@...libre.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Saravana Kannan <saravanak@...gle.com>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
syzbot+d27b4c8adbbff70fbfde@...kaller.appspotmail.com
Subject: Re: [PATCH v2 1/2] gpio: fix NULL-deref-on-deregistration regression
On Mon, Mar 1, 2021 at 10:05 AM Johan Hovold <johan@...nel.org> wrote:
> Fix a NULL-pointer deference when deregistering the gpio character
> device that was introduced by the recent stub-driver hack. When the new
> "driver" is unbound as part of deregistration, driver core clears the
> driver-data pointer which is used to retrieve the struct gpio_device in
> its release callback.
>
> Fix this by using container_of() in the release callback as should have
> been done all along.
>
> Fixes: 4731210c09f5 ("gpiolib: Bind gpio_device to a driver to enable fw_devlink=on by default")
> Cc: Saravana Kannan <saravanak@...gle.com>
> Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> Reported-by: syzbot+d27b4c8adbbff70fbfde@...kaller.appspotmail.com
> Signed-off-by: Johan Hovold <johan@...nel.org>
Oh nice catch!
Reviewed-by: Linus Walleij <linus.walleij@...aro.org>
Yours,
Linus Walleij
Powered by blists - more mailing lists