From: Johan Hovold <johan@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Danilo Krummrich <dakr@kernel.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Daniel Scally <djrscally@gmail.com>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Bartosz Golaszewski <brgl@kernel.org>,
driver-core@lists.linux.dev, linux-acpi@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Subject: Re: [PATCH 2/2] software node: fix primary software node removal
Date: Mon, 2 Nov 2026 17:34:09 +0100 [thread overview]
Message-ID: <aui7gUuJ4zMVM8gF@hovoldconsulting.com> (raw)
In-Reply-To: <20261102111420.1330760-3-johan@kernel.org>
On Mon, Nov 02, 2026 at 12:14:20PM +0100, Johan Hovold wrote:
> When removing a software node using device_remove_software_node(), the
> primary fwnode pointer is never cleared if the software node is the
> primary node.
>
> Since commit 7d80509ff0da ("driver core: platform: unify release path")
> this can lead to a use-after-free when freeing a platform device if a
> driver or subsystem (e.g. mfd) has already removed and freed the node.
>
> Clear the primary fwnode pointer when removing a software node that is
> the primary node to avoid this.
>
> Fixes: 7d80509ff0da ("driver core: platform: unify release path")
> Cc: stable@vger.kernel.org # 7.3
> Cc: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
> Signed-off-by: Johan Hovold <johan@kernel.org>
Sashiko had some comments on this one, will revisit.
The first patch could go in meanwhile.
Johan
next prev parent reply other threads:[~2026-11-02 16:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 11:14 [PATCH 0/2] driver core: platform: fix sw node use-after-free on device release Johan Hovold
2026-11-02 11:14 ` [PATCH 1/2] " Johan Hovold
2026-11-02 13:48 ` Bartosz Golaszewski
2026-11-02 11:14 ` [PATCH 2/2] software node: fix primary software node removal Johan Hovold
2026-11-02 16:34 ` Johan Hovold [this message]
2026-11-02 22:11 ` (subset) [PATCH 0/2] driver core: platform: fix sw node use-after-free on device release Danilo Krummrich
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=aui7gUuJ4zMVM8gF@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bartosz.golaszewski@oss.qualcomm.com \
--cc=brgl@kernel.org \
--cc=dakr@kernel.org \
--cc=djrscally@gmail.com \
--cc=driver-core@lists.linux.dev \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=stable@vger.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
all inboxes | Powered by JetHome®