Skip to content

Commit 86d4aed

Browse files
jankaragregkh
authored andcommitted
isofs: Fix out of bound access for corrupted isofs image
commit e96a186 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>
1 parent c430094 commit 86d4aed

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎fs/isofs/inode.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,6 +1321,8 @@ static int isofs_read_inode(struct inode *inode, int relocated)
13211321

13221322
de = (struct iso_directory_record *) (bh->b_data + offset);
13231323
de_len = *(unsigned char *) de;
1324+
if (de_len < sizeof(struct iso_directory_record))
1325+
goto fail;
13241326

13251327
if (offset + de_len > bufsize) {
13261328
int frag1 = bufsize - offset;

0 commit comments

Comments
 (0)