Linux-mtd Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "NG, TZE YEE" <tze.yee.ng@altera.com>
To: Pratyush Yadav <pratyush@kernel.org>,
	Michael Walle <mwalle@kernel.org>,
	Takahiro Kuwano <takahiro.kuwano@infineon.com>,
	Tudor Ambarus <tudor.ambarus@linaro.org>,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: Fw: [PATCH 0/2] mtd: spi-nor: Fix unbind deadlock and use-after-free
Date: Mon, 21 Sep 2026 14:35:24 +0800	[thread overview]
Message-ID: <da7eb086-1a4b-4631-bacc-f3badb075f6b@altera.com> (raw)
In-Reply-To: <SJ0PR03MB5950909EBD8335469678D0A2A1842@SJ0PR03MB5950.namprd03.prod.outlook.com>

On 21/9/2026 2:27 pm, NG, TZE YEE wrote:
> 
> *From:* NG, TZE YEE
> *Sent:* Thursday, September 3, 2026 11:14 AM
> *To:* Pratyush Yadav <pratyush@kernel.org>; Michael Walle 
> <mwalle@kernel.org>; Takahiro Kuwano <takahiro.kuwano@infineon.com>; 
> Tudor Ambarus <tudor.ambarus@linaro.org>; linux-mtd@lists.infradead.org 
> <linux-mtd@lists.infradead.org>; linux-kernel@vger.kernel.org <linux- 
> kernel@vger.kernel.org>
> *Subject:* [PATCH 0/2] mtd: spi-nor: Fix unbind deadlock and use-after-free
> From: Tze Yee Ng <tze.yee.ng@altera.com>
> 
> Two fixes in the spi-nor core around locking and driver unbind:
> 
> Patch 1 fixes a self-deadlock in spi_nor_rww_start_exclusive(), which
> took nor->lock while its end helper re-acquired it via guard(mutex).
> 
> Patch 2 fixes a use-after-free where a sysfs unbind frees the
> devm-allocated spi_nor while /dev/mtdX is still open. Give it a kref
> lifetime on the spi-mem probe path and fail operations with -ENODEV
> after unbind. Legacy controllers are unchanged.
> 
> Tze Yee Ng (2):
>    mtd: spi-nor: Fix deadlock in spi_nor_rww_start_exclusive()
>    mtd: spi-nor: core: Fix use-after-free of spi_nor on unbind with open
>      handles
> 
>   drivers/mtd/spi-nor/core.c  | 113 ++++++++++++++++++++++++++++++++----
>   include/linux/mtd/spi-nor.h |  17 ++++++
>   2 files changed, 119 insertions(+), 11 deletions(-)
> 
> -- 
> 2.43.7
> 

Hi,

Gentle ping on this patch. It has been over 2 weeks with no feedback.

Happy to address any review comments.

Thanks,
Tze Yee


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

      parent reply	other threads:[~2026-09-21  6:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-03  3:14 [PATCH 0/2] mtd: spi-nor: Fix unbind deadlock and use-after-free tze.yee.ng
2026-09-03  3:14 ` [PATCH 1/2] mtd: spi-nor: Fix deadlock in spi_nor_rww_start_exclusive() tze.yee.ng
2026-09-21  6:58   ` Michael Walle
2026-10-06  2:13     ` NG, TZE YEE
2026-09-03  3:14 ` [PATCH 2/2] mtd: spi-nor: core: Fix use-after-free of spi_nor on unbind with open handles tze.yee.ng
2026-09-21  7:26   ` Michael Walle
2026-10-06  2:13     ` NG, TZE YEE
     [not found] ` <SJ0PR03MB5950909EBD8335469678D0A2A1842@SJ0PR03MB5950.namprd03.prod.outlook.com>
2026-09-21  6:35   ` NG, TZE YEE [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=da7eb086-1a4b-4631-bacc-f3badb075f6b@altera.com \
    --to=tze.yee.ng@altera.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=mwalle@kernel.org \
    --cc=pratyush@kernel.org \
    --cc=takahiro.kuwano@infineon.com \
    --cc=tudor.ambarus@linaro.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