Re: [syzbot ci] Re: Squashfs: fix a lot of AI issues and AI style issues

From: Andrew Morton

Date: Mon Nov 16 2026 - 02:28:07 EST


On Sun, 15 Nov 2026 22:49:44 -0800 syzbot ci <syzbot+ci04e7314748e3f6be@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

> syzbot ci has tested the following series
>
> [v2] Squashfs: fix a lot of AI issues and AI style issues
> https://lore.kernel.org/all/20261111234402.252354-1-phillip@xxxxxxxxxxxxxxx
> * [PATCH v2 01/22] Squashfs: convert SQUASHFS_COMPRESSED_* to inline functions
> * [PATCH v2 02/22] Squashfs: convert SQUASHFS_INODE_* and SQUASHFS_MKINODE to inline functions
> * [PATCH v2 03/22] Squashfs: convert SQUASHFS_FRAGMENT_* to inline functions
> * [PATCH v2 04/22] Squashfs: convert SQUASHFS_LOOKUP_* to inline functions
> * [PATCH v2 05/22] Squashfs: convert SQUASHFS_ID_* to inline functions
> * [PATCH v2 06/22] Squashfs: convert SQUASHFS_XATTR_* to inline functions
> * [PATCH v2 07/22] Squashfs: fix offset in squashfs_read_inode() TRACE statements
> * [PATCH v2 08/22] Squashfs: fix fragment bytes overflow on 32-bit architectures
> * [PATCH v2 09/22] Squashfs: fix fragment index table length too large exploit
> * [PATCH v2 10/22] Squashfs: sanity check inode metadata block location
> * [PATCH v2 11/22] Squashfs: sanity check directory metadata block location
> * [PATCH v2 12/22] Squashfs: widen xattr count variables and add sanity check
> * [PATCH v2 13/22] Squashfs: very large files can exceed an int block count
> * [PATCH v2 14/22] Squashfs: add more sanity checking to squashfs_block_size()
> * [PATCH v2 15/22] Squashfs: sanity check fragment block location and range
> * [PATCH v2 16/22] Squashfs: sanity check block list sizes and range
> * [PATCH v2 17/22] Squashfs: don't store large export table indexes in memory
> * [PATCH v2 18/22] Squashfs: don't store large fragment table indexes in memory
> * [PATCH v2 19/22] Squashfs: don't store large xattr id table indexes in memory
> * [PATCH v2 20/22] Squashfs: fix variables in directory code and add more sanity checks
> * [PATCH v2 21/22] Squashfs: fix regression in squashfs_copy_cache()
> * [PATCH v2 22/22] Squashfs: check index isn't greater than S64_MAX in squashfs_read_data()
>
> and found the following issues:
> * general protection fault in __d_obtain_alias
> * general protection fault in lookup_one_qstr_excl
> * general protection fault in lookup_open
> * general protection fault in security_d_instantiate
> * general protection fault in step_into_slowpath
>
> Full report is available here:
> https://ci.syzbot.org/series/dc24cdf0-7531-440e-8970-9c83c975cd2f

OK, thanks.

I think I just fixed this thanks to a smatch report from Dan. Below.


<llm>
Separately, "[PATCH v2 11/22] Squashfs: sanity check directory metadata
block location" stores squashfs_dir_start() in a u64 in
squashfs_lookup(), then checks block < 0. That check cannot detect its
negative error returns; block needs a signed type.
</llm>

OK. I'll put a s64 cast in there for now. So hopefully we're all good.
Phillip, please check.



From: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Subject: squashfs-fix-variables-in-directory-code-and-add-more-sanity-checks-fix
Date: Sun Nov 15 09:54:43 PM PST 2026

fix smatch warnings

Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Reported-by: Dan Carpenter <error27@xxxxxxxxx>
Closes: https://lore.kernel.org/r/202611131955.0Gd7ipSP-lkp@xxxxxxxxx/
Cc: Phillip Lougher <phillip.lougher@xxxxxxxxx>
Cc: Phillip Lougher <phillip@xxxxxxxxxxxxxxx>

fs/squashfs/namei.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

--- a/fs/squashfs/namei.c~squashfs-fix-variables-in-directory-code-and-add-more-sanity-checks-fix
+++ a/fs/squashfs/namei.c
@@ -221,8 +221,10 @@ static struct dentry *squashfs_lookup(st
/*
* Read directory entry.
*/
- if (!squashfs_dir_space(dir, length, sizeof(*dire)))
+ if (!squashfs_dir_space(dir, length, sizeof(*dire))) {
+ err = -ENOSPC;
goto read_failure;
+ }

err = squashfs_read_metadata(dir->i_sb, dire, &block,
&offset, sizeof(*dire));
@@ -236,8 +238,10 @@ static struct dentry *squashfs_lookup(st
if (size > SQUASHFS_NAME_LEN)
goto data_error;

- if (!squashfs_dir_space(dir, length, size))
+ if (!squashfs_dir_space(dir, length, size)) {
+ err = -ENOSPC;
goto read_failure;
+ }

err = squashfs_read_metadata(dir->i_sb, dire->name,
&block, &offset, size);
_