syzbot


KASAN: out-of-bounds Read in sg_remove_request

Status: closed as invalid on 2019/01/01 20:10
First crash: 2605d, last: 2529d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-44 KASAN: out-of-bounds Read in sg_remove_request C 4 2449d 2052d 0/2 public: reported C repro on 2019/04/13 00:00

Sample crash report:
==================================================================
BUG: KASAN: out-of-bounds in __read_once_size include/linux/compiler.h:243 [inline]
BUG: KASAN: out-of-bounds in list_empty include/linux/list.h:189 [inline]
BUG: KASAN: out-of-bounds in sg_remove_request+0x103/0x120 drivers/scsi/sg.c:2120
Read of size 8 at addr ffff8801c90851c0 by task syzkaller736799/3359
------------[ cut here ]------------
WARNING: CPU: 1 PID: 3360 at kernel/locking/lockdep.c:3322 __lock_acquire+0x1768/0x3640 kernel/locking/lockdep.c:3322
DEBUG_LOCKS_WARN_ON(class_idx > MAX_LOCKDEP_KEYS)
Kernel panic - not syncing: panic_on_warn set ...

CPU: 1 PID: 3360 Comm: syzkaller736799 Not tainted 4.9.71-g319c8e1 #112
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
 ffff8801c9be75d8 ffffffff81d922b9 ffffffff83a46d00 ffff8801c9be76b0
 ffffffff83a5a500 ffffffff8123b788 0000000000000009 ffff8801c9be76a0
 ffffffff8142d741 0000000041b58ab3 ffffffff84188578 ffffffff8142d585
Call Trace:
 [<ffffffff81d922b9>] __dump_stack lib/dump_stack.c:15 [inline]
 [<ffffffff81d922b9>] dump_stack+0xc1/0x128 lib/dump_stack.c:51
 [<ffffffff8142d741>] panic+0x1bc/0x3a8 kernel/panic.c:179
 [<ffffffff8112f404>] __warn+0x1c4/0x1e0 kernel/panic.c:542
 [<ffffffff8112f4e4>] warn_slowpath_fmt+0xc4/0x110 kernel/panic.c:565
 [<ffffffff8123b788>] __lock_acquire+0x1768/0x3640 kernel/locking/lockdep.c:3322
 [<ffffffff8123e09e>] lock_acquire+0x12e/0x410 kernel/locking/lockdep.c:3756
 [<ffffffff838aeede>] __raw_write_lock_irqsave include/linux/rwlock_api_smp.h:186 [inline]
 [<ffffffff838aeede>] _raw_write_lock_irqsave+0x4e/0x62 kernel/locking/spinlock.c:303
 [<ffffffff82664ba0>] sg_remove_request+0x70/0x120 drivers/scsi/sg.c:2122
 [<ffffffff826651b5>] sg_finish_rem_req+0x295/0x340 drivers/scsi/sg.c:1838
 [<ffffffff82666fec>] sg_read+0xa1c/0x1440 drivers/scsi/sg.c:527
 [<ffffffff8156a4e1>] do_loop_readv_writev.part.17+0x141/0x1e0 fs/read_write.c:714
 [<ffffffff8156e350>] do_loop_readv_writev fs/read_write.c:880 [inline]
 [<ffffffff8156e350>] do_readv_writev+0x520/0x750 fs/read_write.c:874
 [<ffffffff8156e604>] vfs_readv+0x84/0xc0 fs/read_write.c:898
 [<ffffffff8156e726>] do_readv+0xe6/0x250 fs/read_write.c:924
 [<ffffffff81571c17>] SYSC_readv fs/read_write.c:1011 [inline]
 [<ffffffff81571c17>] SyS_readv+0x27/0x30 fs/read_write.c:1008
 [<ffffffff838aef85>] entry_SYSCALL_64_fastpath+0x23/0xc6

CPU: 0 PID: 3359 Comm: syzkaller736799 Not tainted 4.9.71-g319c8e1 #112
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
 ffff8801c9baf9b0 ffffffff81d922b9 ffffea0007242140 ffff8801c90851c0
 0000000000000000 ffff8801c90851c8 ffff8801c8d54438 ffff8801c9baf9e8
 ffffffff8153bab3 ffff8801c90851c0 0000000000000008 0000000000000000
Call Trace:
 [<ffffffff81d922b9>] __dump_stack lib/dump_stack.c:15 [inline]
 [<ffffffff81d922b9>] dump_stack+0xc1/0x128 lib/dump_stack.c:51
 [<ffffffff8153bab3>] print_address_description+0x73/0x280 mm/kasan/report.c:252
 [<ffffffff8153bfd5>] kasan_report_error mm/kasan/report.c:351 [inline]
 [<ffffffff8153bfd5>] kasan_report+0x275/0x360 mm/kasan/report.c:408
 [<ffffffff8153c134>] __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:429
 [<ffffffff82664c33>] __read_once_size include/linux/compiler.h:243 [inline]
 [<ffffffff82664c33>] list_empty include/linux/list.h:189 [inline]
 [<ffffffff82664c33>] sg_remove_request+0x103/0x120 drivers/scsi/sg.c:2120
 [<ffffffff826651b5>] sg_finish_rem_req+0x295/0x340 drivers/scsi/sg.c:1838
 [<ffffffff82666fec>] sg_read+0xa1c/0x1440 drivers/scsi/sg.c:527
 [<ffffffff8156a4e1>] do_loop_readv_writev.part.17+0x141/0x1e0 fs/read_write.c:714
 [<ffffffff8156e350>] do_loop_readv_writev fs/read_write.c:880 [inline]
 [<ffffffff8156e350>] do_readv_writev+0x520/0x750 fs/read_write.c:874
 [<ffffffff8156e604>] vfs_readv+0x84/0xc0 fs/read_write.c:898
 [<ffffffff8156e726>] do_readv+0xe6/0x250 fs/read_write.c:924
 [<ffffffff81571c17>] SYSC_readv fs/read_write.c:1011 [inline]
 [<ffffffff81571c17>] SyS_readv+0x27/0x30 fs/read_write.c:1008
 [<ffffffff838aef85>] entry_SYSCALL_64_fastpath+0x23/0xc6

Allocated by task 3368:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57
 save_stack+0x43/0xd0 mm/kasan/kasan.c:505
 set_track mm/kasan/kasan.c:517 [inline]
 kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:609
 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:547
 slab_post_alloc_hook mm/slab.h:417 [inline]
 slab_alloc_node mm/slub.c:2715 [inline]
 slab_alloc mm/slub.c:2723 [inline]
 kmem_cache_alloc+0xba/0x290 mm/slub.c:2728
 fasync_alloc fs/fcntl.c:604 [inline]
 fasync_add_entry fs/fcntl.c:662 [inline]
 fasync_helper+0x37/0xb0 fs/fcntl.c:691
 sg_fasync+0x86/0xb0 drivers/scsi/sg.c:1203
 ioctl_fioasync fs/ioctl.c:534 [inline]
 do_vfs_ioctl+0x2d8/0x1140 fs/ioctl.c:639
 SYSC_ioctl fs/ioctl.c:694 [inline]
 SyS_ioctl+0x8f/0xc0 fs/ioctl.c:685
 entry_SYSCALL_64_fastpath+0x23/0xc6

Freed by task 0:
(stack is not available)

The buggy address belongs to the object at ffff8801c9085180
 which belongs to the cache fasync_cache of size 96
The buggy address is located 64 bytes inside of
 96-byte region [ffff8801c9085180, ffff8801c90851e0)
The buggy address belongs to the page:
page:ffffea0007242140 count:1 mapcount:0 mapping:          (null) index:0x0
flags: 0x8000000000000080(slab)
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801c9085080: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc
 ffff8801c9085100: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc
>ffff8801c9085180: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc
                                              ^
 ffff8801c9085200: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc
 ffff8801c9085280: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc
==================================================================
Dumping ftrace buffer:
   (ftrace buffer empty)
Kernel Offset: disabled
Rebooting in 86400 seconds..

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2017/12/21 08:54 https://android.googlesource.com/kernel/common android-4.9 319c8e1bc7a1 90a46995 .config console log report syz C ci-android-49-kasan-gce
2017/10/17 19:01 https://android.googlesource.com/kernel/common android-4.9 5c73594e214f b69d27d1 .config console log report ci-android-49-kasan-gce
2017/10/16 06:02 https://android.googlesource.com/kernel/common android-4.9 5c73594e214f b69d27d1 .config console log report ci-android-49-kasan-gce
2017/10/06 22:51 https://android.googlesource.com/kernel/common android-4.9 379e3b2a6d51 c26ea367 .config console log report ci-android-49-kasan-gce
* Struck through repros no longer work on HEAD.