From: Johan Hovold <johan@kernel.org>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Mark Brown <broonie@kernel.org>, Frank Li <Frank.Li@nxp.com>,
Sascha Hauer <s.hauer@pengutronix.de>,
Heiko Stuebner <heiko@sntech.de>,
Laxman Dewangan <ldewangan@nvidia.com>,
linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH 1/5] spi: imx: fix use-after-free on unbind
Date: Mon, 23 Mar 2026 12:20:08 +0100 [thread overview]
Message-ID: <acEh6KiKMfBehoZO@hovoldconsulting.com> (raw)
In-Reply-To: <20260323-demonic-worthy-guillemot-c2abb8-mkl@pengutronix.de>
[-- Attachment #1: Type: text/plain, Size: 660 bytes --]
On Mon, Mar 23, 2026 at 12:00:59PM +0100, Marc Kleine-Budde wrote:
> On 23.03.2026 11:49:44, Johan Hovold wrote:
> > The SPI subsystem frees the controller and any subsystem allocated
> > driver data as part of deregistration (unless the allocation is device
> > managed).
> >
> > Take another reference before deregistering the controller so that the
> > driver data is not freed until the driver is done with it.
>
> Would re-ordering the spi_imx_remove() function be an alternative fix?
> I.e. call spi_unregister_controller() last?
No, the controller needs to be deregistered before disabling clocks and
releasing other resources.
Johan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 265 bytes --]
next prev parent reply other threads:[~2026-03-23 11:20 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-23 10:49 [PATCH 0/5] spi: imx: fix use-after-free on unbind Johan Hovold
2026-03-23 10:49 ` [PATCH 1/5] " Johan Hovold
2026-03-23 11:00 ` Marc Kleine-Budde
2026-03-23 11:20 ` Johan Hovold [this message]
2026-03-23 11:57 ` Marc Kleine-Budde
2026-03-23 13:59 ` Johan Hovold
2026-03-23 14:47 ` Marc Kleine-Budde
2026-03-23 15:41 ` Johan Hovold
2026-03-23 10:49 ` [PATCH 2/5] spi: imx: switch to managed controller allocation Johan Hovold
2026-03-23 10:49 ` [PATCH 3/5] spi: tegra20-slink: " Johan Hovold
2026-03-23 10:49 ` [PATCH 4/5] spi: rockchip: fix controller deregistration Johan Hovold
2026-03-23 16:35 ` Mark Brown
2026-03-23 16:51 ` Johan Hovold
2026-03-23 17:02 ` Mark Brown
2026-03-24 8:09 ` Johan Hovold
2026-03-23 10:49 ` [PATCH 5/5] spi: rockchip: switch to managed controller allocation Johan Hovold
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=acEh6KiKMfBehoZO@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=Frank.Li@nxp.com \
--cc=broonie@kernel.org \
--cc=heiko@sntech.de \
--cc=ldewangan@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=s.hauer@pengutronix.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.