audit: type=1400 audit(1674575765.109:8): avc: denied { kernel } for pid=3659 comm="syz-executor.0" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=perf_event permissive=1 ====================================================== WARNING: possible circular locking dependency detected 6.2.0-rc5-next-20230123 #1 Not tainted ------------------------------------------------------ syz-executor.7/272 is trying to acquire lock: ffff88801627e130 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_conn_del+0x11c/0x2c0 but task is already holding lock: ffffffff85beaf28 (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+0x136/0x14c0 hci_remote_features_evt+0x45a/0x950 hci_event_packet+0x91d/0xf60 hci_rx_work+0xa86/0x1110 process_one_work+0xa0f/0x16d0 worker_thread+0x63b/0x1260 kthread+0x2f1/0x3a0 ret_from_fork+0x2c/0x50 -> #1 (&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 -> #0 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}: __lock_acquire+0x2a52/0x5e90 lock_acquire.part.0+0x120/0x340 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_unregister_dev+0x15e/0x410 vhci_release+0x80/0x100 __fput+0x263/0xa40 task_work_run+0x174/0x280 do_exit+0xada/0x2780 do_group_exit+0xd4/0x2a0 get_signal+0x2255/0x2390 arch_do_signal_or_restart+0x79/0x5a0 exit_to_user_mode_prepare+0xf5/0x190 syscall_exit_to_user_mode+0x1d/0x50 do_syscall_64+0x4c/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 *** 3 locks held by syz-executor.7/272: #0: ffff88800fd85028 (&hdev->req_lock){+.+.}-{3:3}, at: hci_unregister_dev+0x156/0x410 #1: ffff88800fd84078 (&hdev->lock){+.+.}-{3:3}, at: hci_dev_close_sync+0x2e4/0xff0 #2: ffffffff85beaf28 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_conn_hash_flush+0xcb/0x230 stack backtrace: CPU: 0 PID: 272 Comm: syz-executor.7 Not tainted 6.2.0-rc5-next-20230123 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 Call Trace: dump_stack_lvl+0x8f/0xb7 check_noncircular+0x263/0x2e0 __lock_acquire+0x2a52/0x5e90 lock_acquire.part.0+0x120/0x340 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_unregister_dev+0x15e/0x410 vhci_release+0x80/0x100 __fput+0x263/0xa40 task_work_run+0x174/0x280 do_exit+0xada/0x2780 do_group_exit+0xd4/0x2a0 get_signal+0x2255/0x2390 arch_do_signal_or_restart+0x79/0x5a0 exit_to_user_mode_prepare+0xf5/0x190 syscall_exit_to_user_mode+0x1d/0x50 do_syscall_64+0x4c/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc RIP: 0033:0x7f441d0778ac Code: Unable to access opcode bytes at 0x7f441d077882. RSP: 002b:00007ffdf494d370 EFLAGS: 00000293 ORIG_RAX: 000000000000002c RAX: 000000000000002c RBX: 00007f441e110320 RCX: 00007f441d0778ac RDX: 000000000000002c RSI: 00007f441e110370 RDI: 0000000000000003 RBP: 0000000000000000 R08: 00007ffdf494d3c4 R09: 000000000000000c R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000 R13: 00007f441e110370 R14: 0000000000000003 R15: 0000000000000000 syz-executor.5 (274) used greatest stack depth: 23960 bytes left Bluetooth: hci2: command 0x0405 tx timeout Bluetooth: hci0: Opcode 0x c03 failed: -110 Bluetooth: hci1: Opcode 0x c03 failed: -110 Bluetooth: hci3: Opcode 0x c03 failed: -110 Bluetooth: hci6: Opcode 0x c03 failed: -110 Bluetooth: hci7: Opcode 0x c03 failed: -110 Bluetooth: hci5: Opcode 0x c03 failed: -110 Bluetooth: hci4: Opcode 0x c03 failed: -110 Bluetooth: hci0: unexpected cc 0x0c03 length: 249 > 1 Bluetooth: hci0: unexpected cc 0x1003 length: 249 > 9 Bluetooth: hci0: unexpected cc 0x1001 length: 249 > 9 Bluetooth: hci0: unexpected cc 0x0c23 length: 249 > 4 Bluetooth: hci0: unexpected cc 0x0c25 length: 249 > 3 Bluetooth: hci0: unexpected cc 0x0c38 length: 249 > 2 Bluetooth: hci0: command 0x0409 tx timeout Bluetooth: hci1: Opcode 0x c03 failed: -110 Bluetooth: hci3: Opcode 0x c03 failed: -110 Bluetooth: hci6: Opcode 0x c03 failed: -110 Bluetooth: hci7: Opcode 0x c03 failed: -110 Bluetooth: hci4: Opcode 0x c03 failed: -110 Bluetooth: hci5: Opcode 0x c03 failed: -110