KASAN: out-of-bounds Read in sg_remove_request

6 views
Skip to first unread message

syzbot

unread,
Apr 12, 2019, 8:00:53 PM4/12/19
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: d63fdf61 Merge 4.4.120 into android-4.4
git tree: android-4.4
console output: https://syzkaller.appspot.com/x/log.txt?x=1410a5a3800000
kernel config: https://syzkaller.appspot.com/x/.config?x=b36b3c05dfb8e06d
dashboard link: https://syzkaller.appspot.com/bug?extid=2ea609b69f7a415e2035
compiler: gcc (GCC) 7.1.1 20170620
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=14e4ab8b800000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=150784e3800000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+2ea609...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: out-of-bounds in list_empty include/linux/list.h:189 [inline]
BUG: KASAN: out-of-bounds in sg_remove_request+0xf9/0x110
drivers/scsi/sg.c:2120
Read of size 8 at addr ffff8801c8524640 by task syzkaller285508/3807

CPU: 0 PID: 3807 Comm: syzkaller285508 Not tainted 4.4.120-gd63fdf6 #28
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
0000000000000000 caf93c131ec682a6 ffff8801c6947ab0 ffffffff81d0408d
ffffea0007214900 ffff8801c8524640[ 32.735349] kasan: CONFIG_KASAN_INLINE
enabledkasan: GPF could be caused by NULL-ptr deref or user memory
accessgeneral protection fault: 0000 [#1] PREEMPT SMP KASAN
Dumping ftrace buffer:
(ftrace buffer empty)
Modules linked in:
CPU: 1 PID: 3809 Comm: syzkaller285508 Not tainted 4.4.120-gd63fdf6 #28
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
task: ffff8801c719b000 task.stack: ffff8800aa488000
RIP: 0010:[<ffffffff81237a2f>] [<ffffffff81237a2f>]
__lock_acquire+0x61f/0x4b50 kernel/locking/lockdep.c:3100
RSP: 0018:ffff8800aa48f8f0 EFLAGS: 00010086
RAX: dffffc0000000000 RBX: dead4ead00000000 RCX: ffffffff8123ac8e
RDX: 1ffff100390a5fe0 RSI: 0000000000000008 RDI: ffff8801c852ff00
RBP: ffff8800aa48fa90 R08: 0000000000000001 R09: 0000000000000001
R10: 0000000000000001 R11: 1ffff10015491f30 R12: 0000000000000000
R13: ffff8801c719b000 R14: ffff8801c852fef8 R15: 0000000000000000
FS: 00007fd1299a0700(0000) GS:ffff8801db300000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fd12999fe78 CR3: 00000000b11d4000 CR4: 0000000000160670
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Stack:
ffff8801da0018c0 ffff8800aa48fb28 ffffffff814fd213 0000004000000009
ffff8800aa48f920 ffffffff00000000 ffff8801c719b000 ffff8801c719b8d0
0000000000000285 ffff8801c719b000 0000000000000002 0000000000000002
Call Trace:
[<ffffffff8123d7ce>] lock_acquire+0x15e/0x460 kernel/locking/lockdep.c:3592
[<ffffffff8377361e>] __raw_write_lock_irqsave
include/linux/rwlock_api_smp.h:186 [inline]
[<ffffffff8377361e>] _raw_write_lock_irqsave+0x4e/0x70
kernel/locking/spinlock.c:303
[<ffffffff825b83a9>] sg_remove_request+0x69/0x110 drivers/scsi/sg.c:2122
[<ffffffff825b89b5>] sg_finish_rem_req+0x295/0x340 drivers/scsi/sg.c:1837
[<ffffffff825ba85b>] sg_read+0xa1b/0x1490 drivers/scsi/sg.c:537
[<ffffffff8151cf33>] __vfs_read+0x103/0x440 fs/read_write.c:432
[<ffffffff8151edd3>] vfs_read+0x123/0x3a0 fs/read_write.c:454
[<ffffffff81521719>] SYSC_read fs/read_write.c:569 [inline]
[<ffffffff81521719>] SyS_read+0xd9/0x1b0 fs/read_write.c:562
[<ffffffff8377395f>] entry_SYSCALL_64_fastpath+0x1c/0x98
Code: 00 fc ff df 44 89 e3 49 8d 7c de 08 48 89 fa 48 c1 ea 03 80 3c 02 00
0f 85 b6 37 00 00 49 8b 5c de 08 48 85 db 0f 84 28 fb ff ff <f0> ff 83 98
01 00 00 49 8d 85 c8 08 00 00 48 89 c2 48 89 44 24
RIP [<ffffffff81237a2f>] __lock_acquire+0x61f/0x4b50
kernel/locking/lockdep.c:3100
RSP <ffff8800aa48f8f0>
---[ end trace a63e6f9c92475dcb ]---


---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches
Reply all
Reply to author
Forward
0 new messages