================================================================== BUG: KASAN: use-after-free in do_blk_trace_setup+0xab4/0xcf0 kernel/trace/blktrace.c:546 Read of size 8 at addr ffff8801c1f04b80 by task syz-executor1/3683 CPU: 1 PID: 3683 Comm: syz-executor1 Not tainted 4.14.0-rc8+ #168 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+0x194/0x257 lib/dump_stack.c:53 print_address_description+0x73/0x250 mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report+0x25b/0x340 mm/kasan/report.c:409 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430 do_blk_trace_setup+0xab4/0xcf0 kernel/trace/blktrace.c:546 blk_trace_setup+0xbd/0x180 kernel/trace/blktrace.c:564 sg_ioctl+0xc71/0x2d90 drivers/scsi/sg.c:1089 vfs_ioctl fs/ioctl.c:46 [inline] do_vfs_ioctl+0x1b1/0x1520 fs/ioctl.c:686 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692 entry_SYSCALL_64_fastpath+0x1f/0xbe RIP: 0033:0x452869 RSP: 002b:00007f350e3e6be8 EFLAGS: 00000212 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000758020 RCX: 0000000000452869 RDX: 000000002084cf90 RSI: 00000000c0481273 RDI: 0000000000000017 RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000212 R12: 0000000000000000 R13: 0000000000a6f7ff R14: 00007f350e3e79c0 R15: 0000000000000000 Allocated by task 3683: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:551 kmem_cache_alloc_trace+0x136/0x750 mm/slab.c:3628 kmalloc include/linux/slab.h:494 [inline] kzalloc include/linux/slab.h:667 [inline] do_blk_trace_setup+0x182/0xcf0 kernel/trace/blktrace.c:479 blk_trace_setup+0xbd/0x180 kernel/trace/blktrace.c:564 sg_ioctl+0xc71/0x2d90 drivers/scsi/sg.c:1089 vfs_ioctl fs/ioctl.c:46 [inline] do_vfs_ioctl+0x1b1/0x1520 fs/ioctl.c:686 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692 entry_SYSCALL_64_fastpath+0x1f/0xbe Freed by task 3704: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3504 [inline] kfree+0xca/0x250 mm/slab.c:3821 blk_trace_free+0xf9/0x130 kernel/trace/blktrace.c:329 blk_trace_cleanup+0x15/0x30 kernel/trace/blktrace.c:334 blk_trace_remove+0x55/0x80 kernel/trace/blktrace.c:348 sg_ioctl+0x5eb/0x2d90 drivers/scsi/sg.c:1098 vfs_ioctl fs/ioctl.c:46 [inline] do_vfs_ioctl+0x1b1/0x1520 fs/ioctl.c:686 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692 entry_SYSCALL_64_fastpath+0x1f/0xbe The buggy address belongs to the object at ffff8801c1f04b40 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 64 bytes inside of 128-byte region [ffff8801c1f04b40, ffff8801c1f04bc0) The buggy address belongs to the page: page:ffffea000707c100 count:1 mapcount:0 mapping:ffff8801c1f04000 index:0x0 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffff8801c1f04000 0000000000000000 0000000100000015 raw: ffffea0007077ce0 ffffea0007620020 ffff8801dac00640 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801c1f04a80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8801c1f04b00: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff8801c1f04b80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff8801c1f04c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8801c1f04c80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ==================================================================