bisecting fixing commit since 3c8c23092588a23bf1856a64f58c37f477a413be building syzkaller on 3c7fef3361a6007112b26adc1c5a550189ef43fe testing commit 3c8c23092588a23bf1856a64f58c37f477a413be compiler: gcc version 8.4.1 20210217 (GCC) kernel signature: 2e1b7cba2e27708fbdb945d22fd510c466baa28d3fb8c18efa12814a596798b0 run #0: crashed: KASAN: use-after-free Write in ex_handler_refcount run #1: crashed: KASAN: use-after-free Read in nbd_put run #2: crashed: KASAN: use-after-free Write in ex_handler_refcount run #3: crashed: KASAN: use-after-free Read in nbd_put run #4: crashed: KASAN: use-after-free Read in nbd_put run #5: crashed: KASAN: use-after-free Read in nbd_put run #6: crashed: KASAN: use-after-free Read in nbd_put run #7: crashed: KASAN: use-after-free Read in nbd_put run #8: crashed: KASAN: use-after-free Read in nbd_put run #9: crashed: KASAN: use-after-free Read in nbd_put run #10: crashed: KASAN: use-after-free Write in ex_handler_refcount run #11: crashed: WARNING: refcount bug in nbd_put run #12: crashed: KASAN: use-after-free Read in nbd_put run #13: crashed: WARNING: refcount bug in nbd_put run #14: crashed: KASAN: use-after-free Read in nbd_put run #15: crashed: WARNING: refcount bug in nbd_put run #16: crashed: KASAN: use-after-free Read in nbd_put run #17: crashed: KASAN: use-after-free Read in nbd_put run #18: crashed: KASAN: use-after-free Read in nbd_put run #19: crashed: KASAN: use-after-free Write in ex_handler_refcount testing current HEAD b172b44fcb1771e083aad806fa96f3f60e2ddfac testing commit b172b44fcb1771e083aad806fa96f3f60e2ddfac compiler: gcc version 8.4.1 20210217 (GCC) kernel signature: c3df82e986ddfad8ed5469874417deffdccaffe431117614ccfdeec012998a07 run #0: crashed: WARNING: refcount bug in nbd_put run #1: crashed: KASAN: use-after-free Read in nbd_put run #2: crashed: KASAN: use-after-free Read in nbd_put run #3: crashed: KASAN: use-after-free Write in ex_handler_refcount run #4: crashed: KASAN: use-after-free Read in nbd_put run #5: crashed: KASAN: use-after-free Read in nbd_put run #6: crashed: WARNING: refcount bug in nbd_put run #7: crashed: KASAN: use-after-free Read in nbd_put run #8: crashed: KASAN: use-after-free Read in nbd_put run #9: crashed: WARNING: refcount bug in nbd_put revisions tested: 2, total time: 27m35.695866464s (build: 19m57.665885451s, test: 6m56.345970673s) the crash still happens on HEAD commit msg: Linux 4.19.206 crash: WARNING: refcount bug in nbd_put ieee802154 phy1 wpan1: encryption failed: -22 Bluetooth: hci3: command 0x040f tx timeout Bluetooth: hci3: command 0x0419 tx timeout ------------[ cut here ]------------ refcount_t: underflow; use-after-free. WARNING: CPU: 1 PID: 14014 at lib/refcount.c:280 refcount_dec_not_one lib/refcount.c:280 [inline] WARNING: CPU: 1 PID: 14014 at lib/refcount.c:280 refcount_dec_not_one+0x141/0x160 lib/refcount.c:267 Kernel panic - not syncing: panic_on_warn set ... CPU: 1 PID: 14014 Comm: systemd-udevd Not tainted 4.19.206-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x17c/0x226 lib/dump_stack.c:118 panic+0x1cd/0x375 kernel/panic.c:186 __warn.cold.7+0x1b/0x36 kernel/panic.c:541 report_bug+0x1a1/0x200 lib/bug.c:183 fixup_bug arch/x86/kernel/traps.c:178 [inline] fixup_bug arch/x86/kernel/traps.c:173 [inline] do_error_trap+0x200/0x350 arch/x86/kernel/traps.c:296 do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:316 invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:1038 RIP: 0010:refcount_dec_not_one lib/refcount.c:280 [inline] RIP: 0010:refcount_dec_not_one+0x141/0x160 lib/refcount.c:267 Code: 83 f8 01 74 29 44 8d 60 ff 44 39 e0 73 8f 80 3d 91 13 5b 07 00 75 ab 48 c7 c7 80 08 50 88 c6 05 81 13 5b 07 01 e8 94 83 3b 04 <0f> 0b eb 94 31 c0 eb 95 48 89 df e8 6f 70 45 fe e9 3d ff ff ff e8 RSP: 0018:ffff88807e8cfb30 EFLAGS: 00010282 RAX: 0000000000000000 RBX: ffff8880a14f2398 RCX: 0000000000000000 RDX: 0000000000000004 RSI: ffffffff885023e0 RDI: ffffffff8bad9720 RBP: ffff88807e8cfbb8 R08: ffffed1017464ea9 R09: ffffed1017464ea8 R10: ffffed1017464ea8 R11: ffff8880ba327547 R12: 00000000ffffffff R13: ffff88807e8cfb50 R14: 1ffff1100fd19f66 R15: ffff88807e8cfb90 refcount_dec_and_mutex_lock+0x17/0x50 lib/refcount.c:308 nbd_put+0x1f/0x150 drivers/block/nbd.c:228 nbd_config_put+0x539/0x7a0 drivers/block/nbd.c:1185 nbd_release+0xd9/0x140 drivers/block/nbd.c:1461 __blkdev_put+0x5fc/0x760 fs/block_dev.c:1819 blkdev_put+0x73/0x470 fs/block_dev.c:1881 blkdev_close+0x88/0xd0 fs/block_dev.c:1888 __fput+0x249/0x7f0 fs/file_table.c:278 ____fput+0x9/0x10 fs/file_table.c:309 task_work_run+0x108/0x180 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x185/0x1e0 arch/x86/entry/common.c:167 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x413/0x4e0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f6b51197270 Code: 73 01 c3 48 8b 0d 38 7d 20 00 f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 83 3d 59 c1 20 00 00 75 10 b8 03 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 ee fb ff ff 48 89 04 24 RSP: 002b:00007ffe3542de88 EFLAGS: 00000246 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000007 RCX: 00007f6b51197270 RDX: 000000000aba9500 RSI: 0000000000000000 RDI: 0000000000000007 RBP: 00007f6b52051710 R08: 0000000000000045 R09: 0000000000000018 R10: 000055643e364758 R11: 0000000000000246 R12: 0000000000000000 R13: 000055643e363cf0 R14: 0000000000000003 R15: 000000000000000e Kernel Offset: disabled Rebooting in 86400 seconds..