mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 00:20:32 +00:00
isofs: Fix out of bound access for corrupted isofs image
commit e96a1866b4
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>
This commit is contained in:
parent
a9342139ac
commit
b0ddff8d68
1 changed files with 2 additions and 0 deletions
|
@ -1326,6 +1326,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;
|
||||
|
|
Loading…
Reference in a new issue