mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Michael Walle" <mwalle@kernel.org>
To: <tze.yee.ng@altera.com>, "Pratyush Yadav" <pratyush@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: [PATCH 1/2] mtd: spi-nor: Fix deadlock in spi_nor_rww_start_exclusive()
Date: Mon, 21 Sep 2026 08:58:29 +0200	[thread overview]
Message-ID: <DLKSSLURXYDB.2VSDOA0K7U9MN@kernel.org> (raw)
In-Reply-To: <46e4e2e31f051f64c120307216ce2766c004d9af.1788404586.git.tze.yee.ng@altera.com>

[-- Attachment #1: Type: text/plain, Size: 870 bytes --]

On Thu Sep 3, 2026 at 5:14 AM CEST, tze.yee.ng wrote:
> From: Tze Yee Ng <tze.yee.ng@altera.com>
>
> spi_nor_rww_start_exclusive() takes nor->lock with a bare mutex_lock()
> and returns with it held, while its counterpart
> spi_nor_rww_end_exclusive() re-acquires nor->lock via guard(mutex). Any
> exclusive operation on a read-while-write (SNOR_F_RWW) part thus
> deadlocks against itself.
>
> The exclusive section is serialized by the rww ongoing_io/rd/pe flags,
> so take nor->lock with guard(mutex) like the sibling start helpers.
>
> Fixes: 03e7bb864d9a9 ("mtd: spi-nor: use scope-based mutex cleanup helpers")
> Cc: stable@vger.kernel.org
> Signed-off-by: Tze Yee Ng <tze.yee.ng@altera.com>

This was already fixed in:
https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git/commit/?id=44b8a0bf5f96e8393312fc34b956766882341f16

-michael

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 297 bytes --]

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

Thread overview: 6+ 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 [this message]
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
     [not found] ` <SJ0PR03MB5950909EBD8335469678D0A2A1842@SJ0PR03MB5950.namprd03.prod.outlook.com>
2026-09-21  6:35   ` Fw: [PATCH 0/2] mtd: spi-nor: Fix unbind deadlock and use-after-free NG, TZE YEE

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=DLKSSLURXYDB.2VSDOA0K7U9MN@kernel.org \
    --to=mwalle@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=pratyush@kernel.org \
    --cc=takahiro.kuwano@infineon.com \
    --cc=tudor.ambarus@linaro.org \
    --cc=tze.yee.ng@altera.com \
    /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®