====================================================== WARNING: possible circular locking dependency detected 6.2.0-rc1-syzkaller-00095-ge4cf7c25bae5 #0 Not tainted ------------------------------------------------------ syz-executor112/5101 is trying to acquire lock: ffff888028432130 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1725 [inline] ffff888028432130 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_conn_del+0xfe/0x2f0 net/bluetooth/sco.c:197 but task is already holding lock: ffffffff8e7be5a8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_disconn_cfm include/net/bluetooth/hci_core.h:1790 [inline] ffffffff8e7be5a8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_conn_hash_flush+0xb8/0x240 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}: lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5668 __mutex_lock_common+0x1de/0x26c0 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:799 hci_connect_cfm include/net/bluetooth/hci_core.h:1775 [inline] hci_remote_features_evt+0x610/0xa60 net/bluetooth/hci_event.c:3768 hci_event_func net/bluetooth/hci_event.c:7482 [inline] hci_event_packet+0x842/0x10c0 net/bluetooth/hci_event.c:7534 hci_rx_work+0x2fc/0x4a0 net/bluetooth/hci_core.c:4043 process_one_work+0x81c/0xd10 kernel/workqueue.c:2289 worker_thread+0xb14/0x1330 kernel/workqueue.c:2436 kthread+0x266/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 -> #1 (&hdev->lock){+.+.}-{3:3}: lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5668 __mutex_lock_common+0x1de/0x26c0 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:799 sco_sock_connect+0x168/0x350 net/bluetooth/sco.c:593 __sys_connect_file net/socket.c:1976 [inline] __sys_connect+0x29b/0x2d0 net/socket.c:1993 __do_sys_connect net/socket.c:2003 [inline] __se_sys_connect net/socket.c:2000 [inline] __x64_sys_connect+0x76/0x80 net/socket.c:2000 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 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:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain+0x184a/0x6470 kernel/locking/lockdep.c:3831 __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5055 lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5668 lock_sock_nested+0x44/0xf0 net/core/sock.c:3470 lock_sock include/net/sock.h:1725 [inline] sco_conn_del+0xfe/0x2f0 net/bluetooth/sco.c:197 hci_disconn_cfm include/net/bluetooth/hci_core.h:1793 [inline] hci_conn_hash_flush+0x112/0x240 net/bluetooth/hci_conn.c:2427 hci_dev_close_sync+0x76d/0xd70 net/bluetooth/hci_sync.c:4850 hci_dev_do_close net/bluetooth/hci_core.c:554 [inline] hci_rfkill_set_block+0x123/0x1c0 net/bluetooth/hci_core.c:956 rfkill_set_block+0x1e7/0x430 net/rfkill/core.c:345 rfkill_fop_write+0x5fb/0x7b0 net/rfkill/core.c:1286 vfs_write+0x2e5/0xbb0 fs/read_write.c:582 ksys_write+0x19b/0x2c0 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd 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-executor112/5101: #0: ffffffff8e914b88 (rfkill_global_mutex){+.+.}-{3:3}, at: rfkill_fop_write+0x1c2/0x7b0 net/rfkill/core.c:1278 #1: ffff8880228f5028 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close net/bluetooth/hci_core.c:552 [inline] #1: ffff8880228f5028 (&hdev->req_lock){+.+.}-{3:3}, at: hci_rfkill_set_block+0x11b/0x1c0 net/bluetooth/hci_core.c:956 #2: ffff8880228f4078 (&hdev->lock){+.+.}-{3:3}, at: hci_dev_close_sync+0x456/0xd70 net/bluetooth/hci_sync.c:4837 #3: ffffffff8e7be5a8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_disconn_cfm include/net/bluetooth/hci_core.h:1790 [inline] #3: ffffffff8e7be5a8 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_conn_hash_flush+0xb8/0x240 net/bluetooth/hci_conn.c:2427 stack backtrace: CPU: 1 PID: 5101 Comm: syz-executor112 Not tainted 6.2.0-rc1-syzkaller-00095-ge4cf7c25bae5 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 check_noncircular+0x2f9/0x3b0 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+0x184a/0x6470 kernel/locking/lockdep.c:3831 __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5055 lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5668 lock_sock_nested+0x44/0xf0 net/core/sock.c:3470 lock_sock include/net/sock.h:1725 [inline] sco_conn_del+0xfe/0x2f0 net/bluetooth/sco.c:197 hci_disconn_cfm include/net/bluetooth/hci_core.h:1793 [inline] hci_conn_hash_flush+0x112/0x240 net/bluetooth/hci_conn.c:2427 hci_dev_close_sync+0x76d/0xd70 net/bluetooth/hci_sync.c:4850 hci_dev_do_close net/bluetooth/hci_core.c:554 [inline] hci_rfkill_set_block+0x123/0x1c0 net/bluetooth/hci_core.c:956 rfkill_set_block+0x1e7/0x430 net/rfkill/core.c:345 rfkill_fop_write+0x5fb/0x7b0 net/rfkill/core.c:1286 vfs_write+0x2e5/0xbb0 fs/read_write.c:582 ksys_write+0x19b/0x2c0 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f85fb012529 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 d1 15 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffd977b92b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f85fb012529 RDX: 0000000000000008 RSI: 0000000020000080 RDI: 0000000000000003 RBP: 0000000000000003 R08: 0000000000000150 R09: 0000000000000150 R10: 0000000000000150 R11: 0000000000000246 R12: 0000555555ff12b8 R13: 0000000000000011 R14: 00007ffd977b9320 R15: 0000000000000003