Skip to content
Commit 0a17567b authored by Jingbo Xu's avatar Jingbo Xu Committed by Gao Xiang
Browse files

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: default avatar <syzbot+902d5a9373ae8f748a94@syzkaller.appspotmail.com>
Link: https://syzkaller.appspot.com/bug?extid=902d5a9373ae8f748a94


Reported-and-tested-by: default avatar <syzbot+bbb353775d51424087f2@syzkaller.appspotmail.com>
Fixes: 9e382914 ("erofs: add helpers to load long xattr name prefixes")
Fixes: 6a318ccd ("erofs: enable long extended attribute name prefixes")
Signed-off-by: default avatarJingbo Xu <jefflexu@linux.alibaba.com>
Reviewed-by: default avatarYue Hu <huyue2@coolpad.com>
Reviewed-by: default avatarChao Yu <chao@kernel.org>
Link: https://lore.kernel.org/r/20230515103941.129784-1-jefflexu@linux.alibaba.com


Signed-off-by: default avatarGao Xiang <hsiangkao@linux.alibaba.com>
parent f1fcbaa1
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment