]> git.baikalelectronics.ru Git - kernel.git/commit
erofs: fix general protection fault when reading fragment
authorYue Hu <huyue2@coolpad.com>
Fri, 21 Oct 2022 08:53:25 +0000 (16:53 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Tue, 8 Nov 2022 06:44:13 +0000 (14:44 +0800)
commit940c17d3a07f06cbf5b031e4c424d0edd6e91ad8
treee0b57c7ab5e71c75bc2b47984829c948a6baded2
parentdfd2bf0335fb2bf3195544c775fab6f0b6e2f418
erofs: fix general protection fault when reading fragment

As syzbot reported [1], the fragment feature sb flag is not set, so
packed_inode != NULL needs to be checked in z_erofs_read_fragment().

[1] https://lore.kernel.org/all/0000000000002e7a8905eb841ddd@google.com/

Reported-by: syzbot+3faecbfd845a895c04cb@syzkaller.appspotmail.com
Fixes: 473c62a4c28c ("erofs: support on-disk compressed fragments data")
Signed-off-by: Yue Hu <huyue2@coolpad.com>
Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Link: https://lore.kernel.org/r/20221021085325.25788-1-zbestahu@gmail.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
fs/erofs/zdata.c