Skip to contentSkip to conversation

erofs: don't trigger WARN() when decompression fails

PATCH In review Gao Xiang 2 participants 2 messages Oct 25, 2021 – Oct 29, 2021 EROFS file system

lore
Share & tools
lore

Gao Xiang

author
#0 lore raw

PATCH 1/1 erofs: don't trigger WARN() when decompression fails

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/[email protected]

Reported-by [email protected]
Cc Dmitry Vyukov <[email protected]>
Cc Chao Yu <[email protected]>
---
 fs/erofs/decompressor.c | 1 -
 1 file changed, 1 deletion(-)
fs/erofs/decompressor.c +0 -1
index a0786b95cdf9..bf37fc76b182 100644
@@ -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,
Signature · 1 line
2.24.4
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Gao Xiang

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/[email protected]

Reported-by [email protected]
Cc Dmitry Vyukov <[email protected]>
Cc Chao Yu <[email protected]>

Thanks,