syzbot


possible deadlock in vmci_qp_broker_detach

Status: upstream: reported C repro on 2021/03/26 01:19
Reported-by: syzbot+44e40ac2cfe68e8ce207@syzkaller.appspotmail.com
First crash: 555d, last: 7d20h

Cause bisection: introduced by (bisect log) [no-op commit]:
commit 2dd209f00fc5a1caafa493066c7cd692fd2fd57c
Author: Bart Van Assche <bvanassche@acm.org>
Date: Tue Mar 10 04:26:16 2020 +0000

  blk-mq: Fix a comment in include/linux/blk-mq.h

Crash: possible deadlock in vmci_qp_broker_detach (log)
Repro: syz .config
similar bugs (2):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 possible deadlock in vmci_qp_broker_detach C error 7 19d 180d 0/1 upstream: reported C repro on 2022/04/01 16:43
linux-4.19 possible deadlock in vmci_qp_broker_detach C error 11 145d 639d 0/1 upstream: reported C repro on 2020/12/28 17:12
Patch testing requests:
Created Duration User Patch Repo Result
2021/06/30 22:00 19m paskripkin@gmail.com patch upstream report log
2021/06/30 21:36 19m paskripkin@gmail.com patch upstream report log

Sample crash report:
============================================
WARNING: possible recursive locking detected
5.16.0-rc7-syzkaller #0 Not tainted
--------------------------------------------
syz-executor146/28353 is trying to acquire lock:
ffffffff8c6d27f8 (qp_broker_list.mutex){+.+.}-{3:3}, at: vmci_qp_broker_detach+0x147/0x11b0 drivers/misc/vmw_vmci/vmci_queue_pair.c:2093

but task is already holding lock:
ffffffff8c6d27f8 (qp_broker_list.mutex){+.+.}-{3:3}, at: vmci_qp_broker_detach+0x147/0x11b0 drivers/misc/vmw_vmci/vmci_queue_pair.c:2093

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-executor146/28353:
 #0: ffffffff8c6d27f8 (qp_broker_list.mutex){+.+.}-{3:3}, at: vmci_qp_broker_detach+0x147/0x11b0 drivers/misc/vmw_vmci/vmci_queue_pair.c:2093

stack backtrace:
CPU: 1 PID: 28353 Comm: syz-executor146 Not tainted 5.16.0-rc7-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 print_deadlock_bug kernel/locking/lockdep.c:2956 [inline]
 check_deadlock kernel/locking/lockdep.c:2999 [inline]
 validate_chain kernel/locking/lockdep.c:3788 [inline]
 __lock_acquire.cold+0x149/0x3ab kernel/locking/lockdep.c:5027
 lock_acquire kernel/locking/lockdep.c:5637 [inline]
 lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5602
 __mutex_lock_common kernel/locking/mutex.c:607 [inline]
 __mutex_lock+0x12f/0x12f0 kernel/locking/mutex.c:740
 vmci_qp_broker_detach+0x147/0x11b0 drivers/misc/vmw_vmci/vmci_queue_pair.c:2093
 ctx_free_ctx+0x4cc/0xd30 drivers/misc/vmw_vmci/vmci_context.c:444
 kref_put include/linux/kref.h:65 [inline]
 vmci_ctx_put drivers/misc/vmw_vmci/vmci_context.c:497 [inline]
 vmci_ctx_enqueue_datagram+0x4dc/0x620 drivers/misc/vmw_vmci/vmci_context.c:360
 dg_dispatch_as_host drivers/misc/vmw_vmci/vmci_datagram.c:275 [inline]
 vmci_datagram_dispatch+0x39b/0xb50 drivers/misc/vmw_vmci/vmci_datagram.c:339
 qp_notify_peer+0x182/0x260 drivers/misc/vmw_vmci/vmci_queue_pair.c:1479
 vmci_qp_broker_detach+0xa09/0x11b0 drivers/misc/vmw_vmci/vmci_queue_pair.c:2186
 ctx_free_ctx+0x4cc/0xd30 drivers/misc/vmw_vmci/vmci_context.c:444
 kref_put include/linux/kref.h:65 [inline]
 vmci_ctx_put drivers/misc/vmw_vmci/vmci_context.c:497 [inline]
 vmci_ctx_destroy+0x169/0x1d0 drivers/misc/vmw_vmci/vmci_context.c:195
 vmci_host_close+0x116/0x1a0 drivers/misc/vmw_vmci/vmci_host.c:143
 __fput+0x286/0x9f0 fs/file_table.c:280
 task_work_run+0xdd/0x1a0 kernel/task_work.c:164
 exit_task_work include/linux/task_work.h:32 [inline]
 do_exit+0xc14/0x2b40 kernel/exit.c:832
 do_group_exit+0x125/0x310 kernel/exit.c:929
 get_signal+0x47d/0x2220 kernel/signal.c:2852
 arch_do_signal_or_restart+0x2a9/0x1c40 arch/x86/kernel/signal.c:868
 handle_signal_work kernel/entry/common.c:148 [inline]
 exit_to_user_mode_loop kernel/entry/common.c:172 [inline]
 exit_to_user_mode_prepare+0x17d/0x290 kernel/entry/common.c:207
 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline]
 syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300
 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f81291eea29
Code: Unable to access opcode bytes at RIP 0x7f81291ee9ff.
RSP: 002b:00007f81291a0308 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: 0000000000000001 RBX: 00007f81292763e8 RCX: 00007f81291eea29
RDX: 00000000000f4240 RSI: 0000000000000081 RDI: 00007f81292763ec
RBP: 00007f81292763e0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f81292763ec
R13: 00007f8129244074 R14: 636d762f7665642f R15: 0000000000022000
 </TASK>

Fix bisection attempts:
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-root 2022/04/22 14:27 upstream d569e86915b7 6cc879d4 .config log report syz C
ci-upstream-kasan-gce-root 2022/03/16 16:32 upstream 56e337f2cf13 6cc879d4 .config log report syz C
ci-upstream-kasan-gce 2021/11/19 10:31 upstream 4c388a8e740d 9a4781d4 .config log report syz
ci-upstream-kasan-gce 2021/10/16 15:17 upstream 8fe31e0995f0 9a4781d4 .config log report syz
ci-upstream-kasan-gce 2021/08/28 20:37 upstream 3f5ad13cb012 9a4781d4 .config log report syz
* Struck through repros no longer work on HEAD.
Crashes (47):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-root 2021/12/29 18:11 upstream e7c124bd0463 6cc879d4 .config log report syz C possible deadlock in vmci_qp_broker_detach
ci-upstream-linux-next-kasan-gce-root 2022/07/25 20:55 linux-next cb71b93c2dc3 664c519c .config log report syz C possible deadlock in vmci_qp_broker_detach
ci-upstream-linux-next-kasan-gce-root 2022/07/20 13:39 linux-next cb71b93c2dc3 775344bc .config log report syz C possible deadlock in vmci_qp_broker_detach
ci-upstream-linux-next-kasan-gce-root 2022/02/09 13:55 linux-next ef6b35306dd8 0b33604d .config log report syz C possible deadlock in vmci_qp_broker_detach
ci-upstream-linux-next-kasan-gce-root 2021/06/30 17:21 linux-next a1f92694393a 84fd4c77 .config log report syz C possible deadlock in vmci_qp_broker_detach
ci-upstream-kasan-gce 2021/07/29 05:14 upstream 4010a528219e 9a4781d4 .config log report syz possible deadlock in vmci_qp_broker_detach
ci-upstream-kasan-gce 2021/07/03 06:42 upstream 3dbdb38e2869 55aa55c2 .config log report syz possible deadlock in vmci_qp_broker_detach
ci-upstream-kasan-gce 2021/04/14 15:29 upstream 50987beca096 3134b37f .config log report syz possible deadlock in vmci_qp_broker_detach
ci-upstream-kasan-gce-smack-root 2021/04/12 17:28 upstream d434405aaab7 bfeda1b1 .config log report syz possible deadlock in vmci_qp_broker_detach
ci-upstream-linux-next-kasan-gce-root 2021/05/18 09:33 linux-next cd557f1c605f a343ba6b .config log report syz possible deadlock in vmci_qp_broker_detach
ci-upstream-kasan-gce-smack-root 2022/09/20 23:30 upstream 60891ec99e14 c4b8ccfd .config log report info possible deadlock in vmci_qp_broker_detach
ci-upstream-kasan-gce 2022/08/18 20:34 upstream 3b06a2755758 26a13b38 .config log report info possible deadlock in vmci_qp_broker_detach
ci-upstream-kasan-gce 2022/07/16 19:06 upstream c658cabbfd32 95cb00d1 .config log report info possible deadlock in vmci_qp_broker_detach
ci-upstream-kasan-gce-smack-root 2022/07/06 16:17 upstream e35e5b6f695d bff65f44 .config log report info possible deadlock in vmci_qp_broker_detach
ci-upstream-kasan-gce 2022/06/06 13:14 upstream f2906aa86338 c8857892 .config log report info possible deadlock in vmci_qp_broker_detach
ci-upstream-kasan-gce 2022/04/22 15:48 upstream d569e86915b7 131df97d .config log report info possible deadlock in vmci_qp_broker_detach
ci-qemu-upstream 2022/03/23 13:53 upstream 6b1f86f8e9c7 5ff41e94 .config log report info possible deadlock in vmci_qp_broker_detach
ci-qemu-upstream 2022/03/22 23:15 upstream 519129040766 5ff41e94 .config log report info possible deadlock in vmci_qp_broker_detach
ci-upstream-kasan-gce 2022/02/01 09:55 upstream 26291c54e111 c1c1631d .config log report info possible deadlock in vmci_qp_broker_detach
ci-upstream-kasan-gce-root 2021/12/14 14:53 upstream 5472f14a3742 d018dd31 .config log report info possible deadlock in vmci_qp_broker_detach
ci-upstream-kasan-gce-selinux-root 2021/09/08 11:36 upstream ac08b1c68d1b e2776ee4 .config log report info possible deadlock in vmci_qp_broker_detach
ci-upstream-kasan-gce-selinux-root 2021/06/29 15:48 upstream 233a806b00e3 9d2ab5df .config log report info possible deadlock in vmci_qp_broker_detach
ci-upstream-kasan-gce-selinux-root 2021/06/10 03:04 upstream cd1245d75ce9 1ba81399 .config log report info possible deadlock in vmci_qp_broker_detach
ci-upstream-kasan-gce-selinux-root 2021/05/19 22:37 upstream 293837b9ac8d a343ba6b .config log report info possible deadlock in vmci_qp_broker_detach
ci-upstream-kasan-gce 2021/05/17 08:59 upstream d07f6ca923ea a2eb125d .config log report info possible deadlock in vmci_qp_broker_detach
ci-upstream-kasan-gce-selinux-root 2021/04/24 01:59 upstream e77a830c8297 17f0b706 .config log report info possible deadlock in vmci_qp_broker_detach
ci-upstream-kasan-gce 2021/04/14 11:37 upstream 50987beca096 3134b37f .config log report info possible deadlock in vmci_qp_broker_detach
ci-upstream-kasan-gce-smack-root 2021/04/12 16:01 upstream d434405aaab7 bfeda1b1 .config log report info possible deadlock in vmci_qp_broker_detach
ci-upstream-kasan-gce 2021/03/31 10:37 upstream 2bb25b3a748a 6a81331a .config log report info possible deadlock in vmci_qp_broker_detach
ci-upstream-kasan-gce 2021/03/22 01:14 upstream 5ee96fa9dd78 bea32f74 .config log report info possible deadlock in vmci_qp_broker_detach
ci-upstream-kasan-gce-386 2022/07/26 04:01 upstream e0dccc3b76fb 34795c51 .config log report info possible deadlock in vmci_qp_broker_detach
ci-upstream-kasan-gce-386 2022/06/15 04:23 upstream 018ab4fabddd 127d1faf .config log report info possible deadlock in vmci_qp_broker_detach
ci-upstream-kasan-gce-386 2022/05/22 08:46 upstream eaea45fc0e7b 7268fa62 .config log report info possible deadlock in vmci_qp_broker_detach
ci-upstream-kasan-gce-386 2022/04/25 07:46 upstream af2d861d4cd2 c889aef9 .config log report info possible deadlock in vmci_qp_broker_detach
ci-upstream-kasan-gce-386 2022/02/14 14:30 upstream 754e0b0e3560 8b9ca619 .config log report info possible deadlock in vmci_qp_broker_detach
ci-upstream-kasan-gce-386 2022/01/22 16:51 upstream 0809edbae347 214351e1 .config log report info possible deadlock in vmci_qp_broker_detach
ci-upstream-kasan-gce-386 2021/12/20 08:05 upstream a7904a538933 021b36cb .config log report info possible deadlock in vmci_qp_broker_detach
ci-qemu-upstream-386 2021/10/20 09:58 upstream d9abdee5fd5a 418a00eb .config log report info possible deadlock in vmci_qp_broker_detach
ci-upstream-kasan-gce-386 2021/10/17 10:02 upstream d999ade1cc86 0c5d9412 .config log report info possible deadlock in vmci_qp_broker_detach
ci-qemu-upstream-386 2021/06/15 21:38 upstream 94f0b2d4a1d0 990d3cbe .config log report info possible deadlock in vmci_qp_broker_detach
ci-qemu-upstream-386 2021/05/14 20:08 upstream bd3c9cdb21a2 8bdd5343 .config log report info possible deadlock in vmci_qp_broker_detach
ci-upstream-linux-next-kasan-gce-root 2022/06/15 06:49 linux-next 6012273897fe 127d1faf .config log report info possible deadlock in vmci_qp_broker_detach
ci-upstream-linux-next-kasan-gce-root 2021/12/29 12:16 linux-next ea586a076e8a 6cc879d4 .config log report info possible deadlock in vmci_qp_broker_detach
ci-upstream-linux-next-kasan-gce-root 2021/12/22 03:22 linux-next 07f8c60fe60f 6caa12e4 .config log report info possible deadlock in vmci_qp_broker_detach
ci-upstream-linux-next-kasan-gce-root 2021/09/16 14:44 linux-next 368847b165bb aae492f2 .config log report info possible deadlock in vmci_qp_broker_detach
ci-upstream-linux-next-kasan-gce-root 2021/06/30 09:34 linux-next a1f92694393a 84fd4c77 .config log report info possible deadlock in vmci_qp_broker_detach
ci-upstream-linux-next-kasan-gce-root 2021/05/17 21:55 linux-next cd557f1c605f a343ba6b .config log report info possible deadlock in vmci_qp_broker_detach
* Struck through repros no longer work on HEAD.