提交 b79856ad 编写于 作者: J Jan Kara 提交者: Zheng Zengkai

isofs: Fix out of bound access for corrupted isofs image

stable inclusion
from stable-5.10.79
commit 86d4aedcbc69c0f84551fb70f953c24e396de2d7
bugzilla: 185793 https://gitee.com/openeuler/kernel/issues/I4K65C

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=86d4aedcbc69c0f84551fb70f953c24e396de2d7

--------------------------------

commit e96a1866 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: NJan Kara <jack@suse.cz>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NBin Li <huawei.libin@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 683bd5dd
...@@ -1321,6 +1321,8 @@ static int isofs_read_inode(struct inode *inode, int relocated) ...@@ -1321,6 +1321,8 @@ static int isofs_read_inode(struct inode *inode, int relocated)
de = (struct iso_directory_record *) (bh->b_data + offset); de = (struct iso_directory_record *) (bh->b_data + offset);
de_len = *(unsigned char *) de; de_len = *(unsigned char *) de;
if (de_len < sizeof(struct iso_directory_record))
goto fail;
if (offset + de_len > bufsize) { if (offset + de_len > bufsize) {
int frag1 = bufsize - offset; int frag1 = bufsize - offset;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册