audit: type=1400 audit(1676219268.414:16): avc: denied { watch_reads } for pid=4648 comm="syz-executor.5" path="/dev/bsg" dev="devtmpfs" ino=113 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:object_r:device_t:s0 tclass=dir permissive=1 ====================================================== WARNING: possible circular locking dependency detected 6.2.0-rc7-next-20230210 #1 Not tainted ------------------------------------------------------ syz-executor.4/4629 is trying to acquire lock: ffff88801707e130 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_conn_del+0x11c/0x2c0 but task is already holding lock: ffffffff85bef368 (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.4/4629: #0: ffffffff85cabea8 (rfkill_global_mutex){+.+.}-{3:3}, at: rfkill_fop_write+0x161/0x540 #1: ffff888018c51028 (&hdev->req_lock){+.+.}-{3:3}, at: hci_rfkill_set_block+0x173/0x1c0 #2: ffff888018c50078 (&hdev->lock){+.+.}-{3:3}, at: hci_dev_close_sync+0x2e4/0xff0 #3: ffffffff85bef368 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_conn_hash_flush+0xcb/0x230 stack backtrace: CPU: 0 PID: 4629 Comm: syz-executor.4 Not tainted 6.2.0-rc7-next-20230210 #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:0x7f4f7d26bb19 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:00007f4f7a7e1188 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f4f7d37ef60 RCX: 00007f4f7d26bb19 RDX: 0000000000000008 RSI: 0000000020000080 RDI: 0000000000000003 RBP: 00007f4f7d2c5f6d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc86a0a42f R14: 00007f4f7a7e1300 R15: 0000000000022000 mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium device lo entered promiscuous mode mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium device lo left promiscuous mode device lo entered promiscuous mode mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium