From: Jan Kara jack@suse.cz
stable inclusion from stable-v4.19.217 commit b0ddff8d68f2e43857a84dce54c3deab181c8ae1 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9RD2M CVE: CVE-2021-47478
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=...
--------------------------------
commit e96a1866b40570b5950cda8602c2819189c62a48 upstream.
When isofs image is suitably corrupted isofs_read_inode() can read data beyond the end of buffer. Sanity-check the directory entry length before using it.
Reported-and-tested-by: syzbot+6fc7fb214625d82af7d1@syzkaller.appspotmail.com CC: stable@vger.kernel.org Signed-off-by: Jan Kara jack@suse.cz Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org Signed-off-by: Guo Mengqi guomengqi3@huawei.com --- fs/isofs/inode.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c index 488a9e7f8f66..f77a7f19b0db 100644 --- a/fs/isofs/inode.c +++ b/fs/isofs/inode.c @@ -1327,6 +1327,8 @@ static int isofs_read_inode(struct inode *inode, int relocated)
de = (struct iso_directory_record *) (bh->b_data + offset); de_len = *(unsigned char *) de; + if (de_len < sizeof(struct iso_directory_record)) + goto fail;
if (offset + de_len > bufsize) { int frag1 = bufsize - offset;
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/8521 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/2...
FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/8521 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/2...