================================================================== BUG: KASAN: use-after-free in debugfs_remove+0x4f/0xf0 fs/debugfs/inode.c:705 Read of size 8 at addr ffff88804023d600 by task kworker/0:5/10137 CPU: 0 PID: 10137 Comm: kworker/0:5 Not tainted 5.3.0+ #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events __blk_release_queue Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x2f8 lib/dump_stack.c:113 print_address_description+0x75/0x5c0 mm/kasan/report.c:374 __kasan_report+0x14b/0x1c0 mm/kasan/report.c:506 kasan_report+0x26/0x50 mm/kasan/common.c:634 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132 debugfs_remove+0x4f/0xf0 fs/debugfs/inode.c:705 blk_trace_free kernel/trace/blktrace.c:312 [inline] blk_trace_cleanup kernel/trace/blktrace.c:339 [inline] __blk_trace_remove+0xa5/0x180 kernel/trace/blktrace.c:352 blk_trace_shutdown+0x20b/0x260 kernel/trace/blktrace.c:747 __blk_release_queue+0x244/0x2e0 block/blk-sysfs.c:905 process_one_work+0x7ef/0x10e0 kernel/workqueue.c:2269 worker_thread+0xc01/0x1630 kernel/workqueue.c:2415 kthread+0x332/0x350 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 Allocated by task 19788: save_stack mm/kasan/common.c:69 [inline] set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc+0x11c/0x1b0 mm/kasan/common.c:510 kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:518 slab_post_alloc_hook mm/slab.h:584 [inline] slab_alloc mm/slab.c:3319 [inline] kmem_cache_alloc+0x1f5/0x2e0 mm/slab.c:3483 __d_alloc+0x2d/0x6e0 fs/dcache.c:1688 d_alloc fs/dcache.c:1767 [inline] d_alloc_parallel+0x7f/0x1430 fs/dcache.c:2519 __lookup_slow+0xa7/0x380 fs/namei.c:1646 lookup_one_len+0x123/0x220 fs/namei.c:2533 start_creating+0xd3/0x270 fs/debugfs/inode.c:312 __debugfs_create_file+0x75/0x450 fs/debugfs/inode.c:357 debugfs_create_file+0x4a/0x60 fs/debugfs/inode.c:413 do_blk_trace_setup+0x439/0xaa0 kernel/trace/blktrace.c:524 __blk_trace_setup kernel/trace/blktrace.c:571 [inline] blk_trace_ioctl+0x24c/0x7d0 kernel/trace/blktrace.c:710 blkdev_ioctl+0x1363/0x2990 block/ioctl.c:592 block_ioctl+0xbd/0x100 fs/block_dev.c:1954 do_vfs_ioctl+0x744/0x1730 fs/ioctl.c:46 ksys_ioctl fs/ioctl.c:713 [inline] __do_sys_ioctl fs/ioctl.c:720 [inline] __se_sys_ioctl fs/ioctl.c:718 [inline] __x64_sys_ioctl+0xe3/0x120 fs/ioctl.c:718 do_syscall_64+0xf7/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 16: save_stack mm/kasan/common.c:69 [inline] set_track mm/kasan/common.c:77 [inline] kasan_set_free_info mm/kasan/common.c:332 [inline] __kasan_slab_free+0x12a/0x1e0 mm/kasan/common.c:471 kasan_slab_free+0xe/0x10 mm/kasan/common.c:480 __cache_free mm/slab.c:3425 [inline] kmem_cache_free+0x81/0xf0 mm/slab.c:3693 __d_free+0x20/0x30 fs/dcache.c:271 __rcu_reclaim kernel/rcu/rcu.h:222 [inline] rcu_do_batch kernel/rcu/tree.c:2157 [inline] rcu_core+0x843/0x1050 kernel/rcu/tree.c:2377 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2386 __do_softirq+0x333/0x7c4 arch/x86/include/asm/paravirt.h:766 The buggy address belongs to the object at ffff88804023d5c0 which belongs to the cache dentry(17:syz0) of size 288 The buggy address is located 64 bytes inside of 288-byte region [ffff88804023d5c0, ffff88804023d6e0) The buggy address belongs to the page: page:ffffea0001008f40 refcount:1 mapcount:0 mapping:ffff88809c1ff1c0 index:0xffff88804023d1a0 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea0001f96708 ffffea0001022b08 ffff88809c1ff1c0 raw: ffff88804023d1a0 ffff88804023d040 0000000100000008 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88804023d500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88804023d580: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff88804023d600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88804023d680: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff88804023d700: fc fc fc fc fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================