possible deadlock in vmci_qp_broker_detach

5 weergaven
Naar het eerste ongelezen bericht

syzbot

ongelezen,
1 apr 2022, 12:43:2301-04-2022
aan syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: af1af6ebca0e Linux 4.14.274
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=14ee182d700000
kernel config: https://syzkaller.appspot.com/x/.config?x=425e8e4e86f35eba
dashboard link: https://syzkaller.appspot.com/bug?extid=0470bae589e3002f3870
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)

Unfortunately, I don't have any reproducer for this issue yet.

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+0470ba...@syzkaller.appspotmail.com

============================================
WARNING: possible recursive locking detected
4.14.274-syzkaller #0 Not tainted
--------------------------------------------
syz-executor.3/10621 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-executor.3/10621:
#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: 0 PID: 10621 Comm: syz-executor.3 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
tracehook_notify_resume include/linux/tracehook.h:191 [inline]
exit_to_usermode_loop+0x1ad/0x200 arch/x86/entry/common.c:164
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:0x7f36b5070049
RSP: 002b:00007f36b39e5168 EFLAGS: 00000246 ORIG_RAX: 0000000000000021
RAX: 0000000000000004 RBX: 00007f36b5182f60 RCX: 00007f36b5070049
RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000003
RBP: 00007f36b50ca08d R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffc24d1614f R14: 00007f36b39e5300 R15: 0000000000022000


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

ongelezen,
1 apr 2022, 20:32:1901-04-2022
aan syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: af1af6ebca0e Linux 4.14.274
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=13760d4b700000
kernel config: https://syzkaller.appspot.com/x/.config?x=425e8e4e86f35eba
dashboard link: https://syzkaller.appspot.com/bug?extid=0470bae589e3002f3870
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1393854b700000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=161e036b700000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+0470ba...@syzkaller.appspotmail.com

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
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

Allen beantwoorden
Auteur beantwoorden
Doorsturen
0 nieuwe berichten