mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: syzbot ci <syzbot+ci04e7314748e3f6be@syzkaller.appspotmail.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	phillip@squashfs.org.uk, syzbot@lists.linux.dev,
	syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot ci] Re: Squashfs: fix a lot of AI issues and AI style issues
Date: Sun, 15 Nov 2026 23:28:01 -0800	[thread overview]
Message-ID: <20261115232801.b4e3971be104f9cfade6ed01@linux-foundation.org> (raw)
In-Reply-To: <6afaa788.3f8ef711.2cc87e.0002.GAE@google.com>

On Sun, 15 Nov 2026 22:49:44 -0800 syzbot ci <syzbot+ci04e7314748e3f6be@syzkaller.appspotmail.com> 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@squashfs.org.uk
> * [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@linux-foundation.org>
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@linux-foundation.org>
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Closes: https://lore.kernel.org/r/202611131955.0Gd7ipSP-lkp@intel.com/
Cc: Phillip Lougher <phillip.lougher@gmail.com>
Cc: Phillip Lougher <phillip@squashfs.org.uk>

 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);
_


      reply	other threads:[~2026-11-16  7:28 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11 23:43 [PATCH v2 00/22] " Phillip Lougher
2026-11-11 23:43 ` [PATCH v2 01/22] Squashfs: convert SQUASHFS_COMPRESSED_* to inline functions Phillip Lougher
2026-11-11 23:43 ` [PATCH v2 02/22] Squashfs: convert SQUASHFS_INODE_* and SQUASHFS_MKINODE " Phillip Lougher
2026-11-11 23:43 ` [PATCH v2 03/22] Squashfs: convert SQUASHFS_FRAGMENT_* " Phillip Lougher
2026-11-11 23:43 ` [PATCH v2 04/22] Squashfs: convert SQUASHFS_LOOKUP_* " Phillip Lougher
2026-11-11 23:43 ` [PATCH v2 05/22] Squashfs: convert SQUASHFS_ID_* " Phillip Lougher
2026-11-11 23:43 ` [PATCH v2 06/22] Squashfs: convert SQUASHFS_XATTR_* " Phillip Lougher
2026-11-11 23:43 ` [PATCH v2 07/22] Squashfs: fix offset in squashfs_read_inode() TRACE statements Phillip Lougher
2026-11-11 23:43 ` [PATCH v2 08/22] Squashfs: fix fragment bytes overflow on 32-bit architectures Phillip Lougher
2026-11-11 23:43 ` [PATCH v2 09/22] Squashfs: fix fragment index table length too large exploit Phillip Lougher
2026-11-11 23:43 ` [PATCH v2 10/22] Squashfs: sanity check inode metadata block location Phillip Lougher
2026-11-11 23:43 ` [PATCH v2 11/22] Squashfs: sanity check directory " Phillip Lougher
2026-11-11 23:43 ` [PATCH v2 12/22] Squashfs: widen xattr count variables and add sanity check Phillip Lougher
2026-11-11 23:43 ` [PATCH v2 13/22] Squashfs: very large files can exceed an int block count Phillip Lougher
2026-11-11 23:43 ` [PATCH v2 14/22] Squashfs: add more sanity checking to squashfs_block_size() Phillip Lougher
2026-11-11 23:43 ` [PATCH v2 15/22] Squashfs: sanity check fragment block location and range Phillip Lougher
2026-11-11 23:43 ` [PATCH v2 16/22] Squashfs: sanity check block list sizes " Phillip Lougher
2026-11-11 23:43 ` [PATCH v2 17/22] Squashfs: don't store large export table indexes in memory Phillip Lougher
2026-11-12 19:09   ` Andrew Morton
2026-11-11 23:43 ` [PATCH v2 18/22] Squashfs: don't store large fragment " Phillip Lougher
2026-11-11 23:43 ` [PATCH v2 19/22] Squashfs: don't store large xattr id " Phillip Lougher
2026-11-11 23:44 ` [PATCH v2 20/22] Squashfs: fix variables in directory code and add more sanity checks Phillip Lougher
2026-11-11 23:44 ` [PATCH v2 21/22] Squashfs: fix regression in squashfs_copy_cache() Phillip Lougher
2026-11-11 23:44 ` [PATCH v2 22/22] Squashfs: check index isn't greater than S64_MAX in squashfs_read_data() Phillip Lougher
2026-11-16  6:49 ` [syzbot ci] Re: Squashfs: fix a lot of AI issues and AI style issues syzbot ci
2026-11-16  7:28   ` Andrew Morton [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=20261115232801.b4e3971be104f9cfade6ed01@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=phillip@squashfs.org.uk \
    --cc=syzbot+ci04e7314748e3f6be@syzkaller.appspotmail.com \
    --cc=syzbot@lists.linux.dev \
    --cc=syzkaller-bugs@googlegroups.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®