Bluetooth: hci4: hardware error 0x00 ====================================================== WARNING: possible circular locking dependency detected 6.3.0-rc4-syzkaller #0 Not tainted ------------------------------------------------------ kworker/u5:0/48 is trying to acquire lock: ffff8880307b9130 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1697 [inline] ffff8880307b9130 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_conn_del+0x104/0x300 net/bluetooth/sco.c:197 but task is already holding lock: ffffffff8e1e3ce8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_disconn_cfm include/net/bluetooth/hci_core.h:1791 [inline] ffffffff8e1e3ce8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_conn_hash_flush+0xbc/0x210 net/bluetooth/hci_conn.c:2440 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (hci_cb_list_lock){+.+.}-{3:3}: lock_acquire+0x1e1/0x520 kernel/locking/lockdep.c:5669 __mutex_lock_common+0x1d8/0x2530 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x1b/0x20 kernel/locking/mutex.c:799 hci_connect_cfm include/net/bluetooth/hci_core.h:1776 [inline] hci_remote_features_evt+0x675/0xaa0 net/bluetooth/hci_event.c:3768 hci_event_func net/bluetooth/hci_event.c:7485 [inline] hci_event_packet+0x970/0x1360 net/bluetooth/hci_event.c:7537 hci_rx_work+0x446/0xa90 net/bluetooth/hci_core.c:4058 process_one_work+0x8a0/0x10e0 kernel/workqueue.c:2390 worker_thread+0xa63/0x1210 kernel/workqueue.c:2537 kthread+0x270/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 -> #1 (&hdev->lock){+.+.}-{3:3}: lock_acquire+0x1e1/0x520 kernel/locking/lockdep.c:5669 __mutex_lock_common+0x1d8/0x2530 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x1b/0x20 kernel/locking/mutex.c:799 sco_sock_connect+0x185/0x8f0 net/bluetooth/sco.c:593 io_connect+0x2a9/0x770 io_uring/net.c:1463 io_issue_sqe+0x33a/0xb20 io_uring/io_uring.c:1907 io_queue_sqe io_uring/io_uring.c:2079 [inline] io_submit_sqe io_uring/io_uring.c:2340 [inline] io_submit_sqes+0xadc/0x1e40 io_uring/io_uring.c:2450 __do_sys_io_uring_enter io_uring/io_uring.c:3458 [inline] __se_sys_io_uring_enter+0x2fa/0x12f0 io_uring/io_uring.c:3392 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}: check_prev_add kernel/locking/lockdep.c:3098 [inline] check_prevs_add kernel/locking/lockdep.c:3217 [inline] validate_chain+0x166b/0x58e0 kernel/locking/lockdep.c:3832 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5056 lock_acquire+0x1e1/0x520 kernel/locking/lockdep.c:5669 lock_sock_nested+0x48/0x100 net/core/sock.c:3474 lock_sock include/net/sock.h:1697 [inline] sco_conn_del+0x104/0x300 net/bluetooth/sco.c:197 hci_disconn_cfm include/net/bluetooth/hci_core.h:1794 [inline] hci_conn_hash_flush+0x111/0x210 net/bluetooth/hci_conn.c:2440 hci_dev_close_sync+0xa35/0x1020 net/bluetooth/hci_sync.c:4893 hci_dev_do_close net/bluetooth/hci_core.c:554 [inline] hci_error_reset+0xec/0x200 net/bluetooth/hci_core.c:1059 process_one_work+0x8a0/0x10e0 kernel/workqueue.c:2390 worker_thread+0xa63/0x1210 kernel/workqueue.c:2537 kthread+0x270/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 other info that might help us debug this: Chain exists of: sk_lock-AF_BLUETOOTH-BTPROTO_SCO --> &hdev->lock --> hci_cb_list_lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(hci_cb_list_lock); lock(&hdev->lock); lock(hci_cb_list_lock); lock(sk_lock-AF_BLUETOOTH-BTPROTO_SCO); *** DEADLOCK *** 5 locks held by kworker/u5:0/48: #0: ffff8880210cb138 ((wq_completion)hci4){+.+.}-{0:0}, at: process_one_work+0x77e/0x10e0 kernel/workqueue.c:2363 #1: ffffc90000b97d20 ((work_completion)(&hdev->error_reset)){+.+.}-{0:0}, at: process_one_work+0x7c8/0x10e0 kernel/workqueue.c:2365 #2: ffff88807c309028 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close net/bluetooth/hci_core.c:552 [inline] #2: ffff88807c309028 (&hdev->req_lock){+.+.}-{3:3}, at: hci_error_reset+0xe4/0x200 net/bluetooth/hci_core.c:1059 #3: ffff88807c308078 (&hdev->lock){+.+.}-{3:3}, at: hci_dev_close_sync+0x449/0x1020 net/bluetooth/hci_sync.c:4880 #4: ffffffff8e1e3ce8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_disconn_cfm include/net/bluetooth/hci_core.h:1791 [inline] #4: ffffffff8e1e3ce8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_conn_hash_flush+0xbc/0x210 net/bluetooth/hci_conn.c:2440 stack backtrace: CPU: 1 PID: 48 Comm: kworker/u5:0 Not tainted 6.3.0-rc4-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023 Workqueue: hci4 hci_error_reset Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 check_noncircular+0x2fe/0x3b0 kernel/locking/lockdep.c:2178 check_prev_add kernel/locking/lockdep.c:3098 [inline] check_prevs_add kernel/locking/lockdep.c:3217 [inline] validate_chain+0x166b/0x58e0 kernel/locking/lockdep.c:3832 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5056 lock_acquire+0x1e1/0x520 kernel/locking/lockdep.c:5669 lock_sock_nested+0x48/0x100 net/core/sock.c:3474 lock_sock include/net/sock.h:1697 [inline] sco_conn_del+0x104/0x300 net/bluetooth/sco.c:197 hci_disconn_cfm include/net/bluetooth/hci_core.h:1794 [inline] hci_conn_hash_flush+0x111/0x210 net/bluetooth/hci_conn.c:2440 hci_dev_close_sync+0xa35/0x1020 net/bluetooth/hci_sync.c:4893 hci_dev_do_close net/bluetooth/hci_core.c:554 [inline] hci_error_reset+0xec/0x200 net/bluetooth/hci_core.c:1059 process_one_work+0x8a0/0x10e0 kernel/workqueue.c:2390 worker_thread+0xa63/0x1210 kernel/workqueue.c:2537 kthread+0x270/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Bluetooth: hci4: Opcode 0x c03 failed: -110