Re: [PATCH] squashfs: Verify inode mode when loading from disk

From: Phillip Lougher
Date: Thu Aug 14 2025 - 16:57:18 EST


On 13/08/2025 08:17, Tetsuo Handa wrote:
The inode mode loaded from corrupted disk might by error contain the file
type bits. Since the file type bits are set by squashfs_read_inode() using
bitwise OR, the file type bits must not be set by squashfs_new_inode() from
squashfs_read_inode(); otherwise, an invalid file type bits later confuses
may_open().

Reported-by: syzbot <syzbot+895c23f6917da440ed0d@xxxxxxxxxxxxxxxxxxxxxxxxx>
Closes: https://syzkaller.appspot.com/bug?extid=895c23f6917da440ed0d
Signed-off-by: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>

Reviewed-by: Phillip Lougher <phillip@xxxxxxxxxxxxxxx>