All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard GENOUD <richard.genoud@bootlin.com>
To: Tom Rini <trini@konsulko.com>,
	Shahriyar Jalayeri <shahriyar@byteray.co.uk>
Cc: u-boot@lists.u-boot-project.org,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Joao Marcos Costa <joaomarcos.costa@bootlin.com>,
	u-boot@lists.denx.de,
	Michael Zimmermann <sigmaepsilon92@gmail.com>,
	Eric Kilmer <eric.kilmer@trailofbits.com>,
	Argus <argus@byteray.co.uk>
Subject: Re: [PATCH v2 0/2] fs/squashfs: fix directory table integer overflow
Date: Thu, 27 Aug 2026 09:25:38 +0200	[thread overview]
Message-ID: <02a195fd-3dcb-4709-aaf5-606e8c91213b@bootlin.com> (raw)
In-Reply-To: <20260826223236.GA3986474@bill-the-cat>

Le 27/08/2026 à 00:32, Tom Rini a écrit :
> On Tue, Jul 28, 2026 at 08:55:38AM +0200, Shahriyar Jalayeri wrote:
> 
>> This fixes an integer overflow in the SquashFS directory-table reader
>> that leads to a heap out-of-bounds write, and adds a regression test.
>>
>> sqfs_read_directory_table() sizes the directory table with an int
>> multiply (metablks_count * SQFS_METADATA_BLOCK_SIZE) that wraps for a
>> crafted image, under-allocating the buffer that the fill loop then
>> overruns. It is reached by listing or reading the image (sqfsls /
>> sqfsload). Patch 1 guards the allocation with __builtin_mul_overflow();
>> patch 2 adds a test that a crafted image is rejected.
>>
>> Based on v2026.07 (fdfe2ec48d5c). A reproducer is available on request.
>>
>> Signed-off-by: Shahriyar Jalayeri <shahriyar@byteray.co.uk>
>> ---
>> Changes in v2:
>> - Use my real name in the From and Signed-off-by
> 
> Any feedback from the squashfs custodians? Thanks!
> 
Nice patch, looks great!

Reviewed-by: Richard Genoud <richard.genoud@bootlin.com>


  reply	other threads:[~2026-08-27  7:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-28  6:55 [PATCH v2 0/2] fs/squashfs: fix directory table integer overflow Shahriyar Jalayeri
2026-07-28  6:55 ` [PATCH v2 1/2] fs/squashfs: fix integer overflow in directory table allocation Shahriyar Jalayeri
2026-07-28  6:55 ` [PATCH v2 2/2] test: squashfs: add directory table overflow regression test Shahriyar Jalayeri
2026-08-26 22:32 ` [PATCH v2 0/2] fs/squashfs: fix directory table integer overflow Tom Rini
2026-08-27  7:25   ` Richard GENOUD [this message]
2026-08-27 23:53 ` Tom Rini

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=02a195fd-3dcb-4709-aaf5-606e8c91213b@bootlin.com \
    --to=richard.genoud@bootlin.com \
    --cc=argus@byteray.co.uk \
    --cc=eric.kilmer@trailofbits.com \
    --cc=joaomarcos.costa@bootlin.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=shahriyar@byteray.co.uk \
    --cc=sigmaepsilon92@gmail.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --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 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.