====================================================== WARNING: possible circular locking dependency detected 5.19.0-rc4-syzkaller-00014-g941e3e791269 #0 Not tainted ------------------------------------------------------ syz-executor638/3639 is trying to acquire lock: ffff8880213cb130 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1677 [inline] ffff8880213cb130 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_conn_del+0x131/0x2c0 net/bluetooth/sco.c:197 but task is already holding lock: ffffffff8d7b3388 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_disconn_cfm include/net/bluetooth/hci_core.h:1580 [inline] ffffffff8d7b3388 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_conn_hash_flush+0xda/0x260 net/bluetooth/hci_conn.c:1475 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 kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12f/0x1350 kernel/locking/mutex.c:747 hci_connect_cfm include/net/bluetooth/hci_core.h:1565 [inline] hci_remote_features_evt+0x62b/0xa20 net/bluetooth/hci_event.c:3754 hci_event_func net/bluetooth/hci_event.c:6921 [inline] hci_event_packet+0x7c1/0xf60 net/bluetooth/hci_event.c:6970 hci_rx_work+0x522/0xd60 net/bluetooth/hci_core.c:3817 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:302 -> #1 (&hdev->lock){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12f/0x1350 kernel/locking/mutex.c:747 sco_sock_connect+0x1eb/0xa80 net/bluetooth/sco.c:593 __sys_connect_file+0x14f/0x190 net/socket.c:1979 __sys_connect+0x161/0x190 net/socket.c:1996 __do_sys_connect net/socket.c:2006 [inline] __se_sys_connect net/socket.c:2003 [inline] __x64_sys_connect+0x6f/0xb0 net/socket.c:2003 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 -> #0 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}: check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3829 [inline] __lock_acquire+0x2abe/0x5660 kernel/locking/lockdep.c:5053 lock_acquire kernel/locking/lockdep.c:5665 [inline] lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5630 lock_sock_nested+0x36/0xf0 net/core/sock.c:3389 lock_sock include/net/sock.h:1677 [inline] sco_conn_del+0x131/0x2c0 net/bluetooth/sco.c:197 sco_disconn_cfm+0x71/0xb0 net/bluetooth/sco.c:1379 hci_disconn_cfm include/net/bluetooth/hci_core.h:1583 [inline] hci_conn_hash_flush+0x127/0x260 net/bluetooth/hci_conn.c:1475 hci_dev_close_sync+0x573/0x1150 net/bluetooth/hci_sync.c:4152 hci_dev_do_close+0x32/0x70 net/bluetooth/hci_core.c:553 hci_rfkill_set_block+0x19c/0x1d0 net/bluetooth/hci_core.c:935 rfkill_set_block+0x1f9/0x540 net/rfkill/core.c:345 rfkill_fop_write+0x2c3/0x570 net/rfkill/core.c:1286 vfs_write+0x269/0xac0 fs/read_write.c:589 ksys_write+0x1e8/0x250 fs/read_write.c:644 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 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-executor638/3639: #0: ffffffff8d994668 (rfkill_global_mutex){+.+.}-{3:3}, at: rfkill_fop_write+0x15c/0x570 net/rfkill/core.c:1278 #1: ffff8880211f9048 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close+0x2a/0x70 net/bluetooth/hci_core.c:551 #2: ffff8880211f8078 (&hdev->lock){+.+.}-{3:3}, at: hci_dev_close_sync+0x279/0x1150 net/bluetooth/hci_sync.c:4139 #3: ffffffff8d7b3388 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_disconn_cfm include/net/bluetooth/hci_core.h:1580 [inline] #3: ffffffff8d7b3388 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_conn_hash_flush+0xda/0x260 net/bluetooth/hci_conn.c:1475 stack backtrace: CPU: 1 PID: 3639 Comm: syz-executor638 Not tainted 5.19.0-rc4-syzkaller-00014-g941e3e791269 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2175 check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3829 [inline] __lock_acquire+0x2abe/0x5660 kernel/locking/lockdep.c:5053 lock_acquire kernel/locking/lockdep.c:5665 [inline] lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5630 lock_sock_nested+0x36/0xf0 net/core/sock.c:3389 lock_sock include/net/sock.h:1677 [inline] sco_conn_del+0x131/0x2c0 net/bluetooth/sco.c:197 sco_disconn_cfm+0x71/0xb0 net/bluetooth/sco.c:1379 hci_disconn_cfm include/net/bluetooth/hci_core.h:1583 [inline] hci_conn_hash_flush+0x127/0x260 net/bluetooth/hci_conn.c:1475 hci_dev_close_sync+0x573/0x1150 net/bluetooth/hci_sync.c:4152 hci_dev_do_close+0x32/0x70 net/bluetooth/hci_core.c:553 hci_rfkill_set_block+0x19c/0x1d0 net/bluetooth/hci_core.c:935 rfkill_set_block+0x1f9/0x540 net/rfkill/core.c:345 rfkill_fop_write+0x2c3/0x570 net/rfkill/core.c:1286 vfs_write+0x269/0xac0 fs/read_write.c:589 ksys_write+0x1e8/0x250 fs/read_write.c:644 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7fdd3bf864b9 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:00007fffaa0e8b88 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007fdd3bf864b9 RDX: 0000000000000008 RSI: 0000000020000000 RDI: 0000000000000003 RBP: 0000000000000003 R08: 0000000000000150 R09: 0000000000000150 R10: 0000000000000150 R11: 0000000000000246 R12: 00005555569232b8 R13: 0000000000000011 R14: 00007fffaa0e8bf0 R15: 0000000000000000