================================================================== BUG: KFENCE: use-after-free read in hci_conn_hash_flush+0x1bb/0x270 net/bluetooth/hci_conn.c:2470 Use-after-free read at 0xffff88823bdc8000 (in kfence-#227): hci_conn_hash_flush+0x1bb/0x270 net/bluetooth/hci_conn.c:2470 hci_dev_close_sync+0x5fb/0x1200 net/bluetooth/hci_sync.c:4941 hci_dev_do_close+0x31/0x70 net/bluetooth/hci_core.c:554 hci_unregister_dev+0x1ce/0x580 net/bluetooth/hci_core.c:2703 vhci_release+0x80/0xf0 drivers/bluetooth/hci_vhci.c:669 __fput+0x27c/0xa90 fs/file_table.c:321 task_work_run+0x16f/0x270 kernel/task_work.c:179 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xad3/0x2960 kernel/exit.c:871 do_group_exit+0xd4/0x2a0 kernel/exit.c:1021 __do_sys_exit_group kernel/exit.c:1032 [inline] __se_sys_exit_group kernel/exit.c:1030 [inline] __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1030 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd kfence-#227: 0xffff88823bdc8000-0xffff88823bdc8a37, size=2616, cache=kmalloc-4k allocated by task 8824 on cpu 0 at 288.694848s: kfence_alloc include/linux/kfence.h:128 [inline] slab_alloc_node mm/slub.c:3437 [inline] __kmem_cache_alloc_node+0x234/0x320 mm/slub.c:3490 kmalloc_trace+0x26/0xe0 mm/slab_common.c:1057 kmalloc include/linux/slab.h:559 [inline] kzalloc include/linux/slab.h:680 [inline] hci_conn_add+0xb8/0x16b0 net/bluetooth/hci_conn.c:986 hci_connect_sco+0x3c7/0x1050 net/bluetooth/hci_conn.c:1663 sco_connect net/bluetooth/sco.c:264 [inline] sco_sock_connect+0x2d7/0xae0 net/bluetooth/sco.c:610 __sys_connect_file+0x153/0x1a0 net/socket.c:2003 __sys_connect+0x165/0x1a0 net/socket.c:2020 __do_sys_connect net/socket.c:2030 [inline] __se_sys_connect net/socket.c:2027 [inline] __x64_sys_connect+0x73/0xb0 net/socket.c:2027 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd freed by task 5047 on cpu 1 at 487.361730s: device_release+0xa3/0x240 drivers/base/core.c:2484 kobject_cleanup lib/kobject.c:683 [inline] kobject_release lib/kobject.c:714 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1c2/0x4d0 lib/kobject.c:731 put_device+0x1f/0x30 drivers/base/core.c:3733 hci_conn_del+0x1e5/0x950 net/bluetooth/hci_conn.c:1162 hci_conn_unlink+0x2ce/0x460 net/bluetooth/hci_conn.c:1109 hci_conn_unlink+0x362/0x460 net/bluetooth/hci_conn.c:1087 hci_conn_hash_flush+0x19b/0x270 net/bluetooth/hci_conn.c:2479 hci_dev_close_sync+0x5fb/0x1200 net/bluetooth/hci_sync.c:4941 hci_dev_do_close+0x31/0x70 net/bluetooth/hci_core.c:554 hci_unregister_dev+0x1ce/0x580 net/bluetooth/hci_core.c:2703 vhci_release+0x80/0xf0 drivers/bluetooth/hci_vhci.c:669 __fput+0x27c/0xa90 fs/file_table.c:321 task_work_run+0x16f/0x270 kernel/task_work.c:179 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xad3/0x2960 kernel/exit.c:871 do_group_exit+0xd4/0x2a0 kernel/exit.c:1021 __do_sys_exit_group kernel/exit.c:1032 [inline] __se_sys_exit_group kernel/exit.c:1030 [inline] __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1030 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd CPU: 1 PID: 5047 Comm: syz-executor.3 Not tainted 6.3.0-syzkaller-13380-g94e86ef1b801 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023 RIP: 0010:hci_conn_hash_flush+0x1bb/0x270 net/bluetooth/hci_conn.c:2470 Code: 6d f8 4c 89 e7 e8 c5 c6 ff ff 4c 89 e7 e8 bd a7 ff ff 4c 89 e8 48 c1 e8 03 80 3c 28 00 0f 85 88 00 00 00 4c 39 2c 24 4d 89 ec <49> 8b 45 00 74 08 49 89 c5 e9 cd fe ff ff 48 83 c4 08 5b 5d 41 5c RSP: 0018:ffffc90003ebfb68 EFLAGS: 00010287 RAX: 1ffff110477b9000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: ffff888023ebbb80 RSI: ffffffff891605f5 RDI: ffffffff8c131a08 RBP: dffffc0000000000 R08: 0000000000000000 R09: ffffffff91527dd7 R10: 0000000000000001 R11: 0000000000094001 R12: ffff88823bdc8000 R13: ffff88823bdc8000 R14: fffffbfff1c68770 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffff88823bdc8000 CR3: 000000007bd2b000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: hci_dev_close_sync+0x5fb/0x1200 net/bluetooth/hci_sync.c:4941 hci_dev_do_close+0x31/0x70 net/bluetooth/hci_core.c:554 hci_unregister_dev+0x1ce/0x580 net/bluetooth/hci_core.c:2703 vhci_release+0x80/0xf0 drivers/bluetooth/hci_vhci.c:669 __fput+0x27c/0xa90 fs/file_table.c:321 task_work_run+0x16f/0x270 kernel/task_work.c:179 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xad3/0x2960 kernel/exit.c:871 do_group_exit+0xd4/0x2a0 kernel/exit.c:1021 __do_sys_exit_group kernel/exit.c:1032 [inline] __se_sys_exit_group kernel/exit.c:1030 [inline] __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1030 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f271128c169 Code: Unable to access opcode bytes at 0x7f271128c13f. RSP: 002b:00007ffcdcf05878 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 00007ffcdcf05a20 RCX: 00007f271128c169 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000043 RBP: 0000000000000000 R08: 0000000000000025 R09: 00007ffcdcf05a20 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f27112e7c72 R13: 000000000000001c R14: 0000000000000002 R15: 00007ffcdcf05a60 ================================================================== ---------------- Code disassembly (best guess): 0: 6d insl (%dx),%es:(%rdi) 1: f8 clc 2: 4c 89 e7 mov %r12,%rdi 5: e8 c5 c6 ff ff callq 0xffffc6cf a: 4c 89 e7 mov %r12,%rdi d: e8 bd a7 ff ff callq 0xffffa7cf 12: 4c 89 e8 mov %r13,%rax 15: 48 c1 e8 03 shr $0x3,%rax 19: 80 3c 28 00 cmpb $0x0,(%rax,%rbp,1) 1d: 0f 85 88 00 00 00 jne 0xab 23: 4c 39 2c 24 cmp %r13,(%rsp) 27: 4d 89 ec mov %r13,%r12 * 2a: 49 8b 45 00 mov 0x0(%r13),%rax <-- trapping instruction 2e: 74 08 je 0x38 30: 49 89 c5 mov %rax,%r13 33: e9 cd fe ff ff jmpq 0xffffff05 38: 48 83 c4 08 add $0x8,%rsp 3c: 5b pop %rbx 3d: 5d pop %rbp 3e: 41 5c pop %r12