syzbot


possible deadlock in nbd_disconnect_and_put

Status: upstream: reported on 2026/02/17 19:49
Subsystems: nbd
Labels: prio:low
[Documentation on labels]
Reported-by: syzbot+3add0454d5a2619b8e80@syzkaller.appspotmail.com
First crash: 142d, last: 1d07h
✨ AI Jobs (3)
ID Workflow Result Correct Bug Created Started Finished Revision Error
27bb1eda-2be9-4e7e-91d4-d87f75ff8acb assessment-security DenialOfService: ❌ Exploitable: ❌ FilesystemTrigger: ❌ NetworkTrigger: ❌ PeripheralTrigger: ❌ RemoteTrigger: ❌ Unprivileged: ❌ UserNamespace: ❌ VMGuestTrigger: ❌ VMHostTrigger: ❌ possible deadlock in nbd_disconnect_and_put 2026/05/30 07:38 2026/05/30 07:38 2026/05/30 08:38 6b4a844333e83556da95d61d7f207e7ef5cd4bc6

			
		
8ce3e094-f709-4a73-b084-52a9f4ce04e7 assessment-security 💥 possible deadlock in nbd_disconnect_and_put 2026/05/14 08:37 2026/05/14 08:37 2026/05/14 08:38 6ccb967e465e832a7bfd7a116ad00d52a0923a5d
failed to run ["git" "pull" "origin" "HEAD" "--depth=1" "--allow-unrelated-histories"]: exit status 128
From /app/workdir/repo/linux
 * branch                HEAD       -> FETCH_HEAD
Updating files:  ...
truncated to first 200 bytes; open job for full error
8b79b13b-f0b5-4ff1-bf40-8ce7a237bcce repro possible deadlock in nbd_disconnect_and_put 2026/03/06 07:38 2026/03/06 07:38 2026/03/06 07:48 31e9c887f7dc24e04b3ca70d0d54fc34141844b0

			
		
Discussions (2)
Title Replies (including bot) Last reply
[PATCH] nbd: fix circular lock dependency in nbd_disconnect_and_put 1 (1) 2026/06/30 03:10
[syzbot] [nbd?] possible deadlock in nbd_disconnect_and_put 0 (1) 2026/02/17 19:49

Sample crash report:
block nbd0: NBD_DISCONNECT
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Tainted: G             L     
------------------------------------------------------
syz.0.3313/21624 is trying to acquire lock:
ffff888026fb9940 ((wq_completion)nbd0-recv){+.+.}-{0:0}, at: touch_wq_lockdep_map+0xb5/0x180 kernel/workqueue.c:4037

but task is already holding lock:
ffff888026f42260 (&nbd->config_lock){+.+.}-{4:4}, at: nbd_disconnect_and_put+0x2a/0x280 drivers/block/nbd.c:2293

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&nbd->config_lock){+.+.}-{4:4}:
       __mutex_lock_common kernel/locking/mutex.c:646 [inline]
       __mutex_lock+0x19d/0x1550 kernel/locking/mutex.c:821
       refcount_dec_and_mutex_lock+0x30/0xa0 lib/refcount.c:118
       nbd_config_put+0x2e/0x660 drivers/block/nbd.c:1471
       recv_work+0x1d30/0x1e10 drivers/block/nbd.c:1026
       process_one_work kernel/workqueue.c:3322 [inline]
       process_scheduled_works+0xa8e/0x14e0 kernel/workqueue.c:3405
       worker_thread+0xa47/0xfb0 kernel/workqueue.c:3486
       kthread+0x388/0x470 kernel/kthread.c:436
       ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158
       ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

-> #1 ((work_completion)(&args->work)){+.+.}-{0:0}:
       process_one_work kernel/workqueue.c:3298 [inline]
       process_scheduled_works+0xa58/0x14e0 kernel/workqueue.c:3405
       worker_thread+0xa47/0xfb0 kernel/workqueue.c:3486
       kthread+0x388/0x470 kernel/kthread.c:436
       ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158
       ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

-> #0 ((wq_completion)nbd0-recv){+.+.}-{0:0}:
       check_prev_add kernel/locking/lockdep.c:3165 [inline]
       check_prevs_add kernel/locking/lockdep.c:3284 [inline]
       validate_chain kernel/locking/lockdep.c:3908 [inline]
       __lock_acquire+0x1520/0x2cf0 kernel/locking/lockdep.c:5237
       lock_acquire+0x106/0x350 kernel/locking/lockdep.c:5868
       touch_wq_lockdep_map+0xcb/0x180 kernel/workqueue.c:4037
       __flush_workqueue+0x148/0x1470 kernel/workqueue.c:4079
       nbd_disconnect_and_put+0x95/0x280 drivers/block/nbd.c:2301
       nbd_genl_disconnect+0x4af/0x590 drivers/block/nbd.c:2340
       genl_family_rcv_msg_doit+0x233/0x340 net/netlink/genetlink.c:1114
       genl_family_rcv_msg net/netlink/genetlink.c:1194 [inline]
       genl_rcv_msg+0x614/0x7a0 net/netlink/genetlink.c:1209
       netlink_rcv_skb+0x226/0x4a0 net/netlink/af_netlink.c:2556
       genl_rcv+0x28/0x40 net/netlink/genetlink.c:1218
       netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
       netlink_unicast+0x7bb/0x940 net/netlink/af_netlink.c:1345
       netlink_sendmsg+0x813/0xb40 net/netlink/af_netlink.c:1900
       sock_sendmsg_nosec+0x13a/0x180 net/socket.c:775
       __sock_sendmsg net/socket.c:790 [inline]
       ____sys_sendmsg+0x54e/0x850 net/socket.c:2684
       ___sys_sendmsg+0x2a5/0x360 net/socket.c:2738
       __sys_sendmsg net/socket.c:2770 [inline]
       __do_sys_sendmsg net/socket.c:2775 [inline]
       __se_sys_sendmsg net/socket.c:2773 [inline]
       __x64_sys_sendmsg+0x1b1/0x290 net/socket.c:2773
       do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
       do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

other info that might help us debug this:

Chain exists of:
  (wq_completion)nbd0-recv --> (work_completion)(&args->work) --> &nbd->config_lock

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&nbd->config_lock);
                               lock((work_completion)(&args->work));
                               lock(&nbd->config_lock);
  lock((wq_completion)nbd0-recv);

 *** DEADLOCK ***

3 locks held by syz.0.3313/21624:
 #0: ffffffff8fe5d528 (cb_lock){++++}-{4:4}, at: genl_rcv+0x19/0x40 net/netlink/genetlink.c:1217
 #1: ffffffff8fe5d360 (genl_mutex){+.+.}-{4:4}, at: genl_lock net/netlink/genetlink.c:35 [inline]
 #1: ffffffff8fe5d360 (genl_mutex){+.+.}-{4:4}, at: genl_op_lock net/netlink/genetlink.c:60 [inline]
 #1: ffffffff8fe5d360 (genl_mutex){+.+.}-{4:4}, at: genl_rcv_msg+0x10b/0x7a0 net/netlink/genetlink.c:1208
 #2: ffff888026f42260 (&nbd->config_lock){+.+.}-{4:4}, at: nbd_disconnect_and_put+0x2a/0x280 drivers/block/nbd.c:2293

stack backtrace:
CPU: 1 UID: 0 PID: 21624 Comm: syz.0.3313 Tainted: G             L      syzkaller #0 PREEMPT(full) 
Tainted: [L]=SOFTLOCKUP
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 print_circular_bug+0x2e1/0x300 kernel/locking/lockdep.c:2043
 check_noncircular+0x12e/0x150 kernel/locking/lockdep.c:2175
 check_prev_add kernel/locking/lockdep.c:3165 [inline]
 check_prevs_add kernel/locking/lockdep.c:3284 [inline]
 validate_chain kernel/locking/lockdep.c:3908 [inline]
 __lock_acquire+0x1520/0x2cf0 kernel/locking/lockdep.c:5237
 lock_acquire+0x106/0x350 kernel/locking/lockdep.c:5868
 touch_wq_lockdep_map+0xcb/0x180 kernel/workqueue.c:4037
 __flush_workqueue+0x148/0x1470 kernel/workqueue.c:4079
 nbd_disconnect_and_put+0x95/0x280 drivers/block/nbd.c:2301
 nbd_genl_disconnect+0x4af/0x590 drivers/block/nbd.c:2340
 genl_family_rcv_msg_doit+0x233/0x340 net/netlink/genetlink.c:1114
 genl_family_rcv_msg net/netlink/genetlink.c:1194 [inline]
 genl_rcv_msg+0x614/0x7a0 net/netlink/genetlink.c:1209
 netlink_rcv_skb+0x226/0x4a0 net/netlink/af_netlink.c:2556
 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1218
 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
 netlink_unicast+0x7bb/0x940 net/netlink/af_netlink.c:1345
 netlink_sendmsg+0x813/0xb40 net/netlink/af_netlink.c:1900
 sock_sendmsg_nosec+0x13a/0x180 net/socket.c:775
 __sock_sendmsg net/socket.c:790 [inline]
 ____sys_sendmsg+0x54e/0x850 net/socket.c:2684
 ___sys_sendmsg+0x2a5/0x360 net/socket.c:2738
 __sys_sendmsg net/socket.c:2770 [inline]
 __do_sys_sendmsg net/socket.c:2775 [inline]
 __se_sys_sendmsg net/socket.c:2773 [inline]
 __x64_sys_sendmsg+0x1b1/0x290 net/socket.c:2773
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f25f3b9ce59
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f25f4973028 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007f25f3e15fa0 RCX: 00007f25f3b9ce59
RDX: 0000000004000810 RSI: 00002000000002c0 RDI: 0000000000000009
RBP: 00007f25f3c32e6f R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f25f3e16038 R14: 00007f25f3e15fa0 R15: 00007ffd58d7d478
 </TASK>

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/06/28 15:08 upstream 780d569e6c4b fb92f11c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in nbd_disconnect_and_put
2026/07/07 23:49 upstream 0e35b9b6ec0f 88a4b44c .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nbd_disconnect_and_put
2026/05/15 21:46 upstream d458a240344c 81fb92f3 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nbd_disconnect_and_put
2026/02/16 16:36 linux-next 635c467cc14e 5d52cba5 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-rust-kasan-gce possible deadlock in nbd_disconnect_and_put
* Struck through repros no longer work on HEAD.