====================================================== WARNING: possible circular locking dependency detected 6.2.0-rc5-next-20230125 #1 Not tainted ------------------------------------------------------ syz-executor.4/107806 is trying to acquire lock: ffff8880087e7e70 ((work_completion)(&(&conn->timeout_work)->work)){+.+.}-{0:0}, at: __flush_work+0xdd/0xd80 but task is already holding lock: ffffffff85bec228 (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: -> #3 (hci_cb_list_lock){+.+.}-{3:3}: __mutex_lock+0x136/0x14c0 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+0x2f1/0x3a0 ret_from_fork+0x2c/0x50 -> #2 (&hdev->lock){+.+.}-{3:3}: __mutex_lock+0x136/0x14c0 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 -> #1 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}: lock_sock_nested+0x41/0xf0 sco_sock_timeout+0xc7/0x230 process_one_work+0xa0f/0x1790 worker_thread+0x63b/0x1260 kthread+0x2f1/0x3a0 ret_from_fork+0x2c/0x50 -> #0 ((work_completion)(&(&conn->timeout_work)->work)){+.+.}-{0:0}: __lock_acquire+0x2dcd/0x6410 lock_acquire.part.0+0x120/0x360 __flush_work+0x109/0xd80 __cancel_work_timer+0x39c/0x4e0 sco_conn_del+0x1e4/0x2c0 sco_disconn_cfm+0x66/0x80 hci_conn_hash_flush+0x11d/0x230 hci_dev_reset+0x3b5/0x730 hci_sock_ioctl+0x46d/0x860 sock_do_ioctl+0xd2/0x240 sock_ioctl+0x424/0x670 __x64_sys_ioctl+0x19e/0x210 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc other info that might help us debug this: Chain exists of: (work_completion)(&(&conn->timeout_work)->work) --> &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((work_completion)(&(&conn->timeout_work)->work)); *** DEADLOCK *** 3 locks held by syz-executor.4/107806: #0: ffff88801e9f5028 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_reset+0x20d/0x730 #1: ffff88801e9f4078 (&hdev->lock){+.+.}-{3:3}, at: hci_dev_reset+0x2a4/0x730 #2: ffffffff85bec228 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_conn_hash_flush+0xcb/0x230 stack backtrace: CPU: 1 PID: 107806 Comm: syz-executor.4 Not tainted 6.2.0-rc5-next-20230125 #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+0x2dcd/0x6410 lock_acquire.part.0+0x120/0x360 __flush_work+0x109/0xd80 __cancel_work_timer+0x39c/0x4e0 sco_conn_del+0x1e4/0x2c0 sco_disconn_cfm+0x66/0x80 hci_conn_hash_flush+0x11d/0x230 hci_dev_reset+0x3b5/0x730 hci_sock_ioctl+0x46d/0x860 sock_do_ioctl+0xd2/0x240 sock_ioctl+0x424/0x670 blktrace: Concurrent blktraces are not allowed on sg0 __x64_sys_ioctl+0x19e/0x210 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc RIP: 0033:0x7f31a1edfb19 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:00007f319f455188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f31a1ff2f60 RCX: 00007f31a1edfb19 RDX: 0000000000000000 RSI: 00000000400448cb RDI: 0000000000000005 RBP: 00007f31a1f39f6d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc49f1d73f R14: 00007f319f455300 R15: 0000000000022000 blktrace: Concurrent blktraces are not allowed on sg0 Bluetooth: hci0: Opcode 0x c03 failed: -4 blktrace: Concurrent blktraces are not allowed on sg0 blktrace: Concurrent blktraces are not allowed on sg0 blktrace: Concurrent blktraces are not allowed on sg0