]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
erofs: don't trigger WARN() when decompression fails
authorGao Xiang <hsiangkao@linux.alibaba.com>
Mon, 25 Oct 2021 07:43:11 +0000 (15:43 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Sun, 31 Oct 2021 13:00:28 +0000 (21:00 +0800)
syzbot reported a WARNING [1] due to corrupted compressed data.

As Dmitry said, "If this is not a kernel bug, then the code should
not use WARN. WARN if for kernel bugs and is recognized as such by
all testing systems and humans."

[1] https://lore.kernel.org/r/000000000000b3586105cf0ff45e@google.com

Link: https://lore.kernel.org/r/20211025074311.130395-1-hsiangkao@linux.alibaba.com
Cc: Dmitry Vyukov <dvyukov@google.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Reported-by: syzbot+d8aaffc3719597e8cfb4@syzkaller.appspotmail.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
fs/erofs/decompressor.c

index a0786b95cdf99c7a350fecaf4b2d72b869c750c2..bf37fc76b1824d68c530bd62b4f2526d226600f1 100644 (file)
@@ -227,7 +227,6 @@ static int z_erofs_lz4_decompress_mem(struct z_erofs_decompress_req *rq,
                erofs_err(rq->sb, "failed to decompress %d in[%u, %u] out[%u]",
                          ret, rq->inputsize, inputmargin, rq->outputsize);
 
-               WARN_ON(1);
                print_hex_dump(KERN_DEBUG, "[ in]: ", DUMP_PREFIX_OFFSET,
                               16, 1, src + inputmargin, rq->inputsize, true);
                print_hex_dump(KERN_DEBUG, "[out]: ", DUMP_PREFIX_OFFSET,