staging: erofs: detect potential multiref due to corrupted images
authorGao Xiang <gaoxiang25@huawei.com>
Wed, 9 Oct 2019 10:12:39 +0000 (18:12 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Oct 2019 16:21:41 +0000 (18:21 +0200)
commit3dab5ba6d7ae8ab5dfcaa61127d92cf07ceca016
tree1c99b873b8cb2fa85d0b1fb09e33f94a5c65b8e6
parent8b4341f9b80bb8a7aefedce50b0305696083a830
staging: erofs: detect potential multiref due to corrupted images

commit e12a0ce2fa69798194f3a8628baf6edfbd5c548f upstream.

As reported by erofs-utils fuzzer, currently, multiref
(ondisk deduplication) hasn't been supported for now,
we should forbid it properly.

Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
Cc: <stable@vger.kernel.org> # 4.19+
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Link: https://lore.kernel.org/r/20190821140152.229648-1-gaoxiang25@huawei.com
[ Gao Xiang: Since earlier kernels don't define EFSCORRUPTED,
             let's use EIO instead. ]
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/erofs/unzip_vle.c