From: William Chuang <founder@logarcheon.com>
To: Aibing Chen <chenaibing@cmss.chinamobile.com>
Cc: Phillip Lougher <phillip@squashfs.org.uk>,
Andrew Morton <akpm@linux-foundation.org>,
wangxiaolei01@kaihong.com, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org,
syzbot+5d7ba5f6127ed887f459@syzkaller.appspotmail.com,
syzbot+7b1d0ea11475e857d063@syzkaller.appspotmail.com,
syzbot+d8a69701a6e796ad5d3e@syzkaller.appspotmail.com
Subject: Re: [PATCH 1/2] squashfs: return -EINVAL on invalid directory inode size
Date: Tue, 17 Nov 2026 00:54:01 +0000 [thread overview]
Message-ID: <20261117005352.48227-1-founder@logarcheon.com> (raw)
Hi Aibing,
Two more open syzbot reports on linux-next 84abb955b101 have the same
root cause as this patch: the two new "i_size < 3" checks in
squashfs_read_inode() reach failed_read with err still holding the
positive byte count of the inode read (32 or 40).
kernel BUG in vfs_get_tree (3)
https://syzkaller.appspot.com/bug?extid=7b1d0ea11475e857d063
(mount: get_tree() returns 40 and fc->root is never set)
general protection fault in security_d_instantiate
https://syzkaller.appspot.com/bug?extid=d8a69701a6e796ad5d3e
(lookup: squashfs_iget() returns ERR_PTR(40), which IS_ERR() does
not catch, and d_splice_alias() dereferences it)
The second was filed under [lsm?], so it will probably stay open
unless the fix names it. Whichever version is applied -- this one, or
"Squashfs: return -EINVAL when directory size check fails" (cc'd),
which changes the same two lines -- could carry all three reports:
Reported-by: syzbot+5d7ba5f6127ed887f459@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=5d7ba5f6127ed887f459
Reported-by: syzbot+7b1d0ea11475e857d063@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=7b1d0ea11475e857d063
Reported-by: syzbot+d8a69701a6e796ad5d3e@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=d8a69701a6e796ad5d3e
For reference, a CBMC model check of squashfs_read_inode() as it is in
linux-next returns 40 for a long directory inode with i_size = 1. With
this patch applied it returns only 0 or -errno for every inode type,
and squashfs_lookup() then never hands d_splice_alias() an inode that
is neither NULL nor real. Harnesses and outputs:
https://github.com/williamchuang/linux-kernel-contributions/tree/main/squashfs-lookup-errcode
This analysis was done with the help of an AI assistant; I have
checked it and take responsibility for it.
Thanks,
William
next reply other threads:[~2026-11-17 0:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 0:54 William Chuang [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-11-14 14:51 [PATCH 1/2] squashfs: return -EINVAL on invalid directory inode size Aibing Chen
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=20261117005352.48227-1-founder@logarcheon.com \
--to=founder@logarcheon.com \
--cc=akpm@linux-foundation.org \
--cc=chenaibing@cmss.chinamobile.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=phillip@squashfs.org.uk \
--cc=syzbot+5d7ba5f6127ed887f459@syzkaller.appspotmail.com \
--cc=syzbot+7b1d0ea11475e857d063@syzkaller.appspotmail.com \
--cc=syzbot+d8a69701a6e796ad5d3e@syzkaller.appspotmail.com \
--cc=wangxiaolei01@kaihong.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 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.