bisecting fixing commit since 3af409ca278d4a8d50e91f9f7c4c33b175645cf3 building syzkaller on 3e5ed8b45e7a561d6344a4d3d7bf3bfb8f24a7b3 testing commit 3af409ca278d4a8d50e91f9f7c4c33b175645cf3 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.1 kernel signature: 20c455d8a58ab564b3d2acb25c1b998aa7a1929f4ff4fed292c78b6985cb6102 run #0: crashed: KASAN: use-after-free Read in nbd_genl_connect run #1: crashed: KASAN: use-after-free Read in nbd_genl_connect run #2: crashed: KASAN: use-after-free Read in nbd_genl_connect run #3: crashed: KASAN: use-after-free Read in nbd_genl_connect run #4: crashed: KASAN: use-after-free Read in nbd_genl_connect run #5: crashed: KASAN: use-after-free Read in nbd_release run #6: crashed: KASAN: use-after-free Read in nbd_release run #7: crashed: KASAN: use-after-free Read in nbd_genl_connect run #8: crashed: KASAN: use-after-free Read in nbd_genl_connect run #9: crashed: KASAN: use-after-free Read in nbd_release run #10: crashed: KASAN: use-after-free Read in nbd_release run #11: crashed: KASAN: use-after-free Read in nbd_release run #12: crashed: KASAN: use-after-free Write in nbd_release run #13: crashed: WARNING: refcount bug in nbd_config_put run #14: crashed: KASAN: use-after-free Read in nbd_genl_connect run #15: crashed: KASAN: use-after-free Read in nbd_genl_connect run #16: crashed: KASAN: use-after-free Read in nbd_genl_connect run #17: crashed: KASAN: use-after-free Read in nbd_genl_connect run #18: crashed: KASAN: use-after-free Write in nbd_release run #19: crashed: WARNING: refcount bug in nbd_config_put testing current HEAD 5f773519639041faed4132f5943d7895f9078a4c testing commit 5f773519639041faed4132f5943d7895f9078a4c compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.1 kernel signature: e64a0629dc7def04f0e6861394de57e76dfeb426a89c33da46a39987add03fba all runs: crashed: possible deadlock in del_gendisk revisions tested: 2, total time: 20m29.999964151s (build: 13m2.788454629s, test: 6m46.570458379s) the crash still happens on HEAD commit msg: ice: Fix perout start time rounding crash: possible deadlock in del_gendisk ============================================ WARNING: possible recursive locking detected 5.14.0-rc5-syzkaller #0 Not tainted -------------------------------------------- systemd-udevd/10215 is trying to acquire lock: ffff888019132d18 (&disk->open_mutex){+.+.}-{3:3}, at: del_gendisk+0x81/0x720 block/genhd.c:587 but task is already holding lock: ffff888019132d18 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_put+0x8a/0x950 fs/block_dev.c:1534 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&disk->open_mutex); lock(&disk->open_mutex); *** DEADLOCK *** May be due to missing lock nesting notation 2 locks held by systemd-udevd/10215: #0: ffff888019132d18 ( &disk->open_mutex){+.+.}-{3:3}, at: blkdev_put+0x8a/0x950 fs/block_dev.c:1534 #1: ffffffff8b40c6e8 (nbd_index_mutex){+.+.}-{3:3}, at: refcount_dec_and_mutex_lock lib/refcount.c:118 [inline] #1: ffffffff8b40c6e8 (nbd_index_mutex){+.+.}-{3:3}, at: refcount_dec_and_mutex_lock+0x2b/0xd0 lib/refcount.c:113 stack backtrace: CPU: 1 PID: 10215 Comm: systemd-udevd Not tainted 5.14.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x45/0x59 lib/dump_stack.c:105 print_deadlock_bug kernel/locking/lockdep.c:2944 [inline] check_deadlock kernel/locking/lockdep.c:2987 [inline] validate_chain kernel/locking/lockdep.c:3776 [inline] __lock_acquire.cold+0x229/0x3ab kernel/locking/lockdep.c:5015 lock_acquire kernel/locking/lockdep.c:5625 [inline] lock_acquire+0x1ab/0x4f0 kernel/locking/lockdep.c:5590 __mutex_lock_common kernel/locking/mutex.c:959 [inline] __mutex_lock+0x12a/0x10a0 kernel/locking/mutex.c:1104 del_gendisk+0x81/0x720 block/genhd.c:587 nbd_dev_remove drivers/block/nbd.c:241 [inline] nbd_put.part.0+0x77/0x130 drivers/block/nbd.c:263 blkdev_put_whole fs/block_dev.c:1279 [inline] blkdev_put+0x2cd/0x950 fs/block_dev.c:1576 blkdev_close+0x8b/0xd0 fs/block_dev.c:1586 __fput+0x209/0x870 fs/file_table.c:280 task_work_run+0xc0/0x160 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x27e/0x290 kernel/entry/common.c:209 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x19/0x50 kernel/entry/common.c:302 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fe021dca270 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:00007fff0ba53848 EFLAGS: 00000246 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000007 RCX: 00007fe021dca270 RDX: 000000000aba9500 RSI: 0000000000000000 RDI: 0000000000000007 RBP: 00007fe022c84710 R08: 000000000000004a R09: 0000000000000008 R10: 0000560b90d75758 R11: 0000000000000246 R12: 0000000000000000 R13: 0000560b90d78880 R14: 0000000000000003 R15: 000000000000000e ---------------- Code disassembly (best guess): 0: 73 01 jae 0x3 2: c3 retq 3: 48 8b 0d 38 7d 20 00 mov 0x207d38(%rip),%rcx # 0x207d42 a: f7 d8 neg %eax c: 64 89 01 mov %eax,%fs:(%rcx) f: 48 83 c8 ff or $0xffffffffffffffff,%rax 13: c3 retq 14: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1) 1a: 83 3d 59 c1 20 00 00 cmpl $0x0,0x20c159(%rip) # 0x20c17a 21: 75 10 jne 0x33 23: b8 03 00 00 00 mov $0x3,%eax 28: 0f 05 syscall 2a: 48 3d 01 f0 ff ff cmp $0xfffffffffffff001,%rax <-- trapping instruction 30: 73 31 jae 0x63 32: c3 retq 33: 48 83 ec 08 sub $0x8,%rsp 37: e8 ee fb ff ff callq 0xfffffc2a 3c: 48 89 04 24 mov %rax,(%rsp)