kobject_add_internal failed for hci5:201 with -EEXIST, don't try to register things with the same name in the same directory. Bluetooth: hci5: failed to register connection device ================================================================== BUG: KASAN: use-after-free in l2cap_conn_ready net/bluetooth/l2cap_core.c:1757 [inline] BUG: KASAN: use-after-free in l2cap_connect_cfm+0x594/0xd64 net/bluetooth/l2cap_core.c:8295 Read of size 8 at addr ffff0000d6002488 by task kworker/u5:2/4032 CPU: 0 PID: 4032 Comm: kworker/u5:2 Not tainted 5.15.182-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/19/2025 Workqueue: hci5 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_conn_ready net/bluetooth/l2cap_core.c:1757 [inline] l2cap_connect_cfm+0x594/0xd64 net/bluetooth/l2cap_core.c:8295 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:870 Allocated by task 4032: 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] kmem_cache_alloc_trace+0x274/0x3fc mm/slub.c:3247 kmalloc include/linux/slab.h:604 [inline] kzalloc include/linux/slab.h:735 [inline] l2cap_chan_create+0x58/0x68c net/bluetooth/l2cap_core.c:469 l2cap_sock_alloc net/bluetooth/l2cap_sock.c:1876 [inline] l2cap_sock_new_connection_cb+0x1b4/0x304 net/bluetooth/l2cap_sock.c:1476 l2cap_connect_cfm+0x2d4/0xd64 net/bluetooth/l2cap_core.c:8278 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:870 Freed by task 13182: 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 l2cap_chan_destroy net/bluetooth/l2cap_core.c:512 [inline] kref_put include/linux/kref.h:65 [inline] l2cap_chan_put+0x17c/0x260 net/bluetooth/l2cap_core.c:536 l2cap_sock_cleanup_listen+0x104/0x28c net/bluetooth/l2cap_sock.c:1459 l2cap_sock_teardown_cb+0x17c/0x360 net/bluetooth/l2cap_sock.c:1576 l2cap_chan_close+0x250/0x768 net/bluetooth/l2cap_core.c:-1 l2cap_sock_shutdown+0x334/0x7c8 net/bluetooth/l2cap_sock.c:1378 l2cap_sock_release+0x78/0x1ac net/bluetooth/l2cap_sock.c:1422 __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 tracehook_notify_resume include/linux/tracehook.h:189 [inline] do_notify_resume+0x24b4/0x3128 arch/arm64/kernel/signal.c:949 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:3596 drop_sysctl_table+0x274/0x39c fs/proc/proc_sysctl.c:1681 unregister_sysctl_table+0x94/0x134 fs/proc/proc_sysctl.c:1719 unregister_net_sysctl_table+0x20/0x30 net/sysctl_net.c:175 __devinet_sysctl_unregister net/ipv4/devinet.c:2627 [inline] devinet_sysctl_unregister net/ipv4/devinet.c:2655 [inline] inetdev_destroy net/ipv4/devinet.c:326 [inline] inetdev_event+0x578/0x127c net/ipv4/devinet.c:1612 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 default_device_exit_batch+0x444/0x4a4 net/core/dev.c:11667 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:870 The buggy address belongs to the object at ffff0000d6002000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1160 bytes inside of 2048-byte region [ffff0000d6002000, ffff0000d6002800) The buggy address belongs to the page: page:00000000d3768692 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x116000 head:00000000d3768692 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000010200 0000000000000000 0000000300000001 ffff0000c0002900 raw: 0000000000000000 0000000080080008 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000d6002380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000d6002400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0000d6002480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000d6002500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000d6002580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== Unable to handle kernel paging request at virtual address fbd51fffffffff92 Mem abort info: ESR = 0x0000000096000004 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x04: level 0 translation fault Data abort info: ISV = 0, ISS = 0x00000004 CM = 0, WnR = 0 [fbd51fffffffff92] address between user and kernel address ranges Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP Modules linked in: CPU: 0 PID: 4032 Comm: kworker/u5:2 Tainted: G B 5.15.182-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/19/2025 Workqueue: hci5 hci_rx_work pstate: 20400005 (nzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : atomic_read include/linux/atomic/atomic-instrumented.h:28 [inline] pc : l2cap_chan_lock include/net/bluetooth/l2cap.h:855 [inline] pc : l2cap_conn_ready net/bluetooth/l2cap_core.c:1759 [inline] pc : l2cap_connect_cfm+0x4fc/0xd64 net/bluetooth/l2cap_core.c:8295 lr : instrument_atomic_read include/linux/instrumented.h:71 [inline] lr : atomic_read include/linux/atomic/atomic-instrumented.h:27 [inline] lr : l2cap_chan_lock include/net/bluetooth/l2cap.h:855 [inline] lr : l2cap_conn_ready net/bluetooth/l2cap_core.c:1759 [inline] lr : l2cap_connect_cfm+0x4f0/0xd64 net/bluetooth/l2cap_core.c:8295 sp : ffff80001f1a7540 x29: ffff80001f1a75c0 x28: dfff800000000000 x27: 1fffe0001c3d3406 x26: 0000000000000001 x25: 0000000000000080 x24: deacfffffffffc94 x23: ffff0000cdaf081a x22: dead000000000100 x21: ffff0000cdaf0a60 x20: ffff0000e1e9a037 x19: ffff0000cdaf0800 x18: 0000000000000002 x17: 0000000040000000 x16: ffff8000082d4b24 x15: 0000000000000002 x14: 0000000000ff0100 x13: ffffffffffffffff x12: 0000000000ff0100 x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000007 x8 : 1bd59fffffffff92 x7 : 0000000000000000 x6 : ffff800008244078 x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff8000105497a0 x2 : 0000000000000000 x1 : 0000000000000004 x0 : 0000000000000001 Call trace: atomic_read include/linux/atomic/atomic-instrumented.h:28 [inline] l2cap_chan_lock include/net/bluetooth/l2cap.h:855 [inline] l2cap_conn_ready net/bluetooth/l2cap_core.c:1759 [inline] l2cap_connect_cfm+0x4fc/0xd64 net/bluetooth/l2cap_core.c:8295 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:870 Code: 960c0b83 d343ff08 12000b09 11000d29 (38fc6908) ---[ end trace 677e1b5f175f622c ]--- ---------------- Code disassembly (best guess): 0: 960c0b83 bl 0xfffffffff8302e0c 4: d343ff08 lsr x8, x24, #3 8: 12000b09 and w9, w24, #0x7 c: 11000d29 add w9, w9, #0x3 * 10: 38fc6908 ldrsb w8, [x8, x28] <-- trapping instruction