syzbot


KASAN: use-after-free Read in blk_trace_startstop

Status: auto-closed as invalid on 2020/04/26 10:55
Reported-by: syzbot+46d87814e6e96a5bc3cd@syzkaller.appspotmail.com
First crash: 922d, last: 922d
similar bugs (1):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-49 KASAN: use-after-free Read in blk_trace_startstop 1 1434d 1434d 0/3 auto-closed as invalid on 2019/02/22 12:59

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in __list_add_valid+0x88/0xa0 lib/list_debug.c:23
Read of size 8 at addr ffff88806c1c1ba0 by task syz-executor.0/7156

CPU: 0 PID: 7156 Comm: syz-executor.0 Not tainted 4.14.160-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x142/0x197 lib/dump_stack.c:58
 print_address_description.cold+0x7c/0x1dc mm/kasan/report.c:252
 kasan_report_error mm/kasan/report.c:351 [inline]
 kasan_report mm/kasan/report.c:409 [inline]
 kasan_report.cold+0xa9/0x2af mm/kasan/report.c:393
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430
 __list_add_valid+0x88/0xa0 lib/list_debug.c:23
 __list_add include/linux/list.h:60 [inline]
 list_add include/linux/list.h:79 [inline]
 blk_trace_startstop+0x2ac/0x5c0 kernel/trace/blktrace.c:645
 sg_ioctl+0x1c4c/0x27e0 drivers/scsi/sg.c:1132
 vfs_ioctl fs/ioctl.c:46 [inline]
 file_ioctl fs/ioctl.c:500 [inline]
 do_vfs_ioctl+0x7ae/0x1060 fs/ioctl.c:684
 SYSC_ioctl fs/ioctl.c:701 [inline]
 SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x45a919
RSP: 002b:00007fe53060cc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 000000000045a919
RDX: 0000000000000000 RSI: 0000000000001274 RDI: 000000000000000d
RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fe53060d6d4
R13: 00000000004c22ed R14: 00000000004d74c0 R15: 00000000ffffffff

Allocated by task 6970:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 save_stack+0x45/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc mm/kasan/kasan.c:551 [inline]
 kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:529
 kmem_cache_alloc_trace+0x152/0x790 mm/slab.c:3618
 kmalloc include/linux/slab.h:488 [inline]
 kzalloc include/linux/slab.h:661 [inline]
 do_blk_trace_setup+0x120/0xb10 kernel/trace/blktrace.c:495
 blk_trace_setup+0xbd/0x140 kernel/trace/blktrace.c:579
 sg_ioctl+0x315/0x27e0 drivers/scsi/sg.c:1127
 vfs_ioctl fs/ioctl.c:46 [inline]
 file_ioctl fs/ioctl.c:500 [inline]
 do_vfs_ioctl+0x7ae/0x1060 fs/ioctl.c:684
 SYSC_ioctl fs/ioctl.c:701 [inline]
 SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 7074:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 save_stack+0x45/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0x75/0xc0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kfree+0xcc/0x270 mm/slab.c:3815
 blk_trace_free+0x106/0x140 kernel/trace/blktrace.c:330
 blk_trace_cleanup kernel/trace/blktrace.c:351 [inline]
 blk_trace_remove+0x59/0x80 kernel/trace/blktrace.c:364
 sg_ioctl+0x241/0x27e0 drivers/scsi/sg.c:1136
 vfs_ioctl fs/ioctl.c:46 [inline]
 file_ioctl fs/ioctl.c:500 [inline]
 do_vfs_ioctl+0x7ae/0x1060 fs/ioctl.c:684
 SYSC_ioctl fs/ioctl.c:701 [inline]
 SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

The buggy address belongs to the object at ffff88806c1c1b40
 which belongs to the cache kmalloc-128 of size 128
The buggy address is located 96 bytes inside of
 128-byte region [ffff88806c1c1b40, ffff88806c1c1bc0)
The buggy address belongs to the page:
page:ffffea0001b07040 count:1 mapcount:0 mapping:ffff88806c1c1000 index:0xffff88806c1c1e40
flags: 0xfffe0000000100(slab)
raw: 00fffe0000000100 ffff88806c1c1000 ffff88806c1c1e40 0000000100000006
raw: ffffea000277b720 ffffea0001deb0e0 ffff8880aa800640 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88806c1c1a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88806c1c1b00: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
>ffff88806c1c1b80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
                               ^
 ffff88806c1c1c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88806c1c1c80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
==================================================================

Crashes (1):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-linux-4-14 2019/12/28 10:54 linux-4.14.y e1f7d50ae3a3 af6b8ef8 .config log report