lkml.org 
[lkml]   [2021]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [syzbot] KASAN: use-after-free Read in __isofs_iget
On Fri 15-10-21 17:35:19, syzbot wrote:
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: d3134eb5de85 Add linux-next specific files for 20211011
> git tree: linux-next
> console output: https://syzkaller.appspot.com/x/log.txt?x=13f5fd98b00000
> kernel config: https://syzkaller.appspot.com/x/.config?x=b9662326d2be383b
> dashboard link: https://syzkaller.appspot.com/bug?extid=6fc7fb214625d82af7d1
> compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=15ca2e47300000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17869bd4b00000
>
> Bisection is inconclusive: the issue happens on the oldest tested release.
>
> bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=10808570b00000
> final oops: https://syzkaller.appspot.com/x/report.txt?x=12808570b00000
> console output: https://syzkaller.appspot.com/x/log.txt?x=14808570b00000
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+6fc7fb214625d82af7d1@syzkaller.appspotmail.com

Let's try this:

#sys test 519d81956ee277b4419c723adfb154603c2565ba

Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
From 5d06a4f26133fa8d45254febce7a46085e998ee7 Mon Sep 17 00:00:00 2001
From: Jan Kara <jack@suse.cz>
Date: Mon, 18 Oct 2021 12:37:41 +0200
Subject: [PATCH] isofs: Fix out of bound access for corrupted isofs image

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.

Signed-off-by: Jan Kara <jack@suse.cz>
---
fs/isofs/inode.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
index 678e2c51b855..0c6eacfcbeef 100644
--- a/fs/isofs/inode.c
+++ b/fs/isofs/inode.c
@@ -1322,6 +1322,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;
--
2.26.2
\
 
 \ /
  Last update: 2021-10-18 12:42    [W:0.044 / U:0.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site