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_conn_ready net/bluetooth/l2cap_core.c:1758 [inline] BUG: KASAN: use-after-free in l2cap_connect_cfm+0xb3a/0xd50 net/bluetooth/l2cap_core.c:8320 Read of size 8 at addr ffff8880707e7488 by task kworker/u5:2/1998 CPU: 0 PID: 1998 Comm: kworker/u5:2 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025 Workqueue: hci0 hci_rx_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x41/0x5e lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x6c/0x309 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:451 l2cap_conn_ready net/bluetooth/l2cap_core.c:1758 [inline] l2cap_connect_cfm+0xb3a/0xd50 net/bluetooth/l2cap_core.c:8320 hci_connect_cfm include/net/bluetooth/hci_core.h:1505 [inline] le_conn_complete_evt+0x11f0/0x1ab0 net/bluetooth/hci_event.c:5439 hci_le_conn_complete_evt net/bluetooth/hci_event.c:5464 [inline] hci_le_meta_evt+0x71b/0x3c90 net/bluetooth/hci_event.c:6186 hci_event_packet+0x4c5/0x8420 net/bluetooth/hci_event.c:6535 hci_rx_work+0x3e8/0xab0 net/bluetooth/hci_core.c:5160 process_one_work+0x800/0x11d0 kernel/workqueue.c:2310 worker_thread+0x4a0/0xdd0 kernel/workqueue.c:2457 kthread+0x31b/0x3e0 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Allocated by task 1998: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 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+0x7c/0x90 mm/kasan/common.c:522 kmalloc include/linux/slab.h:607 [inline] kzalloc include/linux/slab.h:738 [inline] l2cap_chan_create+0x39/0x8f0 net/bluetooth/l2cap_core.c:469 l2cap_sock_alloc.constprop.0+0x177/0x250 net/bluetooth/l2cap_sock.c:1882 l2cap_sock_new_connection_cb+0xd5/0x1e0 net/bluetooth/l2cap_sock.c:1479 l2cap_connect_cfm+0x3d6/0xd50 net/bluetooth/l2cap_core.c:8303 hci_connect_cfm include/net/bluetooth/hci_core.h:1505 [inline] le_conn_complete_evt+0x11f0/0x1ab0 net/bluetooth/hci_event.c:5439 hci_le_conn_complete_evt net/bluetooth/hci_event.c:5464 [inline] hci_le_meta_evt+0x71b/0x3c90 net/bluetooth/hci_event.c:6186 hci_event_packet+0x4c5/0x8420 net/bluetooth/hci_event.c:6535 hci_rx_work+0x3e8/0xab0 net/bluetooth/hci_core.c:5160 process_one_work+0x800/0x11d0 kernel/workqueue.c:2310 worker_thread+0x4a0/0xdd0 kernel/workqueue.c:2457 kthread+0x31b/0x3e0 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Freed by task 6428: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:360 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free mm/kasan/common.c:328 [inline] __kasan_slab_free+0xe0/0x110 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1710 [inline] slab_free_freelist_hook mm/slub.c:1736 [inline] slab_free mm/slub.c:3504 [inline] kfree+0xd0/0x4e0 mm/slub.c:4564 l2cap_sock_cleanup_listen+0x45/0x230 net/bluetooth/l2cap_sock.c:1462 l2cap_sock_release+0x56/0x200 net/bluetooth/l2cap_sock.c:1420 __sock_release+0xbb/0x270 net/socket.c:651 sock_close+0xf/0x20 net/socket.c:1346 __fput+0x1f2/0x9a0 fs/file_table.c:311 task_work_run+0xb8/0x140 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:181 [inline] exit_to_user_mode_prepare+0x1a2/0x1b0 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x12/0x30 kernel/entry/common.c:307 do_syscall_64+0x40/0x80 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 The buggy address belongs to the object at ffff8880707e7000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1160 bytes inside of 2048-byte region [ffff8880707e7000, ffff8880707e7800) The buggy address belongs to the page: page:ffffea0001c1f800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x707e0 head:ffffea0001c1f800 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000122 ffff88800e042000 raw: 0000000000000000 0000000080080008 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x152a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 6426, ts 420863283705, free_ts 420516940080 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x13cc/0x3270 mm/page_alloc.c:4192 __alloc_pages+0x1b2/0x440 mm/page_alloc.c:5487 alloc_slab_page mm/slub.c:1780 [inline] allocate_slab+0x2eb/0x430 mm/slub.c:1917 new_slab mm/slub.c:1980 [inline] ___slab_alloc+0xc94/0x10f0 mm/slub.c:3013 __slab_alloc.constprop.0+0x45/0x80 mm/slub.c:3100 slab_alloc_node mm/slub.c:3191 [inline] slab_alloc mm/slub.c:3233 [inline] __kmalloc+0x386/0x3c0 mm/slub.c:4408 kmalloc include/linux/slab.h:612 [inline] sk_prot_alloc+0xee/0x200 net/core/sock.c:1866 sk_alloc+0x27/0x570 net/core/sock.c:1922 l2cap_sock_alloc.constprop.0+0x24/0x250 net/bluetooth/l2cap_sock.c:1867 l2cap_sock_create+0xc8/0x160 net/bluetooth/l2cap_sock.c:1915 bt_sock_create+0x11a/0x250 net/bluetooth/af_bluetooth.c:130 __sock_create+0x20f/0x4f0 net/socket.c:1496 sock_create net/socket.c:1552 [inline] __sys_socket+0xd6/0x1a0 net/socket.c:1594 __do_sys_socket net/socket.c:1603 [inline] __se_sys_socket net/socket.c:1601 [inline] __x64_sys_socket+0x6a/0xb0 net/socket.c:1601 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x33/0x80 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare+0x379/0x850 mm/page_alloc.c:1391 free_unref_page_prepare mm/page_alloc.c:3317 [inline] free_unref_page+0x19/0x510 mm/page_alloc.c:3396 __unfreeze_partials+0x30b/0x320 mm/slub.c:2512 qlink_free mm/kasan/quarantine.c:157 [inline] qlist_free_all+0x68/0x110 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x180/0x1f0 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x73/0x80 mm/kasan/common.c:444 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook mm/slab.h:519 [inline] slab_alloc_node mm/slub.c:3225 [inline] slab_alloc mm/slub.c:3233 [inline] kmem_cache_alloc_trace+0x224/0x350 mm/slub.c:3250 kmalloc include/linux/slab.h:607 [inline] tomoyo_print_header security/tomoyo/audit.c:156 [inline] tomoyo_init_log+0x180/0x1df0 security/tomoyo/audit.c:255 tomoyo_supervisor+0x2ea/0xea0 security/tomoyo/common.c:2097 tomoyo_audit_path_number_log security/tomoyo/file.c:235 [inline] tomoyo_path_number_perm+0x34c/0x420 security/tomoyo/file.c:734 tomoyo_path_mkdir+0x81/0xd0 security/tomoyo/tomoyo.c:166 security_path_mkdir+0xc0/0x130 security/security.c:1155 do_mkdirat+0x109/0x280 fs/namei.c:4093 __do_sys_mkdir fs/namei.c:4118 [inline] __se_sys_mkdir fs/namei.c:4116 [inline] __x64_sys_mkdir+0xd0/0x120 fs/namei.c:4116 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x33/0x80 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Memory state around the buggy address: ffff8880707e7380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880707e7400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880707e7480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880707e7500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880707e7580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================