====================================================== WARNING: possible circular locking dependency detected 6.2.0-rc6-next-20230203 #1 Not tainted ------------------------------------------------------ syz-executor.3/4014 is trying to acquire lock: ffff888019c80130 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_conn_del+0x11c/0x2c0 but task is already holding lock: ffffffff85be9b28 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_conn_hash_flush+0xcb/0x230 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+0x133/0x14a0 hci_remote_features_evt+0x45a/0x950 hci_event_packet+0x91d/0xf60 hci_rx_work+0xa86/0x1110 process_one_work+0xa0f/0x1790 worker_thread+0x63b/0x1260 kthread+0x2e9/0x3a0 ret_from_fork+0x2c/0x50 -> #1 (&hdev->lock){+.+.}-{3:3}: __mutex_lock+0x133/0x14a0 sco_sock_connect+0x1e8/0xa60 __sys_connect_file+0x159/0x1a0 __sys_connect+0x169/0x1a0 __x64_sys_connect+0x73/0xb0 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc -> #0 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}: __lock_acquire+0x2da7/0x63b0 lock_acquire.part.0+0xec/0x320 lock_sock_nested+0x41/0xf0 sco_conn_del+0x11c/0x2c0 sco_disconn_cfm+0x66/0x80 hci_conn_hash_flush+0x11d/0x230 hci_dev_close_sync+0x57f/0xff0 hci_rfkill_set_block+0x17b/0x1c0 rfkill_set_block+0x1fd/0x540 rfkill_fop_write+0x2b7/0x540 vfs_write+0x2cf/0xdc0 ksys_write+0x1f4/0x260 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc 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 *** 4 locks held by syz-executor.3/4014: #0: ffffffff85ca6668 (rfkill_global_mutex){+.+.}-{3:3}, at: rfkill_fop_write+0x161/0x540 #1: ffff88800f169028 (&hdev->req_lock){+.+.}-{3:3}, at: hci_rfkill_set_block+0x173/0x1c0 #2: ffff88800f168078 (&hdev->lock){+.+.}-{3:3}, at: hci_dev_close_sync+0x2e4/0xff0 #3: ffffffff85be9b28 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_conn_hash_flush+0xcb/0x230 stack backtrace: CPU: 1 PID: 4014 Comm: syz-executor.3 Not tainted 6.2.0-rc6-next-20230203 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 Call Trace: dump_stack_lvl+0x91/0xf0 check_noncircular+0x263/0x2e0 __lock_acquire+0x2da7/0x63b0 lock_acquire.part.0+0xec/0x320 lock_sock_nested+0x41/0xf0 sco_conn_del+0x11c/0x2c0 sco_disconn_cfm+0x66/0x80 hci_conn_hash_flush+0x11d/0x230 hci_dev_close_sync+0x57f/0xff0 hci_rfkill_set_block+0x17b/0x1c0 rfkill_set_block+0x1fd/0x540 rfkill_fop_write+0x2b7/0x540 vfs_write+0x2cf/0xdc0 ksys_write+0x1f4/0x260 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc RIP: 0033:0x7efe35a4bb19 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007efe32fc1188 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007efe35b5ef60 RCX: 00007efe35a4bb19 RDX: 0000000000000008 RSI: 0000000020000000 RDI: 0000000000000003 RBP: 00007efe35aa5f6d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc683ae63f R14: 00007efe32fc1300 R15: 0000000000022000