bisecting fixing commit since ddef1e8e3f6eb26034833b7255e3fa584d54a230 building syzkaller on bc2c6e45b9f01fa6046cb3efa9d3aae9f05238a8 testing commit ddef1e8e3f6eb26034833b7255e3fa584d54a230 with gcc (GCC) 8.1.0 kernel signature: e7513da66c2b4ab985b6aab8e53f6c077f5af60a7a5d59b80f328f5838cd63ad run #0: crashed: KASAN: use-after-free Read in debugfs_remove run #1: crashed: WARNING: bad unlock balance detected! run #2: crashed: KASAN: use-after-free Read in debugfs_remove run #3: crashed: KASAN: use-after-free Read in debugfs_remove run #4: crashed: KASAN: use-after-free Read in debugfs_remove run #5: crashed: KASAN: use-after-free Read in debugfs_remove run #6: crashed: KASAN: use-after-free Read in debugfs_remove run #7: crashed: KASAN: use-after-free Read in debugfs_remove run #8: crashed: KASAN: use-after-free Read in debugfs_remove run #9: crashed: KASAN: use-after-free Read in debugfs_remove testing current HEAD c10b57a567e4333b9fdf60b5ec36de9859263ca2 testing commit c10b57a567e4333b9fdf60b5ec36de9859263ca2 with gcc (GCC) 8.1.0 kernel signature: cf77c1e58e2ac225ab21f87da2c48d0ae5d517859fcd0bbbf284115d4961303d all runs: crashed: KASAN: use-after-free Read in debugfs_remove revisions tested: 2, total time: 25m59.707822584s (build: 17m17.490419207s, test: 7m49.325932741s) the crash still happens on HEAD commit msg: Linux 4.14.176 crash: KASAN: use-after-free Read in debugfs_remove devpts: called with bogus options devpts: called with bogus options devpts: called with bogus options devpts: called with bogus options ================================================================== BUG: KASAN: use-after-free in debugfs_remove+0xda/0x100 fs/debugfs/inode.c:662 Read of size 8 at addr ffff888098e5ebc0 by task kworker/0:3/6887 CPU: 0 PID: 6887 Comm: kworker/0:3 Not tainted 4.14.176-syzkaller #0 devpts: called with bogus options 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:17 [inline] dump_stack+0xf7/0x13b lib/dump_stack.c:58 print_address_description.cold.7+0x9/0x1c9 mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report.cold.8+0x11a/0x2d3 mm/kasan/report.c:409 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430 debugfs_remove+0xda/0x100 fs/debugfs/inode.c:662 blk_trace_free+0x30/0x130 kernel/trace/blktrace.c:324 blk_trace_cleanup kernel/trace/blktrace.c:351 [inline] blk_trace_remove+0x42/0x70 kernel/trace/blktrace.c:364 devpts: called with bogus options blk_trace_shutdown+0x42/0x50 kernel/trace/blktrace.c:728 __blk_release_queue+0x1f9/0x470 block/blk-sysfs.c:830 process_one_work+0x79e/0x16c0 kernel/workqueue.c:2116 worker_thread+0xcc/0xee0 kernel/workqueue.c:2250 kthread+0x338/0x400 kernel/kthread.c:232 devpts: called with bogus options ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 Allocated by task 8657: 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+0xc7/0xe0 mm/kasan/kasan.c:551 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:489 kmem_cache_alloc+0x12e/0x790 mm/slab.c:3552 __d_alloc+0x28/0x9f0 fs/dcache.c:1623 d_alloc+0x43/0x260 fs/dcache.c:1710 __lookup_hash+0x40/0x160 fs/namei.c:1571 devpts: called with bogus options lookup_one_len+0x26e/0x3a0 fs/namei.c:2539 start_creating+0x91/0x190 fs/debugfs/inode.c:314 __debugfs_create_file+0x37/0x390 fs/debugfs/inode.c:353 debugfs_create_file+0x24/0x30 fs/debugfs/inode.c:404 do_blk_trace_setup+0x2fe/0xb10 kernel/trace/blktrace.c:529 blk_trace_setup+0xa8/0x110 kernel/trace/blktrace.c:579 blk_trace_ioctl+0x136/0x230 kernel/trace/blktrace.c:694 blkdev_ioctl+0x6ae/0x16b0 block/ioctl.c:580 block_ioctl+0xd7/0x130 fs/block_dev.c:1881 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:500 [inline] do_vfs_ioctl+0x180/0xfb0 fs/ioctl.c:684 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x74/0x80 fs/ioctl.c:692 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 devpts: called with bogus options entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 17: 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:3496 [inline] kmem_cache_free+0x80/0x2d0 mm/slab.c:3758 __d_free+0x17/0x20 fs/dcache.c:270 devpts: called with bogus options __rcu_reclaim kernel/rcu/rcu.h:195 [inline] rcu_do_batch kernel/rcu/tree.c:2699 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2962 [inline] __rcu_process_callbacks kernel/rcu/tree.c:2929 [inline] rcu_process_callbacks+0x7e0/0x11e0 kernel/rcu/tree.c:2946 __do_softirq+0x246/0x9b0 kernel/softirq.c:288 The buggy address belongs to the object at ffff888098e5eb80 which belongs to the cache dentry of size 288 The buggy address is located 64 bytes inside of 288-byte region [ffff888098e5eb80, ffff888098e5eca0) The buggy address belongs to the page: page:ffffea0002639780 count:1 mapcount:0 mapping:ffff888098e5e080 index:0x0 flags: 0x1fffc0000000100(slab) raw: 01fffc0000000100 ffff888098e5e080 0000000000000000 000000010000000b raw: ffffea0002639520 ffffea000263b2a0 ffff88821f8b5680 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: devpts: called with bogus options ffff888098e5ea80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888098e5eb00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff888098e5eb80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888098e5ec00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888098e5ec80: fb fb fb fb fc fc fc fc fc fc fc fc 00 00 00 00 ==================================================================