From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Guangshuo Li <lgs201920130244@gmail.com>
Cc: "Andy Shevchenko" <andy@kernel.org>,
"Geert Uytterhoeven" <geert@linux-m68k.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: Thu, 26 Mar 2026 21:18:35 +0200 [thread overview]
Message-ID: <acWGi1aMWrk05GLz@ashevche-desk.local> (raw)
In-Reply-To: <20260326171412.1109402-1-lgs201920130244@gmail.com>
On Fri, Mar 27, 2026 at 01:14:12AM +0800, Guangshuo Li 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.
>
> The struct device released here is the embedded linedisp->dev used by
> linedisp_register(), so retrieve the enclosing object directly with
> container_of() instead.
Makes sense to me. How did you find the issue?
Geert, do you agree with this change?
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-03-26 19:18 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 [this message]
2026-03-27 4:28 ` Guangshuo Li
2026-03-27 8:10 ` Geert Uytterhoeven
2026-03-27 8:54 ` Andy Shevchenko
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=acWGi1aMWrk05GLz@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