linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Guo Zihao <guozh23@xiaopeng.com>
Cc: Richard Weinberger <richard@nod.at>,
	 Vignesh Raghavendra <vigneshr@ti.com>,
	 Yangtao Li <frank.li@vivo.com>,
	linux-mtd@lists.infradead.org,  linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] mtd: lantiq-flash: Fix NULL pointer dereference in probe
Date: Tue, 17 Nov 2026 14:32:26 +0100	[thread overview]
Message-ID: <87mrr7lh1x.fsf@bootlin.com> (raw)
In-Reply-To: <20261106014928.4126855-1-guozh23@xiaopeng.com> (Guo Zihao's message of "Fri, 6 Nov 2026 09:49:28 +0800")

On 06/11/2026 at 09:49:28 +08, Guo Zihao <guozh23@xiaopeng.com> wrote:

> ltq_mtd_probe() dereferences ltq_mtd->map->virt before the map_info
> structure is allocated: the map pointer itself is still NULL when
> ltq_mtd->map->virt is assigned, because the structure is allocated a
> few lines below. Any device with a "lantiq,nor" compatible therefore
> crashes the kernel with a NULL pointer dereference during probe.
>
> Assign the mapping after the map_info allocation instead.
>
> Fixes: 6145e07e9c77 ("mtd: lantiq-flash: Use devm_platform_get_and_ioremap_resource()")
> Cc: stable@vger.kernel.org
> Signed-off-by: Guo Zihao <guozh23@xiaopeng.com>

Hello, this is a duplicate of a wider series from Simon Wunderlich, I
took his since there are more behavioral fixes.

Thanks for the contribution anyway!
Miquèl

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

      reply	other threads:[~2026-11-17 13:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06  1:49 [PATCH] mtd: lantiq-flash: Fix NULL pointer dereference in probe Guo Zihao
2026-11-17 13:32 ` Miquel Raynal [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=87mrr7lh1x.fsf@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=frank.li@vivo.com \
    --cc=guozh23@xiaopeng.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    --cc=stable@vger.kernel.org \
    --cc=vigneshr@ti.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;
as well as URLs for NNTP newsgroup(s).