linux-stable/fs/erofs
Gao Xiang af1038abbd erofs: use LZ4_decompress_safe() for full decoding
As Lasse pointed out, "EROFS uses LZ4_decompress_safe_partial
for both partial and full blocks. Thus when it is decoding a
full block, it doesn't know if the LZ4 decoder actually decoded
all the input. The real uncompressed size could be bigger than
the value stored in the file system metadata.

Using LZ4_decompress_safe instead of _safe_partial when
decompressing a full block would help to detect errors."

So it's reasonable to use _safe in case of potential corrupted
images and it might have some speed gain as well although
I didn't observe much difference.

Note that legacy compressor (< 5.3, no LZ4_0PADDING) could
encode extra data in a pcluster, which is excluded as well.

Cc: Lasse Collin <lasse.collin@tukaani.org>
Fixes: 0ffd71bcc3 ("staging: erofs: introduce LZ4 decompression inplace")
[ Gao Xiang: v5.3+, I will manually backport this to stable later. ]
Link: https://lore.kernel.org/r/20200226081008.86348-2-gaoxiang25@huawei.com
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
2020-03-03 23:40:16 +08:00
..
compress.h
data.c erofs: fix erofs_get_meta_page locking due to a cleanup 2019-10-01 04:54:33 +08:00
decompressor.c erofs: use LZ4_decompress_safe() for full decoding 2020-03-03 23:40:16 +08:00
dir.c erofs: rename errln/infoln/debugln to erofs_{err, info, dbg} 2019-09-05 20:10:09 +02:00
erofs_fs.h erofs: support superblock checksum 2019-11-24 11:02:41 +08:00
inode.c erofs: always use iget5_locked 2019-09-05 20:10:09 +02:00
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 erofs: rename errln/infoln/debugln to erofs_{err, info, dbg} 2019-09-05 20:10:09 +02:00
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