public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Danilo Krummrich <dakr@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	driver-core@lists.linux.dev, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH v2 1/2] driver core: faux: fix root device registration
Date: Wed, 29 Apr 2026 13:19:47 +0200	[thread overview]
Message-ID: <afHpUxQ5U_4RWjDZ@hovoldconsulting.com> (raw)
In-Reply-To: <DI5KV97TNS9D.28EQTYL46PKT1@kernel.org>

On Wed, Apr 29, 2026 at 12:47:53PM +0200, Danilo Krummrich wrote:
> On Wed Apr 29, 2026 at 12:17 PM CEST, Johan Hovold wrote:
> > On Wed, Apr 29, 2026 at 12:19:06AM +0200, Danilo Krummrich wrote:
> >> On Fri Apr 24, 2026 at 5:31 PM CEST, Johan Hovold wrote:
> >> > A recent change made the faux bus root device be allocated dynamically
> >> > but failed to provide a release function to free the memory when the
> >> > last reference is dropped (on theoretical failure to register the device
> >> > or bus).
> >> >
> >> > Fix this by using root_device_register() instead of open coding.
> >> >
> >> > Also add the missing sanity check when registering faux devices to avoid
> >> > use-after-free if the bus failed to register (which would previously
> >> > have triggered a bunch of use-after-free warnings).
> >> >
> >> > Fixes: 61b76d07d2b4 ("driver core: faux: stop using static struct device")
> >> > Cc: stable@vger.kernel.org	# 7.0
> >> 
> >> I think this is more of a theoretical issue, do we need this in stable trees?
> >
> > Sure, this is borderline, but given that autosel would probably pick it
> > up anyway we might as well mark it directly.
> 
> In such a case developers should probably give the stable team a hint that the
> patch in question does not need backporting.
> 
> But using the expectation that autosel may pick it up as a justification to mark
> it for stable in the first place seems wrong.

It fixes a memory leak (and some warnings). We backport such fixes all
the time, including in other error paths which are unlikely to ever be
hit.

> The stable documentation [1] is very clear that theoretical issues must not be
> backported into stable trees unless an explanation of how the bug can be
> exploited can be provided.
> 
> If that was relaxed in some way, it probably needs updating.

The stable rules have been relaxed in practice since Autosel. Anything
that looks like a fix (e.g. has a Fixes tag) gets backported.

And people get tired of asking the stable team to drop patches that were
not marked for backporting.

But feel free to drop the CC-stable tag here if you want to.

Johan

  reply	other threads:[~2026-04-29 11:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-24 15:31 [PATCH v2 0/2] driver core: faux: fix root device registration Johan Hovold
2026-04-24 15:31 ` [PATCH v2 1/2] " Johan Hovold
2026-04-28 22:19   ` Danilo Krummrich
2026-04-29 10:17     ` Johan Hovold
2026-04-29 10:47       ` Danilo Krummrich
2026-04-29 11:19         ` Johan Hovold [this message]
2026-04-29 14:20           ` Danilo Krummrich
2026-04-29 15:02             ` Johan Hovold
2026-04-29 20:11               ` Danilo Krummrich
2026-04-30  7:00                 ` Greg Kroah-Hartman
2026-04-30 11:29                   ` Danilo Krummrich
2026-04-24 15:31 ` [PATCH v2 2/2] driver core: faux: clean up init error handling Johan Hovold
2026-04-29 20:22 ` [PATCH v2 0/2] driver core: faux: fix root device registration 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=afHpUxQ5U_4RWjDZ@hovoldconsulting.com \
    --to=johan@kernel.org \
    --cc=dakr@kernel.org \
    --cc=driver-core@lists.linux.dev \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --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