Re: [syzbot] [PATCH] test warning in squashfs_read_data

From: syzbot
Date: Wed Nov 15 2023 - 20:14:59 EST


For archival purposes, forwarding an incoming command email to
linux-kernel@xxxxxxxxxxxxxxx.

***

Subject: [PATCH] test warning in squashfs_read_data
Author: lizhi.xu@xxxxxxxxxxxxx

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git ac347a0655db

diff --git a/fs/squashfs/block.c b/fs/squashfs/block.c
index 581ce9519339..cf21494e3994 100644
--- a/fs/squashfs/block.c
+++ b/fs/squashfs/block.c
@@ -330,6 +330,12 @@ int squashfs_read_data(struct super_block *sb, u64 index, int length,
if (next_index)
*next_index = index + length;

+ printk("l:%d, i: %d, ol: %d, mbu: %d, %s\n", length, index, output->length,
+ msblk->bytes_used, __func__);
+ if (!length) {
+ res = -EIO;
+ goto out;
+ }
res = squashfs_bio_read(sb, index, length, &bio, &offset);
if (res)
goto out;