Bluetooth: hci4: Opcode 0x0c1a failed: -4 Bluetooth: hci4: Error when powering off device on rfkill (-4) ------------[ cut here ]------------ refcount_t: underflow; use-after-free. WARNING: lib/refcount.c:28 at refcount_warn_saturate+0xf4/0x130 lib/refcount.c:28, CPU#0: syz.9.2863/15954 Modules linked in: CPU: 0 UID: 0 PID: 15954 Comm: syz.9.2863 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 RIP: 0010:refcount_warn_saturate+0xf4/0x130 lib/refcount.c:28 Code: 06 e8 30 fe 0e fd 48 8d 3d a9 b5 e8 0b 67 48 0f b9 3a e8 1f fe 0e fd 5b 5d c3 cc cc cc cc e8 13 fe 0e fd 48 8d 3d 9c b5 e8 0b <67> 48 0f b9 3a e8 02 fe 0e fd 5b 5d e9 1b 8a 94 06 e8 f6 fd 0e fd RSP: 0018:ffffc90003c578b8 EFLAGS: 00010246 RAX: 0000000000080000 RBX: ffff88802fc0c478 RCX: ffffc90027cf9000 RDX: 0000000000080000 RSI: ffffffff84f9b0ed RDI: ffffffff90e26690 RBP: 0000000000000003 R08: 0000000000000005 R09: 0000000000000004 R10: 0000000000000003 R11: 0000000000000000 R12: ffff88802cdb2c00 R13: ffff88802fc0c478 R14: ffffffff863585e0 R15: dffffc0000000000 FS: 00007fda211736c0(0000) GS:ffff8880d636d000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ff9fbf419c0 CR3: 00000000303ab000 CR4: 0000000000352ef0 Call Trace: __refcount_sub_and_test include/linux/refcount.h:400 [inline] __refcount_dec_and_test include/linux/refcount.h:432 [inline] refcount_dec_and_test include/linux/refcount.h:450 [inline] kref_put include/linux/kref.h:64 [inline] klist_dec_and_del lib/klist.c:206 [inline] klist_put+0x18a/0x1d0 lib/klist.c:217 klist_del lib/klist.c:230 [inline] klist_remove+0x14c/0x2e0 lib/klist.c:249 device_move+0x12d/0x1140 drivers/base/core.c:4632 hci_conn_del_sysfs+0x86/0x1a0 net/bluetooth/hci_sysfs.c:75 hci_conn_cleanup net/bluetooth/hci_conn.c:173 [inline] hci_conn_del+0x506/0x1180 net/bluetooth/hci_conn.c:1307 hci_conn_hash_flush+0x186/0x280 net/bluetooth/hci_conn.c:2735 hci_dev_close_sync+0x5a7/0x1240 net/bluetooth/hci_sync.c:5368 hci_dev_do_close+0x2e/0xb0 net/bluetooth/hci_core.c:502 hci_rfkill_set_block+0x225/0x3a0 net/bluetooth/hci_core.c:930 rfkill_set_block+0x205/0x510 net/rfkill/core.c:360 rfkill_fop_write+0x2c0/0x580 net/rfkill/core.c:1314 vfs_write+0x2aa/0x1070 fs/read_write.c:686 ksys_write+0x1f8/0x250 fs/read_write.c:740 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x10b/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fda2039ce59 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fda21173028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fda20615fa0 RCX: 00007fda2039ce59 RDX: 0000000000000008 RSI: 0000200000000080 RDI: 0000000000000003 RBP: 00007fda20432d6f R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fda20616038 R14: 00007fda20615fa0 R15: 00007ffc64467978 ---------------- Code disassembly (best guess), 1 bytes skipped: 0: e8 30 fe 0e fd call 0xfd0efe35 5: 48 8d 3d a9 b5 e8 0b lea 0xbe8b5a9(%rip),%rdi # 0xbe8b5b5 c: 67 48 0f b9 3a ud1 (%edx),%rdi 11: e8 1f fe 0e fd call 0xfd0efe35 16: 5b pop %rbx 17: 5d pop %rbp 18: c3 ret 19: cc int3 1a: cc int3 1b: cc int3 1c: cc int3 1d: e8 13 fe 0e fd call 0xfd0efe35 22: 48 8d 3d 9c b5 e8 0b lea 0xbe8b59c(%rip),%rdi # 0xbe8b5c5 * 29: 67 48 0f b9 3a ud1 (%edx),%rdi <-- trapping instruction 2e: e8 02 fe 0e fd call 0xfd0efe35 33: 5b pop %rbx 34: 5d pop %rbp 35: e9 1b 8a 94 06 jmp 0x6948a55 3a: e8 f6 fd 0e fd call 0xfd0efe35