================================================================== BUG: KASAN: use-after-free in do_blk_trace_setup+0xab4/0xcf0 kernel/trace/blktrace.c:546 Read of size 8 at addr ffff88003da43340 by task syz-executor6/4340 CPU: 2 PID: 4340 Comm: syz-executor6 Not tainted 4.14.0-rc7-next-20171103+ #10 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 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+0xc77/0x2da0 drivers/scsi/sg.c:1089 vfs_ioctl fs/ioctl.c:46 [inline] do_vfs_ioctl+0x1b1/0x1530 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:0x447c89 RSP: 002b:00007f665fe2dbd8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f665fe2e6cc RCX: 0000000000447c89 RDX: 000000002084cf90 RSI: 00000000c0481273 RDI: 0000000000000018 RBP: 0000000000000086 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 0000000000008568 R14: 00000000006ec608 R15: 00007f665fe2e700 Allocated by task 4340: 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:3615 kmalloc include/linux/slab.h:500 [inline] kzalloc include/linux/slab.h:689 [inline] do_blk_trace_setup+0x182/0xcf0 kernel/trace/blktrace.c:479 blk_trace_setup+0xbd/0x180 kernel/trace/blktrace.c:564 sg_ioctl+0xc77/0x2da0 drivers/scsi/sg.c:1089 vfs_ioctl fs/ioctl.c:46 [inline] do_vfs_ioctl+0x1b1/0x1530 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 4372: 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:3493 [inline] kfree+0xca/0x250 mm/slab.c:3808 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+0x5f1/0x2da0 drivers/scsi/sg.c:1098 vfs_ioctl fs/ioctl.c:46 [inline] do_vfs_ioctl+0x1b1/0x1530 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 ffff88003da43300 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 64 bytes inside of 128-byte region [ffff88003da43300, ffff88003da43380) The buggy address belongs to the page: page:ffffea0000f690c0 count:1 mapcount:0 mapping:ffff88003da43000 index:0x0 flags: 0x100000000000100(slab) raw: 0100000000000100 ffff88003da43000 0000000000000000 0000000100000015 raw: ffffea0000f06820 ffffea0000f513a0 ffff88003e800640 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88003da43200: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ffff88003da43280: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc >ffff88003da43300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88003da43380: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ffff88003da43400: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ==================================================================