================================================================== BUG: KASAN: use-after-free in debugfs_remove+0x11a/0x130 fs/debugfs/inode.c:685 Read of size 8 at addr ffff88808d439898 by task kworker/0:1/12 CPU: 0 PID: 12 Comm: kworker/0:1 Not tainted 5.2.0-rc5+ #32 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+0x172/0x1f0 lib/dump_stack.c:113 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:188 __kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 kasan_report+0x12/0x20 mm/kasan/common.c:614 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132 debugfs_remove+0x11a/0x130 fs/debugfs/inode.c:685 blk_trace_free+0x38/0x140 kernel/trace/blktrace.c:312 blk_trace_cleanup kernel/trace/blktrace.c:339 [inline] __blk_trace_remove+0x78/0xa0 kernel/trace/blktrace.c:352 blk_trace_shutdown+0x67/0x90 kernel/trace/blktrace.c:753 __blk_release_queue+0x1d6/0x330 block/blk-sysfs.c:902 process_one_work+0x989/0x1790 kernel/workqueue.c:2269 worker_thread+0x98/0xe40 kernel/workqueue.c:2415 kthread+0x354/0x420 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 Allocated by task 9379: save_stack+0x23/0x90 mm/kasan/common.c:71 set_track mm/kasan/common.c:79 [inline] __kasan_kmalloc mm/kasan/common.c:489 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:462 kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:497 slab_post_alloc_hook mm/slab.h:437 [inline] slab_alloc mm/slab.c:3326 [inline] kmem_cache_alloc+0x11a/0x6f0 mm/slab.c:3488 __d_alloc+0x2e/0x8c0 fs/dcache.c:1622 d_alloc+0x4d/0x280 fs/dcache.c:1701 d_alloc_parallel+0xf4/0x1bb0 fs/dcache.c:2455 __lookup_slow+0x1ab/0x500 fs/namei.c:1652 lookup_one_len+0x16d/0x1a0 fs/namei.c:2541 start_creating fs/debugfs/inode.c:307 [inline] start_creating+0xbf/0x1e0 fs/debugfs/inode.c:283 debugfs_create_dir+0x26/0x3a0 fs/debugfs/inode.c:507 blk_mq_debugfs_register+0x8c/0x420 block/blk-mq-debugfs.c:842 blk_register_queue+0x1cd/0x3a0 block/blk-sysfs.c:987 __device_add_disk+0xe8d/0x11c0 block/genhd.c:738 device_add_disk+0x2b/0x40 block/genhd.c:754 add_disk include/linux/genhd.h:429 [inline] loop_add+0x635/0x8d0 drivers/block/loop.c:2056 loop_probe+0x161/0x1a0 drivers/block/loop.c:2128 kobj_lookup+0x260/0x460 drivers/base/map.c:124 get_gendisk+0x4d/0x390 block/genhd.c:869 bdev_get_gendisk fs/block_dev.c:1112 [inline] __blkdev_get+0x457/0x1660 fs/block_dev.c:1505 blkdev_get+0xc4/0x990 fs/block_dev.c:1664 blkdev_open+0x205/0x290 fs/block_dev.c:1822 do_dentry_open+0x4df/0x1250 fs/open.c:778 vfs_open+0xa0/0xd0 fs/open.c:887 do_last fs/namei.c:3416 [inline] path_openat+0x10e9/0x46d0 fs/namei.c:3533 do_filp_open+0x1a1/0x280 fs/namei.c:3563 do_sys_open+0x3fe/0x5d0 fs/open.c:1070 __do_sys_open fs/open.c:1088 [inline] __se_sys_open fs/open.c:1083 [inline] __x64_sys_open+0x7e/0xc0 fs/open.c:1083 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 0: save_stack+0x23/0x90 mm/kasan/common.c:71 set_track mm/kasan/common.c:79 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:451 kasan_slab_free+0xe/0x10 mm/kasan/common.c:459 __cache_free mm/slab.c:3432 [inline] kmem_cache_free+0x86/0x260 mm/slab.c:3698 __d_free+0x20/0x30 fs/dcache.c:271 __rcu_reclaim kernel/rcu/rcu.h:222 [inline] rcu_do_batch kernel/rcu/tree.c:2092 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2310 [inline] rcu_core+0xba5/0x1500 kernel/rcu/tree.c:2291 __do_softirq+0x25c/0x94c kernel/softirq.c:292 The buggy address belongs to the object at ffff88808d439840 which belongs to the cache dentry of size 288 The buggy address is located 88 bytes inside of 288-byte region [ffff88808d439840, ffff88808d439960) The buggy address belongs to the page: page:ffffea0002350e40 refcount:1 mapcount:0 mapping:ffff8880aa5907c0 index:0x0 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea000235f6c8 ffffea000235f788 ffff8880aa5907c0 raw: 0000000000000000 ffff88808d439000 000000010000000b 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808d439780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808d439800: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff88808d439880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88808d439900: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff88808d439980: fc fc fc fc fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================