linux-stable/fs/erofs
Gao Xiang aa99a76b40 erofs: handle corrupted images whose decompressed size less than it'd be
As Lasse pointed out, "Looking at fs/erofs/decompress.c,
the return value from LZ4_decompress_safe_partial is only
checked for negative value to catch errors. ... So if
I understood it correctly, if there is bad data whose
uncompressed size is much less than it should be, it can
leave part of the output buffer untouched and expose the
previous data as the file content. "

Let's fix it now.

Cc: Lasse Collin <lasse.collin@tukaani.org>
Fixes: 7fc45dbc93 ("staging: erofs: introduce generic decompression backend")
[ Gao Xiang: v5.3+, I will manually backport this to stable later. ]
Link: https://lore.kernel.org/r/20200226081008.86348-3-gaoxiang25@huawei.com
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
2020-03-03 23:40:52 +08:00
..
compress.h
data.c
decompressor.c erofs: handle corrupted images whose decompressed size less than it'd be 2020-03-03 23:40:52 +08:00
dir.c
erofs_fs.h erofs: support superblock checksum 2019-11-24 11:02:41 +08:00
inode.c
internal.h erofs: convert workstn to XArray 2020-03-03 23:27:25 +08:00
Kconfig erofs: support superblock checksum 2019-11-24 11:02:41 +08:00
Makefile
namei.c
super.c erofs: convert workstn to XArray 2020-03-03 23:27:25 +08:00
tagptr.h
utils.c erofs: correct the remaining shrink objects 2020-03-03 23:39:29 +08:00
xattr.c erofs: zero out when listxattr is called with no xattr 2019-12-04 21:15:04 +08:00
xattr.h erofs: correct indentation of an assigned structure inside a function 2020-01-07 10:08:27 +08:00
zdata.c erofs: convert workstn to XArray 2020-03-03 23:27:25 +08:00
zdata.h erofs: clean up decompress queue stuffs 2019-11-24 11:02:41 +08:00
zmap.c erofs: drop all vle annotations for runtime names 2019-11-24 11:02:41 +08:00
zpvec.h