====================================================== WARNING: possible circular locking dependency detected 6.10.0-syzkaller-08676-g720261cfc732 #0 Not tainted ------------------------------------------------------ kworker/u33:1/4645 is trying to acquire lock: ffff88802bef0258 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1607 [inline] ffff88802bef0258 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_conn_ready net/bluetooth/sco.c:1290 [inline] ffff88802bef0258 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_connect_cfm+0x466/0xbd0 net/bluetooth/sco.c:1362 but task is already holding lock: ffff888046622820 (&conn->lock#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline] ffff888046622820 (&conn->lock#2){+.+.}-{2:2}, at: sco_conn_ready net/bluetooth/sco.c:1277 [inline] ffff888046622820 (&conn->lock#2){+.+.}-{2:2}, at: sco_connect_cfm+0x2d1/0xbd0 net/bluetooth/sco.c:1362 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&conn->lock#2){+.+.}-{2:2}: __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] sco_chan_add net/bluetooth/sco.c:234 [inline] sco_connect net/bluetooth/sco.c:287 [inline] sco_sock_connect+0x3a1/0xb10 net/bluetooth/sco.c:596 __sys_connect_file+0x15f/0x1a0 net/socket.c:2061 __sys_connect+0x149/0x170 net/socket.c:2078 __do_sys_connect net/socket.c:2088 [inline] __se_sys_connect net/socket.c:2085 [inline] __ia32_sys_connect+0x71/0xb0 net/socket.c:2085 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e -> #0 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}: check_prev_add kernel/locking/lockdep.c:3133 [inline] check_prevs_add kernel/locking/lockdep.c:3252 [inline] validate_chain kernel/locking/lockdep.c:3868 [inline] __lock_acquire+0x24ed/0x3cb0 kernel/locking/lockdep.c:5142 lock_acquire kernel/locking/lockdep.c:5759 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5724 lock_sock_nested+0x3a/0xf0 net/core/sock.c:3543 lock_sock include/net/sock.h:1607 [inline] sco_conn_ready net/bluetooth/sco.c:1290 [inline] sco_connect_cfm+0x466/0xbd0 net/bluetooth/sco.c:1362 hci_connect_cfm include/net/bluetooth/hci_core.h:1965 [inline] hci_sync_conn_complete_evt+0x3a1/0xa10 net/bluetooth/hci_event.c:5008 hci_event_func net/bluetooth/hci_event.c:7445 [inline] hci_event_packet+0x9eb/0x1190 net/bluetooth/hci_event.c:7497 hci_rx_work+0x2c6/0x1610 net/bluetooth/hci_core.c:4029 process_one_work+0x958/0x1ad0 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf20 kernel/workqueue.c:3390 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&conn->lock#2); lock(sk_lock-AF_BLUETOOTH-BTPROTO_SCO); lock(&conn->lock#2); lock(sk_lock-AF_BLUETOOTH-BTPROTO_SCO); *** DEADLOCK *** 5 locks held by kworker/u33:1/4645: #0: ffff888050133948 ((wq_completion)hci1#2){+.+.}-{0:0}, at: process_one_work+0x11f0/0x1ad0 kernel/workqueue.c:3206 #1: ffffc900272b7d80 ((work_completion)(&hdev->rx_work)){+.+.}-{0:0}, at: process_one_work+0x8bb/0x1ad0 kernel/workqueue.c:3207 #2: ffff88806767c078 (&hdev->lock){+.+.}-{3:3}, at: hci_sync_conn_complete_evt+0x118/0xa10 net/bluetooth/hci_event.c:4925 #3: ffffffff8f9b1688 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_connect_cfm include/net/bluetooth/hci_core.h:1962 [inline] #3: ffffffff8f9b1688 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_sync_conn_complete_evt+0x336/0xa10 net/bluetooth/hci_event.c:5008 #4: ffff888046622820 (&conn->lock#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline] #4: ffff888046622820 (&conn->lock#2){+.+.}-{2:2}, at: sco_conn_ready net/bluetooth/sco.c:1277 [inline] #4: ffff888046622820 (&conn->lock#2){+.+.}-{2:2}, at: sco_connect_cfm+0x2d1/0xbd0 net/bluetooth/sco.c:1362 stack backtrace: CPU: 3 PID: 4645 Comm: kworker/u33:1 Not tainted 6.10.0-syzkaller-08676-g720261cfc732 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Workqueue: hci1 hci_rx_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 check_noncircular+0x31a/0x400 kernel/locking/lockdep.c:2186 check_prev_add kernel/locking/lockdep.c:3133 [inline] check_prevs_add kernel/locking/lockdep.c:3252 [inline] validate_chain kernel/locking/lockdep.c:3868 [inline] __lock_acquire+0x24ed/0x3cb0 kernel/locking/lockdep.c:5142 lock_acquire kernel/locking/lockdep.c:5759 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5724 lock_sock_nested+0x3a/0xf0 net/core/sock.c:3543 lock_sock include/net/sock.h:1607 [inline] sco_conn_ready net/bluetooth/sco.c:1290 [inline] sco_connect_cfm+0x466/0xbd0 net/bluetooth/sco.c:1362 hci_connect_cfm include/net/bluetooth/hci_core.h:1965 [inline] hci_sync_conn_complete_evt+0x3a1/0xa10 net/bluetooth/hci_event.c:5008 hci_event_func net/bluetooth/hci_event.c:7445 [inline] hci_event_packet+0x9eb/0x1190 net/bluetooth/hci_event.c:7497 hci_rx_work+0x2c6/0x1610 net/bluetooth/hci_core.c:4029 process_one_work+0x958/0x1ad0 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf20 kernel/workqueue.c:3390 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 BUG: sleeping function called from invalid context at net/core/sock.c:3545 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 4645, name: kworker/u33:1 preempt_count: 1, expected: 0 RCU nest depth: 0, expected: 0 INFO: lockdep is turned off. Preemption disabled at: [<0000000000000000>] 0x0 CPU: 3 PID: 4645 Comm: kworker/u33:1 Not tainted 6.10.0-syzkaller-08676-g720261cfc732 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Workqueue: hci1 hci_rx_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x16c/0x1f0 lib/dump_stack.c:114 __might_resched+0x3c0/0x5e0 kernel/sched/core.c:8437 lock_sock_nested+0x4b/0xf0 net/core/sock.c:3545 lock_sock include/net/sock.h:1607 [inline] sco_conn_ready net/bluetooth/sco.c:1290 [inline] sco_connect_cfm+0x466/0xbd0 net/bluetooth/sco.c:1362 hci_connect_cfm include/net/bluetooth/hci_core.h:1965 [inline] hci_sync_conn_complete_evt+0x3a1/0xa10 net/bluetooth/hci_event.c:5008 hci_event_func net/bluetooth/hci_event.c:7445 [inline] hci_event_packet+0x9eb/0x1190 net/bluetooth/hci_event.c:7497 hci_rx_work+0x2c6/0x1610 net/bluetooth/hci_core.c:4029 process_one_work+0x958/0x1ad0 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf20 kernel/workqueue.c:3390 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244