====================================================== WARNING: possible circular locking dependency detected 6.2.0-rc3-syzkaller-16387-g9598c377d828 #0 Not tainted ------------------------------------------------------ kworker/1:4/4499 is trying to acquire lock: ffff00011324e930 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1725 [inline] ffff00011324e930 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_conn_del+0x9c/0x234 net/bluetooth/sco.c:197 but task is already holding lock: ffff80000da62ee8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_disconn_cfm include/net/bluetooth/hci_core.h:1790 [inline] ffff80000da62ee8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_conn_hash_flush+0x64/0x148 net/bluetooth/hci_conn.c:2427 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (hci_cb_list_lock){+.+.}-{3:3}: __mutex_lock_common+0xd4/0xca8 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799 hci_connect_cfm include/net/bluetooth/hci_core.h:1775 [inline] hci_remote_features_evt+0x274/0x50c net/bluetooth/hci_event.c:3768 hci_event_func net/bluetooth/hci_event.c:7482 [inline] hci_event_packet+0x5c4/0x60c net/bluetooth/hci_event.c:7534 hci_rx_work+0x1a4/0x2f4 net/bluetooth/hci_core.c:4043 process_one_work+0x2d8/0x504 kernel/workqueue.c:2289 worker_thread+0x340/0x610 kernel/workqueue.c:2436 kthread+0x12c/0x158 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:863 -> #1 (&hdev->lock){+.+.}-{3:3}: __mutex_lock_common+0xd4/0xca8 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799 sco_sock_connect+0x104/0x220 net/bluetooth/sco.c:593 __sys_connect_file net/socket.c:1976 [inline] __sys_connect+0x184/0x190 net/socket.c:1993 __do_sys_connect net/socket.c:2003 [inline] __se_sys_connect net/socket.c:2000 [inline] __arm64_sys_connect+0x28/0x3c net/socket.c:2000 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall arch/arm64/kernel/syscall.c:52 [inline] el0_svc_common+0x138/0x220 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x48/0x104 arch/arm64/kernel/syscall.c:193 el0_svc+0x58/0x150 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:584 -> #0 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}: check_prev_add kernel/locking/lockdep.c:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain kernel/locking/lockdep.c:3831 [inline] __lock_acquire+0x1530/0x3084 kernel/locking/lockdep.c:5055 lock_acquire+0x100/0x1f8 kernel/locking/lockdep.c:5668 lock_sock_nested+0x70/0xd8 net/core/sock.c:3470 lock_sock include/net/sock.h:1725 [inline] sco_conn_del+0x9c/0x234 net/bluetooth/sco.c:197 sco_disconn_cfm+0x64/0xa8 net/bluetooth/sco.c:1379 hci_disconn_cfm include/net/bluetooth/hci_core.h:1793 [inline] hci_conn_hash_flush+0x88/0x148 net/bluetooth/hci_conn.c:2427 hci_dev_close_sync+0x4fc/0xa98 net/bluetooth/hci_sync.c:4850 hci_dev_do_close net/bluetooth/hci_core.c:554 [inline] hci_rfkill_set_block+0x98/0x198 net/bluetooth/hci_core.c:956 rfkill_set_block+0xb4/0x1f8 net/rfkill/core.c:345 rfkill_epo+0x70/0x124 net/rfkill/core.c:454 __rfkill_handle_global_op net/rfkill/input.c:60 [inline] rfkill_op_handler+0x170/0x288 net/rfkill/input.c:108 process_one_work+0x2d8/0x504 kernel/workqueue.c:2289 worker_thread+0x340/0x610 kernel/workqueue.c:2436 kthread+0x12c/0x158 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:863 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 *** 6 locks held by kworker/1:4/4499: #0: ffff0000c0012738 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work+0x270/0x504 kernel/workqueue.c:2262 #1: ffff800013d2bd80 ((rfkill_op_work).work){+.+.}-{0:0}, at: process_one_work+0x29c/0x504 kernel/workqueue.c:2264 #2: ffff80000dac4be0 (rfkill_global_mutex){+.+.}-{3:3}, at: rfkill_epo+0x44/0x124 net/rfkill/core.c:450 #3: ffff0000c985f028 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close net/bluetooth/hci_core.c:552 [inline] #3: ffff0000c985f028 (&hdev->req_lock){+.+.}-{3:3}, at: hci_rfkill_set_block+0x90/0x198 net/bluetooth/hci_core.c:956 #4: ffff0000c985e078 (&hdev->lock){+.+.}-{3:3}, at: hci_dev_close_sync+0x278/0xa98 net/bluetooth/hci_sync.c:4837 #5: ffff80000da62ee8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_disconn_cfm include/net/bluetooth/hci_core.h:1790 [inline] #5: ffff80000da62ee8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_conn_hash_flush+0x64/0x148 net/bluetooth/hci_conn.c:2427 stack backtrace: CPU: 1 PID: 4499 Comm: kworker/1:4 Not tainted 6.2.0-rc3-syzkaller-16387-g9598c377d828 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Workqueue: events rfkill_op_handler Call trace: dump_backtrace+0x1c4/0x1f0 arch/arm64/kernel/stacktrace.c:156 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:163 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x104/0x16c lib/dump_stack.c:106 dump_stack+0x1c/0x58 lib/dump_stack.c:113 print_circular_bug+0x2c4/0x2c8 kernel/locking/lockdep.c:2055 check_noncircular+0x14c/0x154 kernel/locking/lockdep.c:2177 check_prev_add kernel/locking/lockdep.c:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain kernel/locking/lockdep.c:3831 [inline] __lock_acquire+0x1530/0x3084 kernel/locking/lockdep.c:5055 lock_acquire+0x100/0x1f8 kernel/locking/lockdep.c:5668 lock_sock_nested+0x70/0xd8 net/core/sock.c:3470 lock_sock include/net/sock.h:1725 [inline] sco_conn_del+0x9c/0x234 net/bluetooth/sco.c:197 sco_disconn_cfm+0x64/0xa8 net/bluetooth/sco.c:1379 hci_disconn_cfm include/net/bluetooth/hci_core.h:1793 [inline] hci_conn_hash_flush+0x88/0x148 net/bluetooth/hci_conn.c:2427 hci_dev_close_sync+0x4fc/0xa98 net/bluetooth/hci_sync.c:4850 hci_dev_do_close net/bluetooth/hci_core.c:554 [inline] hci_rfkill_set_block+0x98/0x198 net/bluetooth/hci_core.c:956 rfkill_set_block+0xb4/0x1f8 net/rfkill/core.c:345 rfkill_epo+0x70/0x124 net/rfkill/core.c:454 __rfkill_handle_global_op net/rfkill/input.c:60 [inline] rfkill_op_handler+0x170/0x288 net/rfkill/input.c:108 process_one_work+0x2d8/0x504 kernel/workqueue.c:2289 worker_thread+0x340/0x610 kernel/workqueue.c:2436 kthread+0x12c/0x158 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:863