kobject_add_internal failed for hci0:201 with -EEXIST, don't try to register things with the same name in the same directory. Bluetooth: hci0: failed to register connection device ================================================================== BUG: KASAN: use-after-free in l2cap_sock_new_connection_cb+0x224/0x304 net/bluetooth/l2cap_sock.c:1491 Read of size 8 at addr ffff0000f0ef2548 by task kworker/u5:4/4052 CPU: 1 PID: 4052 Comm: kworker/u5:4 Not tainted 5.15.189-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/30/2025 Workqueue: hci0 hci_rx_work Call trace: dump_backtrace+0x0/0x43c arch/arm64/kernel/stacktrace.c:152 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216 __dump_stack+0x30/0x40 lib/dump_stack.c:88 dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106 print_address_description+0x78/0x30c mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0xec/0x15c mm/kasan/report.c:451 __asan_report_load8_noabort+0x44/0x50 mm/kasan/report_generic.c:309 l2cap_sock_new_connection_cb+0x224/0x304 net/bluetooth/l2cap_sock.c:1491 l2cap_connect_cfm+0x2d4/0xd64 net/bluetooth/l2cap_core.c:8287 hci_connect_cfm include/net/bluetooth/hci_core.h:1505 [inline] le_conn_complete_evt+0xa7c/0x11bc net/bluetooth/hci_event.c:5429 hci_le_conn_complete_evt net/bluetooth/hci_event.c:5454 [inline] hci_le_meta_evt+0x85c/0x3010 net/bluetooth/hci_event.c:6176 hci_event_packet+0xd10/0x11bc net/bluetooth/hci_event.c:6525 hci_rx_work+0x1cc/0x880 net/bluetooth/hci_core.c:5160 process_one_work+0x79c/0x1140 kernel/workqueue.c:2310 worker_thread+0x8f4/0x101c kernel/workqueue.c:2457 kthread+0x374/0x454 kernel/kthread.c:334 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:855 Allocated by task 4052: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] __kasan_kmalloc+0xb0/0xf0 mm/kasan/common.c:522 kasan_kmalloc include/linux/kasan.h:264 [inline] __kmalloc+0x298/0x44c mm/slub.c:4407 kmalloc include/linux/slab.h:609 [inline] sk_prot_alloc+0xc4/0x1f0 net/core/sock.c:1864 sk_alloc+0x40/0x388 net/core/sock.c:1917 l2cap_sock_alloc net/bluetooth/l2cap_sock.c:1861 [inline] l2cap_sock_new_connection_cb+0xe0/0x304 net/bluetooth/l2cap_sock.c:1476 l2cap_connect_cfm+0x2d4/0xd64 net/bluetooth/l2cap_core.c:8287 hci_connect_cfm include/net/bluetooth/hci_core.h:1505 [inline] le_conn_complete_evt+0xa7c/0x11bc net/bluetooth/hci_event.c:5429 hci_le_conn_complete_evt net/bluetooth/hci_event.c:5454 [inline] hci_le_meta_evt+0x85c/0x3010 net/bluetooth/hci_event.c:6176 hci_event_packet+0xd10/0x11bc net/bluetooth/hci_event.c:6525 hci_rx_work+0x1cc/0x880 net/bluetooth/hci_core.c:5160 process_one_work+0x79c/0x1140 kernel/workqueue.c:2310 worker_thread+0x8f4/0x101c kernel/workqueue.c:2457 kthread+0x374/0x454 kernel/kthread.c:334 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:855 Freed by task 8793: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x84 mm/kasan/common.c:46 kasan_set_free_info+0x28/0x4c mm/kasan/generic.c:360 ____kasan_slab_free+0x118/0x164 mm/kasan/common.c:366 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1705 [inline] slab_free_freelist_hook+0x128/0x1e8 mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kfree+0x170/0x40c mm/slub.c:4559 sk_prot_free net/core/sock.c:1900 [inline] __sk_destruct+0x41c/0x604 net/core/sock.c:1986 sk_destruct net/core/sock.c:2001 [inline] __sk_free+0x320/0x430 net/core/sock.c:2012 sk_free+0x68/0xdc net/core/sock.c:2023 sock_put include/net/sock.h:1939 [inline] l2cap_sock_kill+0x114/0x228 net/bluetooth/l2cap_sock.c:1258 l2cap_sock_cleanup_listen+0xf4/0x28c net/bluetooth/l2cap_sock.c:1456 l2cap_sock_release+0x5c/0x1ac net/bluetooth/l2cap_sock.c:1419 __sock_release net/socket.c:649 [inline] sock_close+0xb4/0x1f8 net/socket.c:1336 __fput+0x1c0/0x7f8 fs/file_table.c:311 ____fput+0x20/0x30 fs/file_table.c:339 task_work_run+0x12c/0x1e0 kernel/task_work.c:188 get_signal+0x1240/0x1340 kernel/signal.c:2672 do_signal arch/arm64/kernel/signal.c:893 [inline] do_notify_resume+0x35c/0x3128 arch/arm64/kernel/signal.c:946 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:133 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:138 [inline] el0_svc+0xf0/0x1e0 arch/arm64/kernel/entry-common.c:609 el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 Last potentially related work creation: kasan_save_stack+0x38/0x68 mm/kasan/common.c:38 kasan_record_aux_stack+0xcc/0x114 mm/kasan/generic.c:348 kvfree_call_rcu+0xb8/0x66c kernel/rcu/tree.c:3600 drop_sysctl_table+0x274/0x39c fs/proc/proc_sysctl.c:1685 unregister_sysctl_table+0x94/0x134 fs/proc/proc_sysctl.c:1723 unregister_net_sysctl_table+0x20/0x30 net/sysctl_net.c:175 __addrconf_sysctl_unregister net/ipv6/addrconf.c:7131 [inline] addrconf_sysctl_unregister net/ipv6/addrconf.c:7159 [inline] addrconf_ifdown+0x12fc/0x1688 net/ipv6/addrconf.c:3929 addrconf_notify+0x2f4/0xc6c net/ipv6/addrconf.c:-1 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0xd4/0x164 kernel/notifier.c:391 call_netdevice_notifiers_info net/core/dev.c:2049 [inline] call_netdevice_notifiers_extack net/core/dev.c:2061 [inline] call_netdevice_notifiers net/core/dev.c:2075 [inline] unregister_netdevice_many+0xe10/0x17d0 net/core/dev.c:11134 ip6gre_exit_batch_net+0x418/0x468 net/ipv6/ip6_gre.c:1650 ops_exit_list net/core/net_namespace.c:177 [inline] cleanup_net+0x644/0xa98 net/core/net_namespace.c:635 process_one_work+0x79c/0x1140 kernel/workqueue.c:2310 worker_thread+0x8f4/0x101c kernel/workqueue.c:2457 kthread+0x374/0x454 kernel/kthread.c:334 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:855 The buggy address belongs to the object at ffff0000f0ef2000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1352 bytes inside of 2048-byte region [ffff0000f0ef2000, ffff0000f0ef2800) The buggy address belongs to the page: page:00000000c6803c8b refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x130ef0 head:00000000c6803c8b order:3 compound_mapcount:0 compound_pincount:0 flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000010200 fffffc00039cf000 0000000200000002 ffff0000c0002900 raw: 0000000000000000 0000000080080008 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000f0ef2400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000f0ef2480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0000f0ef2500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000f0ef2580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000f0ef2600: 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: 4052 at lib/refcount.c:25 refcount_warn_saturate+0x134/0x1f8 lib/refcount.c:25 Modules linked in: CPU: 0 PID: 4052 Comm: kworker/u5:4 Tainted: G B 5.15.189-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/30/2025 Workqueue: hci0 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 : ffff80001f0e7480 x29: ffff80001f0e7480 x28: dfff800000000000 x27: 0000000000000000 x26: 1fffe0001e1de207 x25: 1fffe0001a317600 x24: dfff800000000000 x23: ffff0000d4774021 x22: 00000000ffffffff x21: ffff0000f0ef103f x20: ffff0000f0ef1018 x19: ffff8000165b2000 x18: 0000000000000002 x17: 0000000040000000 x16: ffff8000082d6448 x15: 0000000000000002 x14: 0000000000ff0100 x13: ffffffffffffffff x12: 0000000000ff0100 x11: 0000000000000000 x10: 0000000000000000 x9 : f0a5d96b902b4500 x8 : f0a5d96b902b4500 x7 : 0000000000000000 x6 : ffff80000824599c x5 : 0000000000000000 x4 : 0000000000000000 x3 : 0000000000000010 x2 : 0000000000000008 x1 : 0000000100000000 x0 : 000000000000002a 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+0xa4/0x13c net/bluetooth/l2cap_core.c:519 __l2cap_chan_add+0x278/0x6e4 net/bluetooth/l2cap_core.c:628 l2cap_connect_cfm+0x380/0xd64 net/bluetooth/l2cap_core.c:8294 hci_connect_cfm include/net/bluetooth/hci_core.h:1505 [inline] le_conn_complete_evt+0xa7c/0x11bc net/bluetooth/hci_event.c:5429 hci_le_conn_complete_evt net/bluetooth/hci_event.c:5454 [inline] hci_le_meta_evt+0x85c/0x3010 net/bluetooth/hci_event.c:6176 hci_event_packet+0xd10/0x11bc net/bluetooth/hci_event.c:6525 hci_rx_work+0x1cc/0x880 net/bluetooth/hci_core.c:5160 process_one_work+0x79c/0x1140 kernel/workqueue.c:2310 worker_thread+0x8f4/0x101c kernel/workqueue.c:2457 kthread+0x374/0x454 kernel/kthread.c:334 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:855 irq event stamp: 9500 hardirqs last enabled at (9499): [] raw_spin_rq_unlock_irq kernel/sched/sched.h:1338 [inline] hardirqs last enabled at (9499): [] finish_lock_switch+0xb0/0x1c4 kernel/sched/core.c:4784 hardirqs last disabled at (9500): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (9500): [] _raw_spin_lock_irqsave+0xfc/0x14c kernel/locking/spinlock.c:162 softirqs last enabled at (9496): [] spin_unlock_bh include/linux/spinlock.h:408 [inline] softirqs last enabled at (9496): [] release_sock+0x1d0/0x258 net/core/sock.c:3277 softirqs last disabled at (9492): [] spin_lock_bh include/linux/spinlock.h:368 [inline] softirqs last disabled at (9492): [] release_sock+0x34/0x258 net/core/sock.c:3264 ---[ end trace af1af01d84610be4 ]--- Unable to handle kernel paging request at virtual address dfff800000000011 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 [dfff800000000011] address between user and kernel address ranges Internal error: Oops: 0000000096000006 [#1] PREEMPT SMP Modules linked in: CPU: 0 PID: 4052 Comm: kworker/u5:4 Tainted: G B W 5.15.189-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/30/2025 Workqueue: hci0 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/0x2f0 kernel/locking/spinlock_debug.c:114 lr : __raw_spin_lock_bh include/linux/spinlock_api_smp.h:136 [inline] lr : _raw_spin_lock_bh+0x11c/0x1b4 kernel/locking/spinlock.c:178 sp : ffff80001f0e7240 x29: ffff80001f0e72d0 x28: 1fffe0001e1de206 x27: dfff800000000000 x26: ffff700003e1ce84 x25: 1fffe0001e1de200 x24: dfff800000000000 x23: dfff800000000000 x22: 1ffff00003e1ce4c x21: ffff8000167a8000 x20: 000000000000008c x19: 0000000000000088 x18: 0000000000000002 x17: 0000000040000000 x16: ffff8000082d5f6c x15: 0000000000000002 x14: 0000000000ff0100 x13: ffffffffffffffff x12: 0000000000ff0100 x11: ffff80001f0e7260 x10: ffff800013a7cc50 x9 : f3f3f304f1f1f1f1 x8 : 0000000000000011 x7 : 0000000000000000 x6 : ffff80000f69f014 x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000000 x2 : 0000000000000000 x1 : ffff8000117c8460 x0 : 0000000000000088 Call trace: debug_spin_lock_before kernel/locking/spinlock_debug.c:-1 [inline] do_raw_spin_lock+0x80/0x2f0 kernel/locking/spinlock_debug.c:114 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:136 [inline] _raw_spin_lock_bh+0x11c/0x1b4 kernel/locking/spinlock.c:178 spin_lock_bh include/linux/spinlock.h:368 [inline] lock_sock_nested+0xf4/0x1d4 net/core/sock.c:3254 lock_sock include/net/sock.h:1694 [inline] l2cap_sock_ready_cb+0x4c/0x130 net/bluetooth/l2cap_sock.c:1649 l2cap_chan_ready net/bluetooth/l2cap_core.c:1386 [inline] l2cap_le_start+0x56c/0x131c net/bluetooth/l2cap_core.c:1498 l2cap_conn_ready net/bluetooth/l2cap_core.c:1768 [inline] l2cap_connect_cfm+0x578/0xd64 net/bluetooth/l2cap_core.c:8304 hci_connect_cfm include/net/bluetooth/hci_core.h:1505 [inline] le_conn_complete_evt+0xa7c/0x11bc net/bluetooth/hci_event.c:5429 hci_le_conn_complete_evt net/bluetooth/hci_event.c:5454 [inline] hci_le_meta_evt+0x85c/0x3010 net/bluetooth/hci_event.c:6176 hci_event_packet+0xd10/0x11bc net/bluetooth/hci_event.c:6525 hci_rx_work+0x1cc/0x880 net/bluetooth/hci_core.c:5160 process_one_work+0x79c/0x1140 kernel/workqueue.c:2310 worker_thread+0x8f4/0x101c kernel/workqueue.c:2457 kthread+0x374/0x454 kernel/kthread.c:334 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:855 Code: f2de6089 aa0003f3 f2fe7e69 f8376ac9 (38f76908) ---[ end trace af1af01d84610be5 ]--- ---------------- 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