kobject_add_internal failed for hci3:201 with -EEXIST, don't try to register things with the same name in the same directory. Bluetooth: hci3: failed to register connection device ================================================================== BUG: KASAN: use-after-free in l2cap_sock_new_connection_cb+0x1d4/0x284 net/bluetooth/l2cap_sock.c:1520 Read of size 8 at addr ffff0000db461548 by task kworker/u5:1/4320 CPU: 0 PID: 4320 Comm: kworker/u5:1 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/30/2025 Workqueue: hci3 hci_rx_work Call trace: dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack+0x30/0x40 lib/dump_stack.c:88 dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106 print_address_description+0x88/0x218 mm/kasan/report.c:316 print_report+0x50/0x68 mm/kasan/report.c:420 kasan_report+0xa8/0x100 mm/kasan/report.c:524 __asan_report_load8_noabort+0x2c/0x38 mm/kasan/report_generic.c:351 l2cap_sock_new_connection_cb+0x1d4/0x284 net/bluetooth/l2cap_sock.c:1520 l2cap_connect_cfm+0x2d4/0xd64 net/bluetooth/l2cap_core.c:8348 hci_connect_cfm+0x98/0x130 include/net/bluetooth/hci_core.h:1808 le_conn_complete_evt+0xd18/0x1220 net/bluetooth/hci_event.c:5871 hci_le_conn_complete_evt+0x114/0x3f8 net/bluetooth/hci_event.c:5897 hci_le_meta_evt+0x2c0/0x4a4 net/bluetooth/hci_event.c:7067 hci_event_func net/bluetooth/hci_event.c:7378 [inline] hci_event_packet+0x6ac/0xf08 net/bluetooth/hci_event.c:7433 hci_rx_work+0x324/0xaa0 net/bluetooth/hci_core.c:4083 process_one_work+0x7f4/0x13a8 kernel/workqueue.c:2292 worker_thread+0x8c8/0xfbc kernel/workqueue.c:2439 kthread+0x250/0x2d8 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850 Allocated by task 4320: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:52 kasan_save_alloc_info+0x28/0x34 mm/kasan/generic.c:505 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xa0/0xb8 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slab_common.c:936 [inline] __kmalloc+0xec/0x178 mm/slab_common.c:949 kmalloc include/linux/slab.h:568 [inline] sk_prot_alloc+0xc4/0x1f0 net/core/sock.c:2052 sk_alloc+0x44/0x390 net/core/sock.c:2108 bt_sock_alloc+0x4c/0x140 net/bluetooth/af_bluetooth.c:148 l2cap_sock_alloc net/bluetooth/l2cap_sock.c:1917 [inline] l2cap_sock_new_connection_cb+0xe4/0x284 net/bluetooth/l2cap_sock.c:1505 l2cap_connect_cfm+0x2d4/0xd64 net/bluetooth/l2cap_core.c:8348 hci_connect_cfm+0x98/0x130 include/net/bluetooth/hci_core.h:1808 le_conn_complete_evt+0xd18/0x1220 net/bluetooth/hci_event.c:5871 hci_le_conn_complete_evt+0x114/0x3f8 net/bluetooth/hci_event.c:5897 hci_le_meta_evt+0x2c0/0x4a4 net/bluetooth/hci_event.c:7067 hci_event_func net/bluetooth/hci_event.c:7378 [inline] hci_event_packet+0x6ac/0xf08 net/bluetooth/hci_event.c:7433 hci_rx_work+0x324/0xaa0 net/bluetooth/hci_core.c:4083 process_one_work+0x7f4/0x13a8 kernel/workqueue.c:2292 worker_thread+0x8c8/0xfbc kernel/workqueue.c:2439 kthread+0x250/0x2d8 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850 Freed by task 8928: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:52 kasan_save_free_info+0x3c/0x60 mm/kasan/generic.c:516 ____kasan_slab_free+0x148/0x1b0 mm/kasan/common.c:236 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:244 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1729 [inline] slab_free_freelist_hook+0x16c/0x1ec mm/slub.c:1755 slab_free mm/slub.c:3687 [inline] __kmem_cache_free+0xc0/0x224 mm/slub.c:3700 kfree+0xd0/0x1ac mm/slab_common.c:988 sk_prot_free net/core/sock.c:2091 [inline] __sk_destruct+0x4dc/0x780 net/core/sock.c:2177 sk_destruct net/core/sock.c:2192 [inline] __sk_free+0x320/0x430 net/core/sock.c:2203 sk_free+0x60/0xc8 net/core/sock.c:2214 sock_put include/net/sock.h:2072 [inline] l2cap_sock_kill+0x12c/0x234 net/bluetooth/l2cap_sock.c:1284 l2cap_sock_cleanup_listen+0xf4/0x28c net/bluetooth/l2cap_sock.c:1485 l2cap_sock_release+0x68/0x1c0 net/bluetooth/l2cap_sock.c:1446 __sock_release net/socket.c:654 [inline] sock_close+0xb4/0x1f8 net/socket.c:1400 __fput+0x1bc/0x7c0 fs/file_table.c:320 ____fput+0x20/0x30 fs/file_table.c:348 task_work_run+0x1ec/0x270 kernel/task_work.c:203 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] do_notify_resume+0x1f70/0x2b0c arch/arm64/kernel/signal.c:1137 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline] el0_svc+0x98/0x138 arch/arm64/kernel/entry-common.c:638 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 The buggy address belongs to the object at ffff0000db461000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1352 bytes inside of 2048-byte region [ffff0000db461000, ffff0000db461800) The buggy address belongs to the physical page: page:000000002c72c418 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11b460 head:000000002c72c418 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000010200 0000000000000000 dead000000000001 ffff0000c0002900 raw: 0000000000000000 0000000080080008 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000db461400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000db461480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0000db461500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000db461580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000db461600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ------------[ cut here ]------------ refcount_t: addition on 0; use-after-free. WARNING: CPU: 0 PID: 4320 at lib/refcount.c:25 refcount_warn_saturate+0x134/0x1f8 lib/refcount.c:25 Modules linked in: CPU: 0 PID: 4320 Comm: kworker/u5:1 Tainted: G B syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/30/2025 Workqueue: hci3 hci_rx_work pstate: 62400005 (nZCv daif +PAN -UAO +TCO -DIT -SSBS BTYPE=--) pc : refcount_warn_saturate+0x134/0x1f8 lib/refcount.c:25 lr : refcount_warn_saturate+0x134/0x1f8 lib/refcount.c:25 sp : ffff800020797570 x29: ffff800020797570 x28: dfff800000000000 x27: 0000000000000000 x26: 1fffe0001b68c807 x25: 1fffe0001aa1b200 x24: dfff800000000000 x23: 0000000000000000 x22: ffff0000db464018 x21: ffff0000db46403f x20: ffff0000db464018 x19: ffff800017a8a000 x18: ffff800011abbcc0 x17: 1fffe00033ed797e x16: ffff800008042c8c x15: ffff8000150bd000 x14: 0000000000000100 x13: 0000000000000120 x12: 0000000000ff0100 x11: ff00800008047f18 x10: 0000000040000002 x9 : b1acf6c70d374000 x8 : b1acf6c70d374000 x7 : 0000000000000004 x6 : ffff800008251e10 x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000000 x2 : ffff800020797100 x1 : 0000000000000000 x0 : ffff800008251ea4 Call trace: refcount_warn_saturate+0x134/0x1f8 lib/refcount.c:25 __refcount_add include/linux/refcount.h:-1 [inline] __refcount_inc include/linux/refcount.h:250 [inline] refcount_inc include/linux/refcount.h:267 [inline] kref_get include/linux/kref.h:45 [inline] l2cap_chan_hold net/bluetooth/l2cap_core.c:522 [inline] __l2cap_chan_add+0x4cc/0x7c8 net/bluetooth/l2cap_core.c:652 l2cap_connect_cfm+0x380/0xd64 net/bluetooth/l2cap_core.c:8355 hci_connect_cfm+0x98/0x130 include/net/bluetooth/hci_core.h:1808 le_conn_complete_evt+0xd18/0x1220 net/bluetooth/hci_event.c:5871 hci_le_conn_complete_evt+0x114/0x3f8 net/bluetooth/hci_event.c:5897 hci_le_meta_evt+0x2c0/0x4a4 net/bluetooth/hci_event.c:7067 hci_event_func net/bluetooth/hci_event.c:7378 [inline] hci_event_packet+0x6ac/0xf08 net/bluetooth/hci_event.c:7433 hci_rx_work+0x324/0xaa0 net/bluetooth/hci_core.c:4083 process_one_work+0x7f4/0x13a8 kernel/workqueue.c:2292 worker_thread+0x8c8/0xfbc kernel/workqueue.c:2439 kthread+0x250/0x2d8 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850 irq event stamp: 4273 hardirqs last enabled at (4273): [] raw_spin_rq_unlock_irq kernel/sched/sched.h:1367 [inline] hardirqs last enabled at (4273): [] finish_lock_switch+0xb0/0x1c4 kernel/sched/core.c:5003 hardirqs last disabled at (4272): [] __schedule+0x298/0x1b18 kernel/sched/core.c:6459 softirqs last enabled at (3714): [] spin_unlock_bh include/linux/spinlock.h:396 [inline] softirqs last enabled at (3714): [] release_sock+0x16c/0x1bc net/core/sock.c:3519 softirqs last disabled at (3706): [] spin_lock_bh include/linux/spinlock.h:356 [inline] softirqs last disabled at (3706): [] release_sock+0x34/0x1bc net/core/sock.c:3506 ---[ end trace 0000000000000000 ]--- ------------[ cut here ]------------ ODEBUG: assert_init not available (active state 0) object type: timer_list hint: l2cap_chan_timeout+0x0/0x280 net/bluetooth/l2cap_core.c:-1 WARNING: CPU: 0 PID: 4320 at lib/debugobjects.c:518 debug_print_object+0x148/0x1d4 lib/debugobjects.c:515 Modules linked in: CPU: 0 PID: 4320 Comm: kworker/u5:1 Tainted: G B W syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/30/2025 Workqueue: hci3 hci_rx_work pstate: 624000c5 (nZCv daIF +PAN -UAO +TCO -DIT -SSBS BTYPE=--) pc : debug_print_object+0x148/0x1d4 lib/debugobjects.c:515 lr : debug_print_object+0x148/0x1d4 lib/debugobjects.c:515 sp : ffff800020797290 x29: ffff800020797290 x28: 1fffe0001b68c806 x27: 0000000000000000 x26: ffff8000150c0000 x25: ffff8000083adff4 x24: dfff800000000000 x23: 0000000000000000 x22: ffff800010bd904c x21: ffff800011faaec0 x20: ffff800011adace0 x19: ffff800011faaa00 x18: ffff800011abbcc0 x17: 203a657079742074 x16: ffff8000082e7b1c x15: 0000000000000002 x14: 00000000ffffffff x13: 0000000000000001 x12: 0000000000100000 x11: 00000000000700cb x10: ffff80003203a000 x9 : b1acf6c70d374000 x8 : b1acf6c70d374000 x7 : 0000000000000001 x6 : 0000000000000001 x5 : ffff800020796d18 x4 : ffff8000151a4820 x3 : ffff80000852e158 x2 : 0000000000000001 x1 : 0000000100000000 x0 : 0000000000000000 Call trace: debug_print_object+0x148/0x1d4 lib/debugobjects.c:515 debug_object_assert_init+0x250/0x2c8 lib/debugobjects.c:900 debug_timer_assert_init kernel/time/timer.c:792 [inline] debug_assert_init kernel/time/timer.c:837 [inline] timer_delete+0x48/0x1e8 kernel/time/timer.c:1277 del_timer include/linux/timer.h:211 [inline] try_to_grab_pending+0xa4/0x65c kernel/workqueue.c:1278 __cancel_work+0x44/0x224 kernel/workqueue.c:3251 cancel_delayed_work+0x24/0x38 kernel/workqueue.c:3289 l2cap_clear_timer include/net/bluetooth/l2cap.h:892 [inline] l2cap_chan_ready net/bluetooth/l2cap_core.c:1398 [inline] l2cap_le_start+0x768/0x1010 net/bluetooth/l2cap_core.c:1522 l2cap_conn_ready net/bluetooth/l2cap_core.c:1792 [inline] l2cap_connect_cfm+0x578/0xd64 net/bluetooth/l2cap_core.c:8365 hci_connect_cfm+0x98/0x130 include/net/bluetooth/hci_core.h:1808 le_conn_complete_evt+0xd18/0x1220 net/bluetooth/hci_event.c:5871 hci_le_conn_complete_evt+0x114/0x3f8 net/bluetooth/hci_event.c:5897 hci_le_meta_evt+0x2c0/0x4a4 net/bluetooth/hci_event.c:7067 hci_event_func net/bluetooth/hci_event.c:7378 [inline] hci_event_packet+0x6ac/0xf08 net/bluetooth/hci_event.c:7433 hci_rx_work+0x324/0xaa0 net/bluetooth/hci_core.c:4083 process_one_work+0x7f4/0x13a8 kernel/workqueue.c:2292 worker_thread+0x8c8/0xfbc kernel/workqueue.c:2439 kthread+0x250/0x2d8 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850 irq event stamp: 4273 hardirqs last enabled at (4273): [] raw_spin_rq_unlock_irq kernel/sched/sched.h:1367 [inline] hardirqs last enabled at (4273): [] finish_lock_switch+0xb0/0x1c4 kernel/sched/core.c:5003 hardirqs last disabled at (4272): [] __schedule+0x298/0x1b18 kernel/sched/core.c:6459 softirqs last enabled at (3714): [] spin_unlock_bh include/linux/spinlock.h:396 [inline] softirqs last enabled at (3714): [] release_sock+0x16c/0x1bc net/core/sock.c:3519 softirqs last disabled at (3706): [] spin_lock_bh include/linux/spinlock.h:356 [inline] softirqs last disabled at (3706): [] release_sock+0x34/0x1bc net/core/sock.c:3506 ---[ end trace 0000000000000000 ]--- Unable to handle kernel paging request at virtual address dfff800000000013 KASAN: null-ptr-deref in range [0x0000000000000098-0x000000000000009f] Mem abort info: ESR = 0x0000000096000006 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x06: level 2 translation fault Data abort info: ISV = 0, ISS = 0x00000006 CM = 0, WnR = 0 [dfff800000000013] address between user and kernel address ranges Internal error: Oops: 0000000096000006 [#1] PREEMPT SMP Modules linked in: CPU: 0 PID: 4320 Comm: kworker/u5:1 Tainted: G B W syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/30/2025 Workqueue: hci3 hci_rx_work pstate: 62400005 (nZCv daif +PAN -UAO +TCO -DIT -SSBS BTYPE=--) pc : debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline] pc : do_raw_spin_lock+0x80/0x2ec kernel/locking/spinlock_debug.c:114 lr : __raw_spin_lock_bh include/linux/spinlock_api_smp.h:127 [inline] lr : _raw_spin_lock_bh+0x5c/0x6c kernel/locking/spinlock.c:178 sp : ffff800020797320 x29: ffff8000207973b0 x28: 1fffe0001b68c806 x27: ffff0000db464030 x26: dfff800000000000 x25: 1fffe0001b68c804 x24: 1fffe0001b68c800 x23: dfff800000000000 x22: 1ffff000040f2e68 x21: 0000000000000000 x20: 000000000000009c x19: 0000000000000098 x18: ffff800011abbcc0 x17: 203a657079742074 x16: ffff8000082e7648 x15: 0000000000000002 x14: 00000000ffffffff x13: 0000000000000001 x12: 0000000000100000 x11: ffff800020797340 x10: ffff8000149e6967 x9 : f3f3f304f1f1f1f1 x8 : 0000000000000013 x7 : 0000000000000000 x6 : ffff80000fcd7944 x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000000 x2 : 0000000000000000 x1 : ffff800011faa3e0 x0 : 0000000000000098 Call trace: debug_spin_lock_before kernel/locking/spinlock_debug.c:-1 [inline] do_raw_spin_lock+0x80/0x2ec kernel/locking/spinlock_debug.c:114 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:127 [inline] _raw_spin_lock_bh+0x5c/0x6c kernel/locking/spinlock.c:178 spin_lock_bh include/linux/spinlock.h:356 [inline] lock_sock_nested+0x88/0x130 net/core/sock.c:3496 lock_sock include/net/sock.h:1792 [inline] l2cap_sock_ready_cb+0x4c/0x130 net/bluetooth/l2cap_sock.c:1697 l2cap_chan_ready net/bluetooth/l2cap_core.c:1410 [inline] l2cap_le_start+0x8f0/0x1010 net/bluetooth/l2cap_core.c:1522 l2cap_conn_ready net/bluetooth/l2cap_core.c:1792 [inline] l2cap_connect_cfm+0x578/0xd64 net/bluetooth/l2cap_core.c:8365 hci_connect_cfm+0x98/0x130 include/net/bluetooth/hci_core.h:1808 le_conn_complete_evt+0xd18/0x1220 net/bluetooth/hci_event.c:5871 hci_le_conn_complete_evt+0x114/0x3f8 net/bluetooth/hci_event.c:5897 hci_le_meta_evt+0x2c0/0x4a4 net/bluetooth/hci_event.c:7067 hci_event_func net/bluetooth/hci_event.c:7378 [inline] hci_event_packet+0x6ac/0xf08 net/bluetooth/hci_event.c:7433 hci_rx_work+0x324/0xaa0 net/bluetooth/hci_core.c:4083 process_one_work+0x7f4/0x13a8 kernel/workqueue.c:2292 worker_thread+0x8c8/0xfbc kernel/workqueue.c:2439 kthread+0x250/0x2d8 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850 Code: f2de6089 aa0003f3 f2fe7e69 f8376ac9 (38f76908) ---[ end trace 0000000000000000 ]--- ---------------- Code disassembly (best guess): 0: f2de6089 movk x9, #0xf304, lsl #32 4: aa0003f3 mov x19, x0 8: f2fe7e69 movk x9, #0xf3f3, lsl #48 c: f8376ac9 str x9, [x22, x23] * 10: 38f76908 ldrsb w8, [x8, x23] <-- trapping instruction