Bluetooth: hci2: Opcode 0x0c1a failed: -110 Bluetooth: hci2: Error when powering off device on rfkill (-110) ------------[ cut here ]------------ refcount_t: underflow; use-after-free. WARNING: lib/refcount.c:28 at refcount_warn_saturate+0xc9/0x120 lib/refcount.c:28, CPU#1: syz.4.5947/24168 Modules linked in: CPU: 1 UID: 0 PID: 24168 Comm: syz.4.5947 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~bpo12+1 04/01/2014 RIP: 0010:refcount_warn_saturate+0xc9/0x120 lib/refcount.c:28 Code: 5d e9 4b e9 11 fd e8 46 e9 11 fd 48 8d 3d 0f 34 e5 0b 67 48 0f b9 3a 5b 5d e9 33 e9 11 fd e8 2e e9 11 fd 48 8d 3d 07 34 e5 0b <67> 48 0f b9 3a 5b 5d e9 1b e9 11 fd e8 16 e9 11 fd 48 8d 3d ff 33 RSP: 0018:ffffc90007e9f8c8 EFLAGS: 00010287 RAX: 0000000000004bd2 RBX: 0000000000000003 RCX: ffffc90035542000 RDX: 0000000000080000 RSI: ffffffff84ad1322 RDI: ffffffff90924730 RBP: ffff88803d83a478 R08: 0000000000000005 R09: 0000000000000004 R10: 0000000000000003 R11: 0000000000000001 R12: ffff88802d9aa000 R13: ffff88803d83a478 R14: ffffffff85e70530 R15: ffffffff906c1260 FS: 00007fe6a770f6c0(0000) GS:ffff8880d69f1000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffb55543e9c CR3: 000000002b111000 CR4: 0000000000352ef0 DR0: ffffffffffffffff DR1: 00000000000001f8 DR2: 0000000000000083 DR3: ffffffffefffff15 DR6: 00000000ffff0ff0 DR7: 0000000000000400 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+0x11b/0x1b0 lib/klist.c:217 klist_del lib/klist.c:230 [inline] klist_remove+0x13f/0x2e0 lib/klist.c:249 device_move+0x12d/0x1160 drivers/base/core.c:4615 hci_conn_del_sysfs+0xaa/0x1a0 net/bluetooth/hci_sysfs.c:75 hci_conn_cleanup net/bluetooth/hci_conn.c:173 [inline] hci_conn_del+0x680/0x11d0 net/bluetooth/hci_conn.c:1234 hci_conn_hash_flush+0x186/0x290 net/bluetooth/hci_conn.c:2638 hci_dev_close_sync+0x601/0x1260 net/bluetooth/hci_sync.c:5327 hci_dev_do_close+0x2e/0xc0 net/bluetooth/hci_core.c:501 hci_rfkill_set_block+0x225/0x3b0 net/bluetooth/hci_core.c:929 rfkill_set_block+0x1fe/0x550 net/rfkill/core.c:346 rfkill_fop_write+0x2c0/0x580 net/rfkill/core.c:1301 vfs_write+0x2a0/0x11d0 fs/read_write.c:684 ksys_write+0x1f8/0x250 fs/read_write.c:738 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fe6a678f7c9 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fe6a770f038 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fe6a69e5fa0 RCX: 00007fe6a678f7c9 RDX: 0000000000000008 RSI: 0000200000000300 RDI: 0000000000000006 RBP: 00007fe6a6813f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fe6a69e6038 R14: 00007fe6a69e5fa0 R15: 00007fffd8da22f8 ---------------- Code disassembly (best guess): 0: 5d pop %rbp 1: e9 4b e9 11 fd jmp 0xfd11e951 6: e8 46 e9 11 fd call 0xfd11e951 b: 48 8d 3d 0f 34 e5 0b lea 0xbe5340f(%rip),%rdi # 0xbe53421 12: 67 48 0f b9 3a ud1 (%edx),%rdi 17: 5b pop %rbx 18: 5d pop %rbp 19: e9 33 e9 11 fd jmp 0xfd11e951 1e: e8 2e e9 11 fd call 0xfd11e951 23: 48 8d 3d 07 34 e5 0b lea 0xbe53407(%rip),%rdi # 0xbe53431 * 2a: 67 48 0f b9 3a ud1 (%edx),%rdi <-- trapping instruction 2f: 5b pop %rbx 30: 5d pop %rbp 31: e9 1b e9 11 fd jmp 0xfd11e951 36: e8 16 e9 11 fd call 0xfd11e951 3b: 48 rex.W 3c: 8d .byte 0x8d 3d: 3d .byte 0x3d 3e: ff 33 push (%rbx)