From: Phillip Lougher <phillip@squashfs.org.uk>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, news@phoronix.com
Subject: Re: [PATCH v3 00/23] Squashfs: fix a lot of AI issues and AI style issues
Date: Mon, 23 Nov 2026 09:43:13 +0000 [thread overview]
Message-ID: <20261123094313.336001b6251857b182339e6a@squashfs.org.uk> (raw)
In-Reply-To: <20261122235453.dc1115a7efdc685dc69e4744@linux-foundation.org>
On Sun, 22 Nov 2026 23:54:53 -0800
Andrew Morton <akpm@linux-foundation.org> wrote:
> On Mon, 23 Nov 2026 03:42:41 +0000 Phillip Lougher <phillip@squashfs.org.uk> wrote:
>
> > This large patch-set is inspired by the recent spate of AI generated
> > code reports.
>
> Just to be annoying, I fed this into Claude Fable. It said a bunch of
> stuff which looks very optional but the 08/23 blooper is worth fixing,
> so I queued a -fix.
>
God forbid,I would never say you're annoying. But the AI assisted ability
to find fault in everything is exhausting.
AI amplifies problems because it lacks context and insight. Please don't
say you you've got into the belief everything AI says is correct, because
it can be contractory depending on the depth of the anaysis, which means
you will go into endless impossible cycles.
Some of the following is exactly that:
> Unlike chatgpt, Fable is able to build kernels and run them in VMs all
> inside its sandbox. Pretty cool stuff.
>
>
>
>
> [08/23] breaks squashfs_lookup() when its pr_debug is enabled:
>
> struct inode *inode = NULL;
> ...
> TRACE("Entered squashfs_lookup [%llx:%x]\n",
> squashfs_i(inode)->start, squashfs_i(inode)->offset);
>
> That wants to be "dir". With CONFIG_DYNAMIC_DEBUG=y,
>
Yeah a fuckup because the other function used inode not dir.
Easily fixed, no big issue,
> echo 'file fs/squashfs/namei.c +p' > /proc/dynamic_debug/control
>
> and then any lookup which misses the dcache gives
>
> BUG: unable to handle page fault for address: ffffffffffffffc8
> RIP: 0010:squashfs_lookup+0x57/0x4f9
>
> It is still there at the end of the series.
>
> [10/23] now requires the fragment index to end exactly where the next
> table starts. An image with 8 unused bytes there mounts and reads
> correctly today and fails with -EINVAL with this patch (I made one by
> hand to check).
This is correct. By design there is never any padding between metadata,
and any padding is incorrect. This has always been the case back since
2002.
No Squashfs filesystem should be able to hide information (like
malicious metadata) by adding padding between metadata tables.
If it is there, then someone is trying to do something naughty.
The fact the previously sanity check didn't check for this, is
because it was added in the relaxed days of 2011, when the check
was needed to block a fuzzer, and the check added then was
sufficient. Now, if it is not 100% exact, something like
Sashiko will scream it is not sufficient.
[15/23] similarly starts rejecting a compressed block
> whose size equals the block size. Is it certain that no version of
> mksquashfs, and nothing else which writes Squashfs (squashfs-tools-ng,
> the various Go and Rust libraries), ever produced either? If so, please
> say that in the changelogs.
Well this is the rub isn't it. I didn't want to put it in, but
sashishito complained about the lack of it.
Now you're saying another fucking AI is complaining about it being in.
>
> [18/23]-[20/23]: with a small index every entry is checked against its
> neighbour at mount time. With the cached index that checking is gone
> and only the range check in *_lookup_start() remains. I couldn't find
> a way for that to go wrong, but is the difference intended?
>
> [22/23] fixes a regression in mainline (5641371fd0b3) but sits on top
> of [14/23]. If it should go to -stable it needs to come first. None of
> the series is cc:stable at present - is that intended, given the
> changelogs describe permission bypasses?
Yes, the difference is intended. The additional sanity checks make up for
it.
>
> Small things:
>
> - [01/23] isn't a pure conversion: SQUASHFS_COMPRESSED_SIZE() returned
> 32768 for a zero length and squashfs_compressed_size() returns 0.
> Both end up as -EIO in squashfs_read_data(), so it's harmless, but
> the changelog could say so.
Really. I don'have an AI and so I didn't notice. But if the AI
say so, well I'm only the fucking Squashfs author, and so what do
I know.
>
> - [10/23]'s reproducer says fragment_table_start is at offset 72. It's
> at 80, which is what the dd uses.
Shucks.
>
> - [20/23] has "Read fragment indexes into memory" in the xattr code.
>
> - msblk->lookup_table is the superblock's lookup_table_start, and
> msblk->lookup_table_start is something else (the first metadata
> block). Same for fragment_table and xattr_id_table. That's going
> to confuse people.
>
> I built each patch on x86_64 (W=1) and the result on i386 with and
> without CONFIG_SQUASHFS_XATTR, and ran small hand-made uncompressed
> images, including one with 2049-entry fragment and export indexes so
> that the new caches are used; all read back correctly. I have not run
> your reproducers, anything compressed, or xattrs.
I'm sorry Andrew but you have completely pissed me off.
I don't want you handling Squashfs from this day forwards.
I am *almost* at the point of resigning from Linu kernel Squashfs maintenance
due to the endless bullying I have received from you.
But I won't because then *you* will have won.
I am also CC'ing this to the LKML, and Phoronix to show that
that you have been bullying me for the last 4 weeks with my
patch sumission to *my* code.
Thanks for nothing.
Dr. Phillip Lougher
--
Phillip Lougher <phillip@squashfs.org.uk>
prev parent reply other threads:[~2026-11-23 9:43 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 3:42 Phillip Lougher
2026-11-23 3:42 ` [PATCH v3 01/23] Squashfs: convert SQUASHFS_COMPRESSED_* to inline functions Phillip Lougher
2026-11-23 3:42 ` [PATCH v3 02/23] Squashfs: convert SQUASHFS_INODE_* and SQUASHFS_MKINODE " Phillip Lougher
2026-11-23 9:15 ` David Laight
2026-11-23 3:42 ` [PATCH v3 03/23] Squashfs: convert SQUASHFS_FRAGMENT_* " Phillip Lougher
2026-11-23 3:42 ` [PATCH v3 04/23] Squashfs: convert SQUASHFS_LOOKUP_* " Phillip Lougher
2026-11-23 3:42 ` [PATCH v3 05/23] Squashfs: convert SQUASHFS_ID_* " Phillip Lougher
2026-11-23 9:12 ` David Laight
2026-11-23 3:42 ` [PATCH v3 06/23] Squashfs: convert SQUASHFS_XATTR_* " Phillip Lougher
2026-11-23 3:42 ` [PATCH v3 07/23] Squashfs: fix offset in squashfs_read_inode() TRACE statements Phillip Lougher
2026-11-23 3:42 ` [PATCH v3 08/23] Squashfs: don't compute start or alloc memory on empty directory or index Phillip Lougher
2026-11-23 3:42 ` [PATCH v3 09/23] Squashfs: fix fragment bytes overflow on 32-bit architectures Phillip Lougher
2026-11-23 3:42 ` [PATCH v3 10/23] Squashfs: fix fragment index table length too large exploit Phillip Lougher
2026-11-23 3:42 ` [PATCH v3 11/23] Squashfs: sanity check inode metadata block location Phillip Lougher
2026-11-23 3:42 ` [PATCH v3 12/23] Squashfs: sanity check directory " Phillip Lougher
2026-11-23 3:42 ` [PATCH v3 13/23] Squashfs: widen xattr count variables and add sanity check Phillip Lougher
2026-11-23 3:42 ` [PATCH v3 14/23] Squashfs: very large files can exceed an int or size_t Phillip Lougher
2026-11-23 3:42 ` [PATCH v3 15/23] Squashfs: add more sanity checking to squashfs_block_size() Phillip Lougher
2026-11-23 3:42 ` [PATCH v3 16/23] Squashfs: sanity check fragment block location and range Phillip Lougher
2026-11-23 3:42 ` [PATCH v3 17/23] Squashfs: sanity check block list sizes " Phillip Lougher
2026-11-23 3:42 ` [PATCH v3 18/23] Squashfs: don't store large export table indexes in memory Phillip Lougher
2026-11-23 3:43 ` [PATCH v3 19/23] Squashfs: don't store large fragment " Phillip Lougher
2026-11-23 3:43 ` [PATCH v3 20/23] Squashfs: don't store large xattr id " Phillip Lougher
2026-11-23 3:43 ` [PATCH v3 21/23] Squashfs: fix variables in directory code and add more sanity checks Phillip Lougher
2026-11-23 3:43 ` [PATCH v3 22/23] Squashfs: fix regression in squashfs_copy_cache() Phillip Lougher
2026-11-23 3:43 ` [PATCH v3 23/23] Squashfs: check index isn't greater than S64_MAX in squashfs_read_data() Phillip Lougher
2026-11-23 4:13 ` [PATCH v3 00/23] Squashfs: fix a lot of AI issues and AI style issues Andrew Morton
2026-11-23 9:23 ` David Laight
2026-11-23 10:08 ` Phillip Lougher
2026-11-23 11:17 ` David Laight
2026-11-23 13:39 ` David Laight
[not found] ` <20261122235453.dc1115a7efdc685dc69e4744@linux-foundation.org>
2026-11-23 9:43 ` Phillip Lougher [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=20261123094313.336001b6251857b182339e6a@squashfs.org.uk \
--to=phillip@squashfs.org.uk \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=news@phoronix.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®