* [syzbot] [bluetooth?] possible deadlock in mgmt_set_connectable_complete
@ 2024-05-19 4:14 syzbot
2024-10-25 14:39 ` syzbot
0 siblings, 1 reply; 2+ messages in thread
From: syzbot @ 2024-05-19 4:14 UTC (permalink / raw)
To: johan.hedberg, linux-bluetooth, linux-kernel, luiz.dentz, marcel,
syzkaller-bugs
Hello,
syzbot found the following issue on:
HEAD commit: 1b10b390d945 Merge tag 'efi-next-for-v6.10' of git://git.k..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=15946b5c980000
kernel config: https://syzkaller.appspot.com/x/.config?x=91e885703cf9a258
dashboard link: https://syzkaller.appspot.com/bug?extid=b1752fcfa8658bb8984a
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
Unfortunately, I don't have any reproducer for this issue yet.
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/efb231af2518/disk-1b10b390.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/49c4d92714ec/vmlinux-1b10b390.xz
kernel image: https://storage.googleapis.com/syzbot-assets/73a37b1f8fbc/bzImage-1b10b390.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+b1752fcfa8658bb8984a@syzkaller.appspotmail.com
======================================================
WARNING: possible circular locking dependency detected
6.9.0-syzkaller-02713-g1b10b390d945 #0 Not tainted
------------------------------------------------------
syz-executor.0/5103 is trying to acquire lock:
ffff88805ec6c078 (&hdev->lock){+.+.}-{3:3}, at: mgmt_set_connectable_complete+0xaf/0x500 net/bluetooth/mgmt.c:1698
but task is already holding lock:
ffff88805ec6c970 (&hdev->cmd_sync_work_lock){+.+.}-{3:3}, at: hci_cmd_sync_clear+0x4e/0x220 net/bluetooth/hci_sync.c:591
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (&hdev->cmd_sync_work_lock){+.+.}-{3:3}:
lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
__mutex_lock_common kernel/locking/mutex.c:608 [inline]
__mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752
hci_cmd_sync_lookup_entry net/bluetooth/hci_sync.c:733 [inline]
hci_cmd_sync_queue_once+0x43/0x240 net/bluetooth/hci_sync.c:715
le_conn_complete_evt+0xa16/0x12f0 net/bluetooth/hci_event.c:5911
hci_le_conn_complete_evt+0x18c/0x420 net/bluetooth/hci_event.c:5922
hci_event_func net/bluetooth/hci_event.c:7544 [inline]
hci_event_packet+0xa55/0x1540 net/bluetooth/hci_event.c:7599
hci_rx_work+0x3e8/0xca0 net/bluetooth/hci_core.c:4170
process_one_work kernel/workqueue.c:3267 [inline]
process_scheduled_works+0xa12/0x17c0 kernel/workqueue.c:3348
worker_thread+0x86d/0xd70 kernel/workqueue.c:3429
kthread+0x2f2/0x390 kernel/kthread.c:389
ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
-> #0 (&hdev->lock){+.+.}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain+0x18cb/0x58e0 kernel/locking/lockdep.c:3869
__lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137
lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
__mutex_lock_common kernel/locking/mutex.c:608 [inline]
__mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752
mgmt_set_connectable_complete+0xaf/0x500 net/bluetooth/mgmt.c:1698
_hci_cmd_sync_cancel_entry net/bluetooth/hci_sync.c:578 [inline]
hci_cmd_sync_clear+0x109/0x220 net/bluetooth/hci_sync.c:593
hci_unregister_dev+0x151/0x4e0 net/bluetooth/hci_core.c:2767
vhci_release+0x83/0xd0 drivers/bluetooth/hci_vhci.c:674
__fput+0x42b/0x8a0 fs/file_table.c:422
task_work_run+0x251/0x310 kernel/task_work.c:180
exit_task_work include/linux/task_work.h:38 [inline]
do_exit+0xa1b/0x27e0 kernel/exit.c:878
do_group_exit+0x207/0x2c0 kernel/exit.c:1027
__do_sys_exit_group kernel/exit.c:1038 [inline]
__se_sys_exit_group kernel/exit.c:1036 [inline]
__x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1036
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&hdev->cmd_sync_work_lock);
lock(&hdev->lock);
lock(&hdev->cmd_sync_work_lock);
lock(&hdev->lock);
*** DEADLOCK ***
1 lock held by syz-executor.0/5103:
#0: ffff88805ec6c970 (&hdev->cmd_sync_work_lock){+.+.}-{3:3}, at: hci_cmd_sync_clear+0x4e/0x220 net/bluetooth/hci_sync.c:591
stack backtrace:
CPU: 0 PID: 5103 Comm: syz-executor.0 Not tainted 6.9.0-syzkaller-02713-g1b10b390d945 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2187
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain+0x18cb/0x58e0 kernel/locking/lockdep.c:3869
__lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137
lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
__mutex_lock_common kernel/locking/mutex.c:608 [inline]
__mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752
mgmt_set_connectable_complete+0xaf/0x500 net/bluetooth/mgmt.c:1698
_hci_cmd_sync_cancel_entry net/bluetooth/hci_sync.c:578 [inline]
hci_cmd_sync_clear+0x109/0x220 net/bluetooth/hci_sync.c:593
hci_unregister_dev+0x151/0x4e0 net/bluetooth/hci_core.c:2767
vhci_release+0x83/0xd0 drivers/bluetooth/hci_vhci.c:674
__fput+0x42b/0x8a0 fs/file_table.c:422
task_work_run+0x251/0x310 kernel/task_work.c:180
exit_task_work include/linux/task_work.h:38 [inline]
do_exit+0xa1b/0x27e0 kernel/exit.c:878
do_group_exit+0x207/0x2c0 kernel/exit.c:1027
__do_sys_exit_group kernel/exit.c:1038 [inline]
__se_sys_exit_group kernel/exit.c:1036 [inline]
__x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1036
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f1a13e7dd69
Code: Unable to access opcode bytes at 0x7f1a13e7dd3f.
RSP: 002b:00007fff56cde9a8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 00007f1a13ec935b RCX: 00007f1a13e7dd69
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000005 R08: 00007fff56cdc747 R09: 00007fff56cdfc60
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fff56cdfc60
R13: 00007f1a13ec9336 R14: 000000000001dab1 R15: 0000000000000005
</TASK>
syz-executor.0 (5103) used greatest stack depth: 18064 bytes left
---
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 syzkaller@googlegroups.com.
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title
If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [syzbot] [bluetooth?] possible deadlock in mgmt_set_connectable_complete
2024-05-19 4:14 [syzbot] [bluetooth?] possible deadlock in mgmt_set_connectable_complete syzbot
@ 2024-10-25 14:39 ` syzbot
0 siblings, 0 replies; 2+ messages in thread
From: syzbot @ 2024-10-25 14:39 UTC (permalink / raw)
To: johan.hedberg, linux-bluetooth, linux-kernel, luiz.dentz, marcel,
syzkaller-bugs
syzbot has found a reproducer for the following issue on:
HEAD commit: ae90f6a6170d Merge tag 'bpf-fixes' of git://git.kernel.org..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=10bc8230580000
kernel config: https://syzkaller.appspot.com/x/.config?x=309bb816d40abc28
dashboard link: https://syzkaller.appspot.com/bug?extid=b1752fcfa8658bb8984a
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11fab287980000
Downloadable assets:
disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/7feb34a89c2a/non_bootable_disk-ae90f6a6.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/c242e171fdc8/vmlinux-ae90f6a6.xz
kernel image: https://storage.googleapis.com/syzbot-assets/a180678c27b3/bzImage-ae90f6a6.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/2fbc68333ee1/mount_0.gz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+b1752fcfa8658bb8984a@syzkaller.appspotmail.com
============================================
WARNING: possible recursive locking detected
6.12.0-rc4-syzkaller-00161-gae90f6a6170d #0 Not tainted
--------------------------------------------
syz.4.19/5588 is trying to acquire lock:
ffff888058a28078 (&hdev->lock){+.+.}-{3:3}, at: mgmt_set_connectable_complete+0xaf/0x500 net/bluetooth/mgmt.c:1690
but task is already holding lock:
ffff888058a28078 (&hdev->lock){+.+.}-{3:3}, at: hci_dev_close_sync+0x5c8/0x11c0 net/bluetooth/hci_sync.c:5189
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----
lock(&hdev->lock);
lock(&hdev->lock);
*** DEADLOCK ***
May be due to missing lock nesting notation
3 locks held by syz.4.19/5588:
#0: ffff888058a28d80 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close net/bluetooth/hci_core.c:481 [inline]
#0: ffff888058a28d80 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_close+0x10a/0x210 net/bluetooth/hci_core.c:508
#1: ffff888058a28078 (&hdev->lock){+.+.}-{3:3}, at: hci_dev_close_sync+0x5c8/0x11c0 net/bluetooth/hci_sync.c:5189
#2: ffff888058a28690 (&hdev->cmd_sync_work_lock){+.+.}-{3:3}, at: hci_cmd_sync_dequeue+0x44/0x3d0 net/bluetooth/hci_sync.c:883
stack backtrace:
CPU: 0 UID: 0 PID: 5588 Comm: syz.4.19 Not tainted 6.12.0-rc4-syzkaller-00161-gae90f6a6170d #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
print_deadlock_bug+0x483/0x620 kernel/locking/lockdep.c:3037
check_deadlock kernel/locking/lockdep.c:3089 [inline]
validate_chain+0x15e2/0x5920 kernel/locking/lockdep.c:3891
__lock_acquire+0x1384/0x2050 kernel/locking/lockdep.c:5202
lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825
__mutex_lock_common kernel/locking/mutex.c:608 [inline]
__mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752
mgmt_set_connectable_complete+0xaf/0x500 net/bluetooth/mgmt.c:1690
_hci_cmd_sync_cancel_entry net/bluetooth/hci_sync.c:641 [inline]
hci_cmd_sync_dequeue+0x22b/0x3d0 net/bluetooth/hci_sync.c:886
cmd_complete_rsp+0x4c/0x180 net/bluetooth/mgmt.c:1461
mgmt_pending_foreach+0xd1/0x130 net/bluetooth/mgmt_util.c:259
__mgmt_power_off+0x183/0x430 net/bluetooth/mgmt.c:9474
hci_dev_close_sync+0x6c4/0x11c0 net/bluetooth/hci_sync.c:5197
hci_dev_do_close net/bluetooth/hci_core.c:483 [inline]
hci_dev_close+0x112/0x210 net/bluetooth/hci_core.c:508
sock_do_ioctl+0x158/0x460 net/socket.c:1227
sock_ioctl+0x626/0x8e0 net/socket.c:1346
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:907 [inline]
__se_sys_ioctl+0xf9/0x170 fs/ioctl.c:893
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f404e97e719
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f404e3ff038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f404eb35f80 RCX: 00007f404e97e719
RDX: 0000000000000000 RSI: 00000000400448ca RDI: 0000000000000005
RBP: 00007f404e9f132e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f404eb35f80 R15: 00007ffde86e4688
</TASK>
---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-10-25 14:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-19 4:14 [syzbot] [bluetooth?] possible deadlock in mgmt_set_connectable_complete syzbot
2024-10-25 14:39 ` syzbot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox