squashfs: squashfs_read_data need to check if the length is 0
authorLizhi Xu <lizhi.xu@windriver.com>
Thu, 16 Nov 2023 03:13:52 +0000 (11:13 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 7 Dec 2023 00:12:45 +0000 (16:12 -0800)
commiteb66b8abae98f869c224f7c852b685ae02144564
tree3c79c688b505832d86db2ec4a078aa209b2a9ace
parent3f3cac5c0a5c3b09bdfb919a7518dca83523a52c
squashfs: squashfs_read_data need to check if the length is 0

When the length passed in is 0, the pagemap_scan_test_walk() caller should
bail.  This error causes at least a WARN_ON().

Link: https://lkml.kernel.org/r/20231116031352.40853-1-lizhi.xu@windriver.com
Reported-by: syzbot+32d3767580a1ea339a81@syzkaller.appspotmail.com
Closes: https://lkml.kernel.org/r/0000000000000526f2060a30a085@google.com
Signed-off-by: Lizhi Xu <lizhi.xu@windriver.com>
Reviewed-by: Phillip Lougher <phillip@squashfs.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/squashfs/block.c