================================================================== BUG: KASAN: slab-use-after-free in hci_send_acl+0xdf4/0xf30 net/bluetooth/hci_core.c:3228 Read of size 8 at addr ffff888068e89118 by task kworker/1:3/5394 CPU: 1 PID: 5394 Comm: kworker/1:3 Not tainted 6.5.0-rc5-syzkaller-01535-gf0835e7404b7-dirty #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 Workqueue: events l2cap_info_timeout Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 hci_send_acl+0xdf4/0xf30 net/bluetooth/hci_core.c:3228 l2cap_send_cmd+0x6dd/0x920 net/bluetooth/l2cap_core.c:977 l2cap_send_conn_req+0x1e5/0x260 net/bluetooth/l2cap_core.c:1286 l2cap_start_connection+0x11e/0x420 net/bluetooth/l2cap_core.c:1514 l2cap_conn_start+0x7ae/0xa40 net/bluetooth/l2cap_core.c:1661 process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2600 worker_thread+0x687/0x1110 kernel/workqueue.c:2751 kthread+0x33a/0x430 kernel/kthread.c:389 ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Allocated by task 5435: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:582 [inline] kzalloc include/linux/slab.h:703 [inline] hci_chan_create+0xa6/0x3a0 net/bluetooth/hci_conn.c:2691 l2cap_conn_add.part.0+0x1a/0xdf0 net/bluetooth/l2cap_core.c:7841 l2cap_conn_add include/net/bluetooth/l2cap.h:866 [inline] l2cap_chan_connect+0x15b9/0x2140 net/bluetooth/l2cap_core.c:8053 bt_6lowpan_connect net/bluetooth/6lowpan.c:894 [inline] lowpan_control_write+0x3d6/0x730 net/bluetooth/6lowpan.c:1129 full_proxy_write+0x124/0x190 fs/debugfs/file.c:236 vfs_write+0x2a4/0xe40 fs/read_write.c:582 ksys_write+0x12f/0x250 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 4432: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x15e/0x1b0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1792 [inline] slab_free_freelist_hook+0x10b/0x1e0 mm/slub.c:1818 slab_free mm/slub.c:3801 [inline] __kmem_cache_free+0xb8/0x2f0 mm/slub.c:3814 hci_chan_list_flush+0x81/0xf0 net/bluetooth/hci_conn.c:2731 hci_conn_cleanup net/bluetooth/hci_conn.c:152 [inline] hci_conn_del+0x1fc/0xd10 net/bluetooth/hci_conn.c:1140 hci_abort_conn_sync+0xacb/0xe20 net/bluetooth/hci_sync.c:5432 abort_conn_sync+0x18e/0x3a0 net/bluetooth/hci_conn.c:2878 hci_cmd_sync_work+0x1a4/0x3c0 net/bluetooth/hci_sync.c:306 process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2600 worker_thread+0x687/0x1110 kernel/workqueue.c:2751 kthread+0x33a/0x430 kernel/kthread.c:389 ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:2649 collapse net/ipv4/fib_trie.c:703 [inline] resize+0x1d73/0x2250 net/ipv4/fib_trie.c:906 trie_rebalance net/ipv4/fib_trie.c:1106 [inline] fib_remove_alias net/ipv4/fib_trie.c:1667 [inline] fib_remove_alias+0x324/0x480 net/ipv4/fib_trie.c:1649 fib_table_delete+0x6d7/0x9f0 net/ipv4/fib_trie.c:1772 fib_magic+0x329/0x560 net/ipv4/fib_frontend.c:1106 fib_del_ifaddr+0xb0d/0x14d0 net/ipv4/fib_frontend.c:1317 fib_inetaddr_event+0xb8/0x2a0 net/ipv4/fib_frontend.c:1448 notifier_call_chain+0xb6/0x3b0 kernel/notifier.c:93 blocking_notifier_call_chain kernel/notifier.c:388 [inline] blocking_notifier_call_chain+0x69/0x90 kernel/notifier.c:376 __inet_del_ifa+0x417/0x1030 net/ipv4/devinet.c:432 inet_del_ifa net/ipv4/devinet.c:469 [inline] inetdev_destroy net/ipv4/devinet.c:322 [inline] inetdev_event+0x5bb/0x1900 net/ipv4/devinet.c:1606 notifier_call_chain+0xb6/0x3b0 kernel/notifier.c:93 call_netdevice_notifiers_info+0xb9/0x130 net/core/dev.c:1970 call_netdevice_notifiers_extack net/core/dev.c:2008 [inline] call_netdevice_notifiers net/core/dev.c:2022 [inline] unregister_netdevice_many_notify+0x85f/0x1a20 net/core/dev.c:10930 unregister_netdevice_many net/core/dev.c:10986 [inline] default_device_exit_batch+0x584/0x740 net/core/dev.c:11445 ops_exit_list+0x125/0x170 net/core/net_namespace.c:175 cleanup_net+0x505/0xb20 net/core/net_namespace.c:614 process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2600 worker_thread+0x687/0x1110 kernel/workqueue.c:2751 kthread+0x33a/0x430 kernel/kthread.c:389 ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 The buggy address belongs to the object at ffff888068e89100 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 24 bytes inside of freed 128-byte region [ffff888068e89100, ffff888068e89180) The buggy address belongs to the physical page: page:ffffea0001a3a240 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x68e89 ksm flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000200 ffff8880128418c0 ffffea0000a71b40 dead000000000003 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY), pid 9, tgid 9 (kworker/0:1), ts 54053813563, free_ts 14688260990 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d2/0x350 mm/page_alloc.c:1570 prep_new_page mm/page_alloc.c:1577 [inline] get_page_from_freelist+0x10a9/0x31e0 mm/page_alloc.c:3221 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4477 alloc_pages+0x1a9/0x270 mm/mempolicy.c:2292 alloc_slab_page mm/slub.c:1862 [inline] allocate_slab+0x24e/0x380 mm/slub.c:2009 new_slab mm/slub.c:2062 [inline] ___slab_alloc+0x8bc/0x1570 mm/slub.c:3215 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3314 __slab_alloc_node mm/slub.c:3367 [inline] slab_alloc_node mm/slub.c:3460 [inline] __kmem_cache_alloc_node+0x137/0x350 mm/slub.c:3509 kmalloc_trace+0x25/0xe0 mm/slab_common.c:1076 kmalloc include/linux/slab.h:582 [inline] __hw_addr_create net/core/dev_addr_lists.c:60 [inline] __hw_addr_add_ex+0x3cb/0x7f0 net/core/dev_addr_lists.c:118 __dev_mc_add net/core/dev_addr_lists.c:867 [inline] dev_mc_add+0xc3/0x110 net/core/dev_addr_lists.c:885 igmp6_group_added+0x375/0x420 net/ipv6/mcast.c:680 __ipv6_dev_mc_inc+0x72a/0xc40 net/ipv6/mcast.c:949 addrconf_join_solict net/ipv6/addrconf.c:2189 [inline] addrconf_dad_begin net/ipv6/addrconf.c:4033 [inline] addrconf_dad_work+0x232/0x13e0 net/ipv6/addrconf.c:4158 process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2600 worker_thread+0x687/0x1110 kernel/workqueue.c:2751 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1161 [inline] free_unref_page_prepare+0x508/0xb90 mm/page_alloc.c:2348 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2443 free_contig_range+0xb6/0x190 mm/page_alloc.c:6395 destroy_args+0x686/0x940 mm/debug_vm_pgtable.c:1029 debug_vm_pgtable+0x2339/0x3ff0 mm/debug_vm_pgtable.c:1410 do_one_initcall+0x117/0x630 init/main.c:1232 do_initcall_level init/main.c:1294 [inline] do_initcalls init/main.c:1310 [inline] do_basic_setup init/main.c:1329 [inline] kernel_init_freeable+0x5bd/0x8f0 init/main.c:1546 kernel_init+0x1c/0x2a0 init/main.c:1437 ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Memory state around the buggy address: ffff888068e89000: 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc ffff888068e89080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888068e89100: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888068e89180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888068e89200: 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc ==================================================================