From: Phillip Lougher
**Date:** Mon Nov 23 2026 - 04:43:37 EST
On Sun, 22 Nov 2026 23:54:53 -0800
Andrew Morton akpm@xxxxxxxxxxxxxxxxxxxx wrote:
On Mon, 23 Nov 2026 03:42:41 +0000 Phillip Lougher phillip@xxxxxxxxxxxxxxx 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
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@xxxxxxxxxxxxxxx