linux-stable/fs/erofs
Gao Xiang a2cfe94aa1 erofs: ensure m_llen is reset to 0 if metadata is invalid
[ Upstream commit 9b32b063be ]

Sometimes, the on-disk metadata might be invalid due to user
interrupts, storage failures, or other unknown causes.

In that case, z_erofs_map_blocks_iter() may still return a valid
m_llen while other fields remain invalid (e.g., m_plen can be 0).

Due to the return value of z_erofs_scan_folio() in some path will
be ignored on purpose, the following z_erofs_scan_folio() could
then use the invalid value by accident.

Let's reset m_llen to 0 to prevent this.

Link: https://lore.kernel.org/r/20240629185743.2819229-1-hsiangkao@linux.alibaba.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-07-25 09:50:54 +02:00
..
compress.h erofs: simplify compression configuration parser 2024-01-25 15:35:57 -08:00
data.c erofs: fix NULL dereference of dif->bdev_handle in fscache mode 2024-07-05 09:34:05 +02:00
decompressor.c erofs: fix lz4 inplace decompression 2024-01-31 16:18:49 -08:00
decompressor_deflate.c erofs: avoid allocating DEFLATE streams before mounting 2024-06-16 13:47:31 +02:00
decompressor_lzma.c erofs: simplify compression configuration parser 2024-01-25 15:35:57 -08:00
dir.c erofs: keep meta inode into erofs_buf 2023-04-17 01:15:50 +08:00
erofs_fs.h erofs: update on-disk format for xattr name filter 2023-08-11 12:11:44 +08:00
fscache.c erofs: fix lockdep false positives on initializing erofs_pseudo_mnt 2024-03-26 18:19:40 -04:00
inode.c v6.6-vfs.ctime 2023-08-28 09:31:32 -07:00
internal.h erofs: get rid of erofs_fs_context 2024-05-25 16:22:53 +02:00
Kconfig erofs: boost negative xattr lookup with bloom filter 2023-08-11 12:11:44 +08:00
Makefile erofs: DEFLATE compression support 2023-08-11 12:11:17 +08:00
namei.c erofs: fix refcount on the metabuf used for inode lookup 2024-03-01 13:35:01 +01:00
pcpubuf.c erofs: mark z_erofs_lzma_init/erofs_pcpubuf_init w/ __init 2023-03-09 22:49:30 +08:00
super.c erofs: reliably distinguish block based and fscache mode 2024-05-25 16:22:53 +02:00
sysfs.c erofs: make kobj_type structures constant 2023-02-15 08:11:26 +08:00
utils.c erofs: fix erofs_insert_workgroup() lockref usage 2023-11-20 11:59:23 +01:00
xattr.c erofs: boost negative xattr lookup with bloom filter 2023-08-11 12:11:44 +08:00
xattr.h Changes since last update: 2023-04-24 14:25:39 -07:00
zdata.c erofs: fix ztailpacking for subpage compressed blocks 2024-02-05 20:14:16 +00:00
zmap.c erofs: ensure m_llen is reset to 0 if metadata is invalid 2024-07-25 09:50:54 +02:00