syzbot


KASAN: out-of-bounds Read in sg_remove_request

Status: public: reported C repro on 2019/04/13 00:00
Reported-by: syzbot+2ea609b69f7a415e2035@syzkaller.appspotmail.com
First crash: 2489d, last: 2446d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-49 KASAN: out-of-bounds Read in sg_remove_request C 4 2527d 2591d 0/3 closed as invalid on 2019/01/01 20:10

Sample crash report:
==================================================================
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 ]---

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/03/11 18:29 https://android.googlesource.com/kernel/common android-4.4 d63fdf61a4dc 36d1c454 .config console log report syz C ci-android-44-kasan-gce
2018/01/30 03:43 https://android.googlesource.com/kernel/common android-4.4 962d1f3fe2f4 08d47756 .config console log report syz C ci-android-44-kasan-gce
2018/01/27 23:32 https://android.googlesource.com/kernel/common android-4.4 202e079275c6 08146b1a .config console log report syz C ci-android-44-kasan-gce
2018/02/01 23:03 https://android.googlesource.com/kernel/common android-4.4 a81d32264721 67bd3383 .config console log report syz C ci-android-44-kasan-gce-386
* Struck through repros no longer work on HEAD.