bisecting fixing commit since ddef1e8e3f6eb26034833b7255e3fa584d54a230 building syzkaller on af5c522d02400b35a930d6fbdf286f9ce2afc8ba testing commit ddef1e8e3f6eb26034833b7255e3fa584d54a230 with gcc (GCC) 8.1.0 kernel signature: 7d383c056787dec36d0e5bc6a0fa2bf4749076e15eb30784d70e6ab2c4bfc3ab run #0: crashed: general protection fault in relay_switch_subbuf run #1: crashed: KASAN: use-after-free Read in relay_switch_subbuf run #2: crashed: KASAN: use-after-free Read in relay_switch_subbuf run #3: crashed: KASAN: use-after-free Read in relay_switch_subbuf run #4: crashed: KASAN: use-after-free Read in relay_switch_subbuf run #5: crashed: WARNING: bad unlock balance in corrupted run #6: crashed: general protection fault in relay_open_buf run #7: crashed: KASAN: use-after-free Read in relay_switch_subbuf run #8: crashed: KASAN: use-after-free Read in relay_switch_subbuf run #9: crashed: KASAN: use-after-free Read in relay_switch_subbuf testing current HEAD 6b6446efedb27c2766745a04f9b5d4449f51391d testing commit 6b6446efedb27c2766745a04f9b5d4449f51391d with gcc (GCC) 8.1.0 kernel signature: 8a549cd52c4e7799476a9fa161b3e3e9cf1ef350055ec7a55c1644ffb61c6580 all runs: crashed: KASAN: use-after-free Read in relay_switch_subbuf revisions tested: 2, total time: 22m9.872833859s (build: 15m45.706169795s, test: 5m29.376560749s) the crash still happens on HEAD commit msg: Linux 4.14.204 crash: KASAN: use-after-free Read in relay_switch_subbuf 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 relay_switch_subbuf+0xb0a/0xc40 kernel/relay.c:760 Read of size 8 at addr ffff88808ef9d238 by task kworker/0:4/6900 CPU: 0 PID: 6900 Comm: kworker/0:4 Not tainted 4.14.204-syzkaller #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: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 relay_switch_subbuf+0xb0a/0xc40 kernel/relay.c:760 relay_flush+0x183/0x230 kernel/relay.c:888 __blk_trace_startstop+0x430/0x5b0 kernel/trace/blktrace.c:708 blk_trace_shutdown+0x5f/0xc0 kernel/trace/blktrace.c:791 __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 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 Allocated by task 7752: 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/0xa50 fs/dcache.c:1623 d_alloc+0x43/0x260 fs/dcache.c:1710 __lookup_hash+0x40/0x160 fs/namei.c:1571 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 blk_create_buf_file_callback+0x19/0x20 kernel/trace/blktrace.c:460 relay_create_buf_file+0xea/0x160 kernel/relay.c:428 relay_open_buf.part.11+0x5e7/0x940 kernel/relay.c:457 relay_open_buf kernel/relay.c:449 [inline] relay_open+0x488/0x8a0 kernel/relay.c:604 do_blk_trace_setup+0x3df/0xbc0 kernel/trace/blktrace.c:570 __blk_trace_setup+0xa8/0x110 kernel/trace/blktrace.c:615 blk_trace_ioctl+0x136/0x230 kernel/trace/blktrace.c:756 blkdev_ioctl+0x6fc/0x1770 block/ioctl.c:580 block_ioctl+0xd7/0x130 fs/block_dev.c:1893 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 entry_SYSCALL_64_after_hwframe+0x46/0xbb 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 __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 ffff88808ef9d1e0 which belongs to the cache dentry of size 288 The buggy address is located 88 bytes inside of 288-byte region [ffff88808ef9d1e0, ffff88808ef9d300) The buggy address belongs to the page: page:ffffea00023be740 count:1 mapcount:0 mapping:ffff88808ef9d080 index:0x0 flags: 0x1fffc0000000100(slab) raw: 01fffc0000000100 ffff88808ef9d080 0000000000000000 000000010000000b raw: ffffea00023be720 ffffea00023be7a0 ffff8880b65b4e40 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808ef9d100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808ef9d180: fb fb fb fb fc fc fc fc fc fc fc fc fb fb fb fb >ffff88808ef9d200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88808ef9d280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808ef9d300: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ================================================================== devpts: called with bogus options devpts: called with bogus options devpts: called with bogus options devpts: called with bogus options devpts: called with bogus options