syzbot


possible deadlock in vmci_qp_broker_detach

Status: upstream: reported C repro on 2020/12/28 17:12
Reported-by: syzbot+64f8547f17b299a45517@syzkaller.appspotmail.com
First crash: 1270d, last: 777d
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 28d 1183d 0/27 upstream: reported C repro on 2021/03/26 01:19
linux-4.14 possible deadlock in vmci_qp_broker_detach C error 7 651d 811d 0/1 upstream: reported C repro on 2022/04/01 16:43
Fix bisection attempts (4)
Created Duration User Patch Repo Result
2021/11/02 09:05 12m bisect fix linux-4.19.y error job log (0)
2021/10/03 08:33 31m bisect fix linux-4.19.y job log (0) log
2021/08/07 18:33 34m bisect fix linux-4.19.y job log (0) log
2021/05/13 06:00 27m bisect fix linux-4.19.y job log (0) log

Sample crash report:
Failed to enqueue queue_pair DETACH event datagram for context (ID=0x1)
============================================
WARNING: possible recursive locking detected
4.19.191-syzkaller #0 Not tainted
--------------------------------------------
syz-executor298/12417 is trying to acquire lock:
000000001f08d6b7 (qp_broker_list.mutex){+.+.}, at: vmci_qp_broker_detach+0x147/0x11b0 drivers/misc/vmw_vmci/vmci_queue_pair.c:2099

but task is already holding lock:
000000001f08d6b7 (qp_broker_list.mutex){+.+.}, at: vmci_qp_broker_detach+0x147/0x11b0 drivers/misc/vmw_vmci/vmci_queue_pair.c:2099

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-executor298/12417:
 #0: 000000001f08d6b7 (qp_broker_list.mutex){+.+.}, at: vmci_qp_broker_detach+0x147/0x11b0 drivers/misc/vmw_vmci/vmci_queue_pair.c:2099

stack backtrace:
CPU: 0 PID: 12417 Comm: syz-executor298 Not tainted 4.19.191-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+0x1fc/0x2ef lib/dump_stack.c:118
 print_deadlock_bug kernel/locking/lockdep.c:1764 [inline]
 check_deadlock kernel/locking/lockdep.c:1808 [inline]
 validate_chain kernel/locking/lockdep.c:2404 [inline]
 __lock_acquire.cold+0x121/0x57e kernel/locking/lockdep.c:3416
 lock_acquire+0x170/0x3c0 kernel/locking/lockdep.c:3908
 __mutex_lock_common kernel/locking/mutex.c:928 [inline]
 __mutex_lock+0xd7/0x1260 kernel/locking/mutex.c:1075
 vmci_qp_broker_detach+0x147/0x11b0 drivers/misc/vmw_vmci/vmci_queue_pair.c:2099
 ctx_free_ctx drivers/misc/vmw_vmci/vmci_context.c:452 [inline]
 kref_put include/linux/kref.h:70 [inline]
 vmci_ctx_put+0x55a/0xd60 drivers/misc/vmw_vmci/vmci_context.c:505
 vmci_ctx_enqueue_datagram+0x3f7/0x500 drivers/misc/vmw_vmci/vmci_context.c:368
 dg_dispatch_as_host drivers/misc/vmw_vmci/vmci_datagram.c:283 [inline]
 vmci_datagram_dispatch+0x39b/0xb40 drivers/misc/vmw_vmci/vmci_datagram.c:347
 qp_notify_peer+0x182/0x260 drivers/misc/vmw_vmci/vmci_queue_pair.c:1488
 vmci_qp_broker_detach+0xa09/0x11b0 drivers/misc/vmw_vmci/vmci_queue_pair.c:2192
 ctx_free_ctx drivers/misc/vmw_vmci/vmci_context.c:452 [inline]
 kref_put include/linux/kref.h:70 [inline]
 vmci_ctx_put+0x55a/0xd60 drivers/misc/vmw_vmci/vmci_context.c:505
 vmci_host_close+0x116/0x1a0 drivers/misc/vmw_vmci/vmci_host.c:147
 __fput+0x2ce/0x890 fs/file_table.c:278
 task_work_run+0x148/0x1c0 kernel/task_work.c:113
 exit_task_work include/linux/task_work.h:22 [inline]
 do_exit+0xbf3/0x2be0 kernel/exit.c:870
 do_group_exit+0x125/0x310 kernel/exit.c:967
 __do_sys_exit_group kernel/exit.c:978 [inline]
 __se_sys_exit_group kernel/exit.c:976 [inline]
 __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:976
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x43e9f9
Code: Bad RIP value.
RSP: 002b:00007fffd0467a28 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 00000000004b02f0 RCX: 000000000043e9f9
RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000000
RBP: 0000000000000000 R08: ffffffffffffffc0 R09: 0000000000000001
R10: 0000000000000001 R11: 0000000000000246 R12: 00000000004b02f0
R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000001

Crashes (11):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/05/24 04:50 linux-4.19.y 1e986fe9ad15 3c7fef33 .config console log report syz C ci2-linux-4-19 possible deadlock in vmci_qp_broker_detach
2021/04/13 03:04 linux-4.19.y 830a059cbba6 6a81331a .config console log report syz C ci2-linux-4-19 possible deadlock in vmci_qp_broker_detach
2022/04/02 02:32 linux-4.19.y 3f8a27f9e27b 79a2a8fc .config console log report syz ci2-linux-4-19 possible deadlock in vmci_qp_broker_detach
2021/06/14 12:46 linux-4.19.y 9a2dc0e6c531 1ba81399 .config console log report syz ci2-linux-4-19 possible deadlock in vmci_qp_broker_detach
2022/05/06 06:11 linux-4.19.y 3f8a27f9e27b efeff0a5 .config console log report info ci2-linux-4-19 possible deadlock in vmci_qp_broker_detach
2022/03/22 21:26 linux-4.19.y 3f8a27f9e27b d88ef0c5 .config console log report info ci2-linux-4-19 possible deadlock in vmci_qp_broker_detach
2021/09/03 08:33 linux-4.19.y b172b44fcb17 f62a5829 .config console log report info ci2-linux-4-19 possible deadlock in vmci_qp_broker_detach
2021/08/16 11:59 linux-4.19.y 59456c9cc40c 6652437d .config console log report info ci2-linux-4-19 possible deadlock in vmci_qp_broker_detach
2021/07/08 18:33 linux-4.19.y 9f84340f012e 1b20171a .config console log report info ci2-linux-4-19 possible deadlock in vmci_qp_broker_detach
2021/04/13 01:48 linux-4.19.y 830a059cbba6 6a81331a .config console log report info ci2-linux-4-19 possible deadlock in vmci_qp_broker_detach
2020/12/28 17:11 linux-4.19.y 13d2ce42de8c 8259d56c .config console log report info ci2-linux-4-19
* Struck through repros no longer work on HEAD.