============================================ WARNING: possible recursive locking detected 6.12.0-syzkaller-07749-g28eb75e178d3 #0 Not tainted -------------------------------------------- syz.4.919/8808 is trying to acquire lock: ffff888034dd4078 (&hdev->lock){+.+.}-{4:4}, at: mgmt_set_connectable_complete+0x143/0x330 net/bluetooth/mgmt.c:1691 but task is already holding lock: ffff888034dd4078 (&hdev->lock){+.+.}-{4:4}, at: hci_dev_close_sync+0x3ab/0x11a0 net/bluetooth/hci_sync.c:5200 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.919/8808: #0: ffff888034dd4d80 (&hdev->req_lock){+.+.}-{4:4}, at: hci_dev_do_close+0x26/0x90 net/bluetooth/hci_core.c:481 #1: ffff888034dd4078 (&hdev->lock){+.+.}-{4:4}, at: hci_dev_close_sync+0x3ab/0x11a0 net/bluetooth/hci_sync.c:5200 #2: ffff888034dd4690 (&hdev->cmd_sync_work_lock){+.+.}-{4:4}, at: hci_cmd_sync_dequeue+0x50/0x1f0 net/bluetooth/hci_sync.c:887 stack backtrace: CPU: 2 UID: 0 PID: 8808 Comm: syz.4.919 Not tainted 6.12.0-syzkaller-07749-g28eb75e178d3 #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: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_deadlock_bug+0x2e3/0x410 kernel/locking/lockdep.c:3037 check_deadlock kernel/locking/lockdep.c:3089 [inline] validate_chain kernel/locking/lockdep.c:3891 [inline] __lock_acquire+0x2117/0x3c40 kernel/locking/lockdep.c:5226 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5849 __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0x19b/0xa60 kernel/locking/mutex.c:735 mgmt_set_connectable_complete+0x143/0x330 net/bluetooth/mgmt.c:1691 _hci_cmd_sync_cancel_entry.constprop.0+0x6c/0x1d0 net/bluetooth/hci_sync.c:645 hci_cmd_sync_dequeue+0x178/0x1f0 net/bluetooth/hci_sync.c:890 cmd_complete_rsp+0x46/0x1e0 net/bluetooth/mgmt.c:1462 mgmt_pending_foreach+0xdf/0x140 net/bluetooth/mgmt_util.c:259 __mgmt_power_off+0x12a/0x2c0 net/bluetooth/mgmt.c:9534 hci_dev_close_sync+0xcbb/0x11a0 net/bluetooth/hci_sync.c:5208 hci_dev_do_close+0x2e/0x90 net/bluetooth/hci_core.c:483 hci_dev_close+0x183/0x1e0 net/bluetooth/hci_core.c:508 hci_sock_ioctl+0x28c/0x880 net/bluetooth/hci_sock.c:1128 sock_do_ioctl+0x116/0x280 net/socket.c:1209 sock_ioctl+0x228/0x6c0 net/socket.c:1328 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl fs/ioctl.c:892 [inline] __x64_sys_ioctl+0x190/0x200 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f0ae217e819 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:00007f0ae2fd5038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f0ae2335fa0 RCX: 00007f0ae217e819 RDX: 0000000000000000 RSI: 00000000400448ca RDI: 0000000000000005 RBP: 00007f0ae21f175e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f0ae2335fa0 R15: 00007ffd31524448