U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Oscar Deschamps <odeschamps.mail@gmail.com>
Cc: Joao Marcos Costa <joaomarcos.costa@bootlin.com>,
	 Richard Genoud <richard.genoud@bootlin.com>,
	 Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	 Allan ELKAIM <allan.elkaim@gmail.com>,
	Tom Rini <trini@konsulko.com>,
	 u-boot@lists.u-boot-project.org
Subject: Re: [PATCH] fs/squashfs: fix NULL dereference on failed symlink resolution
Date: Wed, 28 Oct 2026 15:27:05 +0100	[thread overview]
Message-ID: <87ld7hgati.fsf@bootlin.com> (raw)
In-Reply-To: <20261028134427.405740-1-odeschamps.mail@gmail.com> (Oscar Deschamps's message of "Wed, 28 Oct 2026 14:44:27 +0100")

Hi Oscar,

On 28/10/2026 at 14:44:27 +01, Oscar Deschamps <odeschamps.mail@gmail.com> wrote:

> sqfs_resolve_symlink() can return NULL, on its symlink_size overflow
> guard or on an allocation failure. sqfs_read_nest() and sqfs_size_nest()
> use the result without checking it, unlike sqfs_search_dir(), and the
> NULL reaches sqfs_split_path() which dereferences path[0]. A crafted or
> corrupted image can thus crash U-Boot (a NULL read) while reading or
> sizing a file through a symlink.
>
> Check the result in both callers and guard sqfs_split_path() against a
> NULL path. Found by fuzzing the SquashFS parser.
>
> Signed-off-by: Oscar Deschamps <odeschamps.mail@gmail.com>

Thanks for the patch!

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Miquèl

      reply	other threads:[~2026-10-28 14:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-28 13:44 [PATCH] fs/squashfs: fix NULL dereference on failed symlink resolution Oscar Deschamps
2026-10-28 14:27 ` 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=87ld7hgati.fsf@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=allan.elkaim@gmail.com \
    --cc=joaomarcos.costa@bootlin.com \
    --cc=odeschamps.mail@gmail.com \
    --cc=richard.genoud@bootlin.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.u-boot-project.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