BUG: workqueue leaked atomic, lock or RCU: kworker/u9:3[5096]
preempt=0x00000000 lock=0->1 RCU=0->0 workfn=hci_rx_work
1 lock held by kworker/u9:3/5096:
#0: ffff888066dd9518 (&chan->lock/1){+.+.}-{3:3}, at: l2cap_chan_lock include/net/bluetooth/l2cap.h:827 [inline]
#0: ffff888066dd9518 (&chan->lock/1){+.+.}-{3:3}, at: l2cap_conless_channel net/bluetooth/l2cap_core.c:6764 [inline]
#0: ffff888066dd9518 (&chan->lock/1){+.+.}-{3:3}, at: l2cap_recv_frame+0x7ca/0x10830 net/bluetooth/l2cap_core.c:6830
CPU: 0 PID: 5096 Comm: kworker/u9:3 Not tainted 6.10.0-rc6-syzkaller-00223-gc6653f49e4fd #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
Workqueue: hci4 hci_rx_work
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
process_one_work kernel/workqueue.c:3269 [inline]
process_scheduled_works+0x1121/0x1830 kernel/workqueue.c:3329
worker_thread+0x86d/0xd50 kernel/workqueue.c:3409
kthread+0x2f0/0x390 kernel/kthread.c:389
ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
======================================================
WARNING: possible circular locking dependency detected
6.10.0-rc6-syzkaller-00223-gc6653f49e4fd #0 Not tainted
------------------------------------------------------
kworker/u9:3/5096 is trying to acquire lock:
ffff888012220148 ((wq_completion)hci2#2){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3223 [inline]
ffff888012220148 ((wq_completion)hci2#2){+.+.}-{0:0}, at: process_scheduled_works+0x90a/0x1830 kernel/workqueue.c:3329
but task is already holding lock:
ffff888066dd9518 (&chan->lock/1){+.+.}-{3:3}, at: l2cap_chan_lock include/net/bluetooth/l2cap.h:827 [inline]
ffff888066dd9518 (&chan->lock/1){+.+.}-{3:3}, at: l2cap_conless_channel net/bluetooth/l2cap_core.c:6764 [inline]
ffff888066dd9518 (&chan->lock/1){+.+.}-{3:3}, at: l2cap_recv_frame+0x7ca/0x10830 net/bluetooth/l2cap_core.c:6830
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #2 (&chan->lock/1){+.+.}-{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
l2cap_chan_lock include/net/bluetooth/l2cap.h:827 [inline]
l2cap_conless_channel net/bluetooth/l2cap_core.c:6764 [inline]
l2cap_recv_frame+0x7ca/0x10830 net/bluetooth/l2cap_core.c:6830
hci_acldata_packet net/bluetooth/hci_core.c:3810 [inline]
hci_rx_work+0x50f/0xca0 net/bluetooth/hci_core.c:4047
process_one_work kernel/workqueue.c:3248 [inline]
process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3329
worker_thread+0x86d/0xd50 kernel/workqueue.c:3409
kthread+0x2f0/0x390 kernel/kthread.c:389
ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
-> #1 ((work_completion)(&hdev->rx_work)){+.+.}-{0:0}:
lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
process_one_work kernel/workqueue.c:3224 [inline]
process_scheduled_works+0x963/0x1830 kernel/workqueue.c:3329
worker_thread+0x86d/0xd50 kernel/workqueue.c:3409
kthread+0x2f0/0x390 kernel/kthread.c:389
ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
-> #0 ((wq_completion)hci2#2){+.+.}-{0:0}:
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain+0x18e0/0x5900 kernel/locking/lockdep.c:3869
__lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137
lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
process_one_work kernel/workqueue.c:3223 [inline]
process_scheduled_works+0x91f/0x1830 kernel/workqueue.c:3329
worker_thread+0x86d/0xd50 kernel/workqueue.c:3409
kthread+0x2f0/0x390 kernel/kthread.c:389
ret_from_fork+0x4b/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:
Chain exists of:
(wq_completion)hci2#2 --> (work_completion)(&hdev->rx_work) --> &chan->lock/1
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&chan->lock/1);
lock((work_completion)(&hdev->rx_work));
lock(&chan->lock/1);
lock((wq_completion)hci2#2);
*** DEADLOCK ***
1 lock held by kworker/u9:3/5096:
#0: ffff888066dd9518 (&chan->lock/1){+.+.}-{3:3}, at: l2cap_chan_lock include/net/bluetooth/l2cap.h:827 [inline]
#0: ffff888066dd9518 (&chan->lock/1){+.+.}-{3:3}, at: l2cap_conless_channel net/bluetooth/l2cap_core.c:6764 [inline]
#0: ffff888066dd9518 (&chan->lock/1){+.+.}-{3:3}, at: l2cap_recv_frame+0x7ca/0x10830 net/bluetooth/l2cap_core.c:6830
stack backtrace:
CPU: 0 PID: 5096 Comm: kworker/u9:3 Not tainted 6.10.0-rc6-syzkaller-00223-gc6653f49e4fd #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
Workqueue: hci2 hci_rx_work
Call Trace:
__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+0x18e0/0x5900 kernel/locking/lockdep.c:3869
__lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137
lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
process_one_work kernel/workqueue.c:3223 [inline]
process_scheduled_works+0x91f/0x1830 kernel/workqueue.c:3329
worker_thread+0x86d/0xd50 kernel/workqueue.c:3409
kthread+0x2f0/0x390 kernel/kthread.c:389
ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
BUG: workqueue leaked atomic, lock or RCU: kworker/u9:3[5096]
preempt=0x00000000 lock=1->0 RCU=0->0 workfn=hci_rx_work
INFO: lockdep is turned off.
CPU: 1 PID: 5096 Comm: kworker/u9:3 Not tainted 6.10.0-rc6-syzkaller-00223-gc6653f49e4fd #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
Workqueue: hci2 hci_rx_work
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
process_one_work kernel/workqueue.c:3269 [inline]
process_scheduled_works+0x1121/0x1830 kernel/workqueue.c:3329
worker_thread+0x86d/0xd50 kernel/workqueue.c:3409
kthread+0x2f0/0x390 kernel/kthread.c:389
ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244