syzbot


possible deadlock in vmci_qp_broker_detach

Status: upstream: reported C repro on 2022/04/01 16:43
Reported-by: syzbot+0470bae589e3002f3870@syzkaller.appspotmail.com
First crash: 808d, last: 647d
Fix bisection: failed (error log, bisect log)
  
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in vmci_qp_broker_detach kernel C unreliable error 59 24d 1179d 0/27 upstream: reported C repro on 2021/03/26 01:19
linux-4.19 possible deadlock in vmci_qp_broker_detach C error 11 773d 1267d 0/1 upstream: reported C repro on 2020/12/28 17:12

Sample crash report:
Failed to enqueue queue_pair DETACH event datagram for context (ID=0x10)
Failed to enqueue queue_pair DETACH event datagram for context (ID=0x10)
Failed to enqueue queue_pair DETACH event datagram for context (ID=0x1)
============================================
WARNING: possible recursive locking detected
4.14.274-syzkaller #0 Not tainted
--------------------------------------------
syz-executor275/8396 is trying to acquire lock:
 (qp_broker_list.mutex){+.+.}, at: [<ffffffff839197fb>] vmci_qp_broker_detach+0x11b/0x1000 drivers/misc/vmw_vmci/vmci_queue_pair.c:2186

but task is already holding lock:
 (qp_broker_list.mutex){+.+.}, at: [<ffffffff839197fb>] vmci_qp_broker_detach+0x11b/0x1000 drivers/misc/vmw_vmci/vmci_queue_pair.c:2186

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(qp_broker_list.mutex);
  lock(qp_broker_list.mutex);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

1 lock held by syz-executor275/8396:
 #0:  (qp_broker_list.mutex){+.+.}, at: [<ffffffff839197fb>] vmci_qp_broker_detach+0x11b/0x1000 drivers/misc/vmw_vmci/vmci_queue_pair.c:2186

stack backtrace:
CPU: 1 PID: 8396 Comm: syz-executor275 Not tainted 4.14.274-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x281 lib/dump_stack.c:58
 print_deadlock_bug kernel/locking/lockdep.c:1800 [inline]
 check_deadlock kernel/locking/lockdep.c:1847 [inline]
 validate_chain kernel/locking/lockdep.c:2448 [inline]
 __lock_acquire.cold+0x180/0x97c kernel/locking/lockdep.c:3491
 lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998
 __mutex_lock_common kernel/locking/mutex.c:756 [inline]
 __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893
 vmci_qp_broker_detach+0x11b/0x1000 drivers/misc/vmw_vmci/vmci_queue_pair.c:2186
 ctx_free_ctx drivers/misc/vmw_vmci/vmci_context.c:452 [inline]
 kref_put include/linux/kref.h:70 [inline]
 vmci_ctx_put+0x487/0xbf0 drivers/misc/vmw_vmci/vmci_context.c:505
 vmci_ctx_enqueue_datagram+0x3b1/0x4b0 drivers/misc/vmw_vmci/vmci_context.c:368
 dg_dispatch_as_host drivers/misc/vmw_vmci/vmci_datagram.c:283 [inline]
 vmci_datagram_dispatch+0x2b8/0x970 drivers/misc/vmw_vmci/vmci_datagram.c:347
 qp_notify_peer+0x13b/0x1e0 drivers/misc/vmw_vmci/vmci_queue_pair.c:1575
 vmci_qp_broker_detach+0x8c2/0x1000 drivers/misc/vmw_vmci/vmci_queue_pair.c:2279
 ctx_free_ctx drivers/misc/vmw_vmci/vmci_context.c:452 [inline]
 kref_put include/linux/kref.h:70 [inline]
 vmci_ctx_put+0x487/0xbf0 drivers/misc/vmw_vmci/vmci_context.c:505
 vmci_host_close+0xf9/0x170 drivers/misc/vmw_vmci/vmci_host.c:147
 __fput+0x25f/0x7a0 fs/file_table.c:210
 task_work_run+0x11f/0x190 kernel/task_work.c:113
 exit_task_work include/linux/task_work.h:22 [inline]
 do_exit+0xa44/0x2850 kernel/exit.c:868
 do_group_exit+0x100/0x2e0 kernel/exit.c:965
 get_signal+0x38d/0x1ca0 kernel/signal.c:2412
 do_signal+0x7c/0x1550 arch/x86/kernel/signal.c:792
 exit_to_usermode_loop+0x160/0x200 arch/x86/entry/common.c:160
 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:270 [inline]
 do_syscall_64+0x4a3/0x640 arch/x86/entry/common.c:297
 entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x7f605595da09
RSP: 002b:00007f605590f308 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: 0000000000000001 RBX: 00007f60559e53e8 RCX: 00007f605595da09
RDX: 00000000000f4240 RSI: 0000000000000081 RDI: 00007f60559e53ec
RBP: 00007f60559e53e0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f60559e53ec
R13: 00007f60559b3074 R14: 636d762f7665642f R15: 0000000000022000

Crashes (7):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/04/02 00:31 linux-4.14.y af1af6ebca0e 79a2a8fc .config console log report syz C ci2-linux-4-14 possible deadlock in vmci_qp_broker_detach
2022/08/03 03:50 linux-4.14.y b641242202ed 1c9013ac .config console log report syz ci2-linux-4-14 possible deadlock in vmci_qp_broker_detach
2022/09/09 11:17 linux-4.14.y 65640c873dcf 90058bdc .config console log report info ci2-linux-4-14 possible deadlock in vmci_qp_broker_detach
2022/09/01 03:16 linux-4.14.y e548869f356f b01ec571 .config console log report info [disk image] [vmlinux] ci2-linux-4-14 possible deadlock in vmci_qp_broker_detach
2022/08/05 11:58 linux-4.14.y b641242202ed a65a7ce9 .config console log report info ci2-linux-4-14 possible deadlock in vmci_qp_broker_detach
2022/08/03 00:13 linux-4.14.y b641242202ed 1c9013ac .config console log report info ci2-linux-4-14 possible deadlock in vmci_qp_broker_detach
2022/04/01 16:42 linux-4.14.y af1af6ebca0e 79a2a8fc .config console log report info ci2-linux-4-14 possible deadlock in vmci_qp_broker_detach
* Struck through repros no longer work on HEAD.