Bluetooth: hci2: unexpected event 0x03 length: 17 > 11
======================================================
WARNING: possible circular locking dependency detected
6.13.0-syzkaller-05252-gbc8198dc7ebc #0 Not tainted
------------------------------------------------------
kworker/u33:0/66 is trying to acquire lock:
ffff888012d76258 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1624 [inline]
ffff888012d76258 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_conn_ready net/bluetooth/sco.c:1341 [inline]
ffff888012d76258 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_connect_cfm+0x416/0xbc0 net/bluetooth/sco.c:1415
but task is already holding lock:
ffff888025950e20 (&conn->lock#2){+.+.}-{3:3}, at: spin_lock include/linux/spinlock.h:351 [inline]
ffff888025950e20 (&conn->lock#2){+.+.}-{3:3}, at: sco_conn_ready net/bluetooth/sco.c:1328 [inline]
ffff888025950e20 (&conn->lock#2){+.+.}-{3:3}, at: sco_connect_cfm+0x281/0xbc0 net/bluetooth/sco.c:1415
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (&conn->lock#2){+.+.}-{3:3}:
__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:292 [inline]
sco_connect net/bluetooth/sco.c:348 [inline]
sco_sock_connect+0x3b7/0xcc0 net/bluetooth/sco.c:648
__sys_connect_file+0x13e/0x1a0 net/socket.c:2040
__sys_connect+0x14f/0x170 net/socket.c:2059
__do_sys_connect net/socket.c:2065 [inline]
__se_sys_connect net/socket.c:2062 [inline]
__ia32_sys_connect+0x71/0xb0 net/socket.c:2062
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:3163 [inline]
check_prevs_add kernel/locking/lockdep.c:3282 [inline]
validate_chain kernel/locking/lockdep.c:3906 [inline]
__lock_acquire+0x249e/0x3c40 kernel/locking/lockdep.c:5228
lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5851
lock_sock_nested+0x3a/0xf0 net/core/sock.c:3645
lock_sock include/net/sock.h:1624 [inline]
sco_conn_ready net/bluetooth/sco.c:1341 [inline]
sco_connect_cfm+0x416/0xbc0 net/bluetooth/sco.c:1415
hci_connect_cfm include/net/bluetooth/hci_core.h:2051 [inline]
hci_conn_complete_evt+0x80d/0x1580 net/bluetooth/hci_event.c:3212
hci_event_func net/bluetooth/hci_event.c:7473 [inline]
hci_event_packet+0x9eb/0x1190 net/bluetooth/hci_event.c:7525
hci_rx_work+0x2c5/0x16b0 net/bluetooth/hci_core.c:4015
process_one_work+0x958/0x1b30 kernel/workqueue.c:3236
process_scheduled_works kernel/workqueue.c:3317 [inline]
worker_thread+0x6c8/0xf00 kernel/workqueue.c:3398
kthread+0x3af/0x750 kernel/kthread.c:464
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:148
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 ***
4 locks held by kworker/u33:0/66:
#0: ffff88804c0cf148 ((wq_completion)hci2#2){+.+.}-{0:0}, at: process_one_work+0x12cd/0x1b30 kernel/workqueue.c:3211
#1: ffffc90000a27d18 ((work_completion)(&hdev->rx_work)){+.+.}-{0:0}, at: process_one_work+0x8bb/0x1b30 kernel/workqueue.c:3212
#2: ffff888013260078 (&hdev->lock){+.+.}-{4:4}, at: hci_conn_complete_evt+0xbd/0x1580 net/bluetooth/hci_event.c:3074
#3: ffff888025950e20 (&conn->lock#2){+.+.}-{3:3}, at: spin_lock include/linux/spinlock.h:351 [inline]
#3: ffff888025950e20 (&conn->lock#2){+.+.}-{3:3}, at: sco_conn_ready net/bluetooth/sco.c:1328 [inline]
#3: ffff888025950e20 (&conn->lock#2){+.+.}-{3:3}, at: sco_connect_cfm+0x281/0xbc0 net/bluetooth/sco.c:1415
stack backtrace:
CPU: 3 UID: 0 PID: 66 Comm: kworker/u33:0 Not tainted 6.13.0-syzkaller-05252-gbc8198dc7ebc #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Workqueue: hci2 hci_rx_work
Call Trace:
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
print_circular_bug+0x490/0x760 kernel/locking/lockdep.c:2076
check_noncircular+0x31a/0x400 kernel/locking/lockdep.c:2208
check_prev_add kernel/locking/lockdep.c:3163 [inline]
check_prevs_add kernel/locking/lockdep.c:3282 [inline]
validate_chain kernel/locking/lockdep.c:3906 [inline]
__lock_acquire+0x249e/0x3c40 kernel/locking/lockdep.c:5228
lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5851
lock_sock_nested+0x3a/0xf0 net/core/sock.c:3645
lock_sock include/net/sock.h:1624 [inline]
sco_conn_ready net/bluetooth/sco.c:1341 [inline]
sco_connect_cfm+0x416/0xbc0 net/bluetooth/sco.c:1415
hci_connect_cfm include/net/bluetooth/hci_core.h:2051 [inline]
hci_conn_complete_evt+0x80d/0x1580 net/bluetooth/hci_event.c:3212
hci_event_func net/bluetooth/hci_event.c:7473 [inline]
hci_event_packet+0x9eb/0x1190 net/bluetooth/hci_event.c:7525
hci_rx_work+0x2c5/0x16b0 net/bluetooth/hci_core.c:4015
process_one_work+0x958/0x1b30 kernel/workqueue.c:3236
process_scheduled_works kernel/workqueue.c:3317 [inline]
worker_thread+0x6c8/0xf00 kernel/workqueue.c:3398
kthread+0x3af/0x750 kernel/kthread.c:464
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:148
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:3647
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 66, name: kworker/u33:0
preempt_count: 1, expected: 0
RCU nest depth: 0, expected: 0
INFO: lockdep is turned off.
Preemption disabled at:
[<0000000000000000>] 0x0
CPU: 3 UID: 0 PID: 66 Comm: kworker/u33:0 Not tainted 6.13.0-syzkaller-05252-gbc8198dc7ebc #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Workqueue: hci2 hci_rx_work
Call Trace:
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x16c/0x1f0 lib/dump_stack.c:120
__might_resched+0x3c0/0x5e0 kernel/sched/core.c:8758
lock_sock_nested+0x4b/0xf0 net/core/sock.c:3647
lock_sock include/net/sock.h:1624 [inline]
sco_conn_ready net/bluetooth/sco.c:1341 [inline]
sco_connect_cfm+0x416/0xbc0 net/bluetooth/sco.c:1415
hci_connect_cfm include/net/bluetooth/hci_core.h:2051 [inline]
hci_conn_complete_evt+0x80d/0x1580 net/bluetooth/hci_event.c:3212
hci_event_func net/bluetooth/hci_event.c:7473 [inline]
hci_event_packet+0x9eb/0x1190 net/bluetooth/hci_event.c:7525
hci_rx_work+0x2c5/0x16b0 net/bluetooth/hci_core.c:4015
process_one_work+0x958/0x1b30 kernel/workqueue.c:3236
process_scheduled_works kernel/workqueue.c:3317 [inline]
worker_thread+0x6c8/0xf00 kernel/workqueue.c:3398
kthread+0x3af/0x750 kernel/kthread.c:464
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:148
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
Bluetooth: hci2: command 0x0406 tx timeout