linux/fs/erofs
Jingbo Xu 0a17567b4a erofs: fix null-ptr-deref caused by erofs_xattr_prefixes_init
Fragments and dedupe share one feature bit, and thus packed inode may not
exist when fragment feature bit (dedupe feature bit exactly) is set, e.g.
when deduplication feature is in use while fragments feature is not.  In
this case, sbi->packed_inode could be NULL while fragments feature bit
is set.

Fix this by accessing packed inode only when it exists.

Reported-by: syzbot+902d5a9373ae8f748a94@syzkaller.appspotmail.com
Link: https://syzkaller.appspot.com/bug?extid=902d5a9373ae8f748a94
Reported-and-tested-by: syzbot+bbb353775d51424087f2@syzkaller.appspotmail.com
Fixes: 9e38291461 ("erofs: add helpers to load long xattr name prefixes")
Fixes: 6a318ccd7e ("erofs: enable long extended attribute name prefixes")
Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
Reviewed-by: Yue Hu <huyue2@coolpad.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Link: https://lore.kernel.org/r/20230515103941.129784-1-jefflexu@linux.alibaba.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
2023-05-23 16:56:21 +08:00
..
compress.h erofs: introduce multi-reference pclusters (fully-referenced) 2022-07-22 21:44:27 +08:00
data.c erofs: keep meta inode into erofs_buf 2023-04-17 01:15:50 +08:00
decompressor_lzma.c erofs: avoid hardcoded blocksize for subpage block support 2023-04-17 01:15:44 +08:00
decompressor.c erofs: avoid hardcoded blocksize for subpage block support 2023-04-17 01:15:44 +08:00
dir.c erofs: keep meta inode into erofs_buf 2023-04-17 01:15:50 +08:00
erofs_fs.h erofs: cleanup i_format-related stuffs 2023-04-17 01:15:55 +08:00
fscache.c erofs: avoid hardcoded blocksize for subpage block support 2023-04-17 01:15:44 +08:00
inode.c erofs: sunset erofs_dbg() 2023-04-17 01:15:54 +08:00
internal.h erofs: cleanup i_format-related stuffs 2023-04-17 01:15:55 +08:00
Kconfig erofs: add per-cpu threads for decompression as an option 2023-02-15 08:11:26 +08:00
Makefile erofs: register fscache volume 2022-05-18 00:11:19 +08:00
namei.c erofs: sunset erofs_dbg() 2023-04-17 01:15:54 +08: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: enable long extended attribute name prefixes 2023-04-17 01:15:53 +08:00
sysfs.c erofs: make kobj_type structures constant 2023-02-15 08:11:26 +08:00
utils.c mm: shrinkers: provide shrinkers with names 2022-07-03 18:08:40 -07:00
xattr.c erofs: fix null-ptr-deref caused by erofs_xattr_prefixes_init 2023-05-23 16:56:21 +08:00
xattr.h Changes since last update: 2023-04-24 14:25:39 -07:00
zdata.c erofs: sunset erofs_dbg() 2023-04-17 01:15:54 +08:00
zmap.c erofs: sunset erofs_dbg() 2023-04-17 01:15:54 +08:00