From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "Guangshuo Li" <lgs201920130244@gmail.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Jean-François Lessard" <jefflessard3@gmail.com>,
"Ingo Molnar" <mingo@kernel.org>,
"Thomas Gleixner" <tglx@kernel.org>,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] auxdisplay: line-display: fix NULL dereference in linedisp_release
Date: Fri, 27 Mar 2026 10:54:49 +0200 [thread overview]
Message-ID: <acZF2YSN2C5cinTi@ashevche-desk.local> (raw)
In-Reply-To: <CAMuHMdWY=pjuLvqU2baRsetbOYf=cFF_y4PsJ0DxH_zTGfx8ng@mail.gmail.com>
On Fri, Mar 27, 2026 at 09:10:50AM +0100, Geert Uytterhoeven wrote:
> Hi Guangshuo,
>
> Thanks for your patch!
>
> On Thu, 26 Mar 2026 at 18:14, Guangshuo Li <lgs201920130244@gmail.com> wrote:
> > linedisp_release() currently retrieves the enclosing struct linedisp via
> > to_linedisp(). That lookup depends on the attachment list, but the
> > attachment may already have been removed before put_device() invokes the
> > release callback. This can happen in linedisp_unregister(), and can also
> > be reached from some linedisp_register() error paths.
> >
> > In that case, to_linedisp() returns NULL and linedisp_release()
> > dereferences it while freeing the display resources.
>
> Indeed, the attachment is not yet or no longer available when
> put_device() is called.
>
> > The struct device released here is the embedded linedisp->dev used by
> > linedisp_register(), so retrieve the enclosing object directly with
> > container_of() instead.
>
> True.
>
> > Fixes: 66c93809487e ("auxdisplay: linedisp: encapsulate container_of usage within to_linedisp")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
>
> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Pushed to my review and testing queue, thanks!
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2026-03-27 8:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-26 17:14 [PATCH] auxdisplay: line-display: fix NULL dereference in linedisp_release Guangshuo Li
2026-03-26 19:18 ` Andy Shevchenko
2026-03-27 4:28 ` Guangshuo Li
2026-03-27 8:10 ` Geert Uytterhoeven
2026-03-27 8:54 ` Andy Shevchenko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=acZF2YSN2C5cinTi@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=geert@linux-m68k.org \
--cc=jefflessard3@gmail.com \
--cc=lgs201920130244@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=stable@vger.kernel.org \
--cc=tglx@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox