erofs: fix kvcalloc() misuse with __GFP_NOFAIL
authorGao Xiang <hsiangkao@linux.alibaba.com>
Tue, 10 Jan 2023 07:49:27 +0000 (15:49 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Tue, 10 Jan 2023 08:41:45 +0000 (16:41 +0800)
commit12724ba38992bd045e92a9a88a868a530f89d13e
tree43348d3f2572d295989d9337bac5c6a998f9319d
parent6acd87d50998ef0afafc441613aeaf5a8f5c9eff
erofs: fix kvcalloc() misuse with __GFP_NOFAIL

As reported by syzbot [1], kvcalloc() cannot work with  __GFP_NOFAIL.
Let's use kcalloc() instead.

[1] https://lore.kernel.org/r/0000000000007796bd05f1852ec2@google.com

Reported-by: syzbot+c3729cda01706a04fb98@syzkaller.appspotmail.com
Fixes: fe3e5914e6dc ("erofs: try to leave (de)compressed_pages on stack if possible")
Fixes: 4f05687fd703 ("erofs: introduce struct z_erofs_decompress_backend")
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20230110074927.41651-1-hsiangkao@linux.alibaba.com
fs/erofs/zdata.c