================================================================== BUG: KASAN: slab-use-after-free in hci_send_acl+0xeb7/0x1050 net/bluetooth/hci_core.c:3231 Read of size 8 at addr ffff8880705e5a18 by task kworker/0:3/4799 CPU: 0 PID: 4799 Comm: kworker/0:3 Not tainted 6.6.0-rc4-next-20231003-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/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+0xeb7/0x1050 net/bluetooth/hci_core.c:3231 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+0x884/0x15c0 kernel/workqueue.c:2630 process_scheduled_works kernel/workqueue.c:2703 [inline] worker_thread+0x8b9/0x1290 kernel/workqueue.c:2784 kthread+0x33c/0x440 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Allocated by task 18402: 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:600 [inline] kzalloc include/linux/slab.h:721 [inline] hci_chan_create+0xa6/0x3d0 net/bluetooth/hci_conn.c:2731 l2cap_conn_add.part.0+0x1a/0xdf0 net/bluetooth/l2cap_core.c:7841 l2cap_conn_add include/net/bluetooth/hci_core.h:1544 [inline] l2cap_chan_connect+0x15de/0x2170 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:51 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 50: 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+0x15b/0x1b0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook+0x114/0x1e0 mm/slub.c:1826 slab_free mm/slub.c:3809 [inline] __kmem_cache_free+0xc0/0x180 mm/slub.c:3822 hci_chan_list_flush+0x81/0xf0 net/bluetooth/hci_conn.c:2771 hci_conn_cleanup net/bluetooth/hci_conn.c:152 [inline] hci_conn_del+0x201/0xd80 net/bluetooth/hci_conn.c:1158 hci_abort_conn_sync+0x7ed/0xb60 net/bluetooth/hci_sync.c:5427 abort_conn_sync+0x187/0x390 net/bluetooth/hci_conn.c:2918 hci_cmd_sync_work+0x1a4/0x410 net/bluetooth/hci_sync.c:306 process_one_work+0x884/0x15c0 kernel/workqueue.c:2630 process_scheduled_works kernel/workqueue.c:2703 [inline] worker_thread+0x8b9/0x1290 kernel/workqueue.c:2784 kthread+0x33c/0x440 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 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 kvfree_call_rcu+0x70/0xbe0 kernel/rcu/tree.c:3385 kernfs_unlink_open_file+0x3b6/0x4b0 fs/kernfs/file.c:633 kernfs_fop_release+0xec/0x1e0 fs/kernfs/file.c:805 __fput+0x406/0xb60 fs/file_table.c:401 __fput_sync+0x47/0x50 fs/file_table.c:482 __do_sys_close fs/open.c:1572 [inline] __se_sys_close fs/open.c:1557 [inline] __x64_sys_close+0x87/0xf0 fs/open.c:1557 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x63/0xcd Second to 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 kvfree_call_rcu+0x70/0xbe0 kernel/rcu/tree.c:3385 __hw_addr_flush+0x150/0x240 net/core/dev_addr_lists.c:490 dev_addr_flush+0x21/0x60 net/core/dev_addr_lists.c:535 free_netdev+0x1fe/0x5f0 net/core/dev.c:10828 netdev_run_todo+0xcc2/0x11d0 net/core/dev.c:10469 ip_tunnel_delete_nets+0x2c0/0x3a0 net/ipv4/ip_tunnel.c:1145 ops_exit_list+0x125/0x170 net/core/net_namespace.c:175 setup_net+0x64d/0xa40 net/core/net_namespace.c:362 copy_net_ns+0x2fa/0x670 net/core/net_namespace.c:491 create_new_namespaces+0x3ea/0xb10 kernel/nsproxy.c:110 copy_namespaces+0x464/0x560 kernel/nsproxy.c:179 copy_process+0x31c1/0x74b0 kernel/fork.c:2498 kernel_clone+0xfd/0x920 kernel/fork.c:2900 __do_sys_clone3+0x1f1/0x260 kernel/fork.c:3201 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff8880705e5a00 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 24 bytes inside of freed 128-byte region [ffff8880705e5a00, ffff8880705e5a80) The buggy address belongs to the physical page: page:ffffea0001c17940 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x705e5 flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000800 ffff888012c418c0 ffffea000170df40 dead000000000004 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 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 5424, tgid 5419 (syz-executor.4), ts 336674266963, free_ts 336658505779 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1538 prep_new_page mm/page_alloc.c:1545 [inline] get_page_from_freelist+0x98f/0x32a0 mm/page_alloc.c:3337 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4593 alloc_pages+0x1a9/0x270 mm/mempolicy.c:2303 alloc_slab_page mm/slub.c:1870 [inline] allocate_slab+0x251/0x380 mm/slub.c:2017 new_slab mm/slub.c:2070 [inline] ___slab_alloc+0x8c7/0x1580 mm/slub.c:3223 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322 __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] __kmem_cache_alloc_node+0x131/0x310 mm/slub.c:3517 __do_kmalloc_node mm/slab_common.c:1003 [inline] __kmalloc_node_track_caller+0x50/0x100 mm/slab_common.c:1024 kmemdup+0x29/0x60 mm/util.c:131 kmemdup include/linux/fortify-string.h:765 [inline] mpls_dev_sysctl_register+0xce/0x330 net/mpls/af_mpls.c:1407 mpls_add_dev net/mpls/af_mpls.c:1478 [inline] mpls_dev_notify+0x48f/0xa00 net/mpls/af_mpls.c:1618 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] register_netdevice+0xf84/0x1490 net/core/dev.c:10191 __ip_tunnel_create+0x4a1/0x670 net/ipv4/ip_tunnel.c:267 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1134 [inline] free_unref_page_prepare+0x476/0xa40 mm/page_alloc.c:2387 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2522 qlink_free mm/kasan/quarantine.c:166 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:185 kasan_quarantine_reduce+0x18e/0x1d0 mm/kasan/quarantine.c:292 __kasan_slab_alloc+0x65/0x90 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook mm/slab.h:758 [inline] slab_alloc_node mm/slub.c:3478 [inline] __kmem_cache_alloc_node+0x195/0x310 mm/slub.c:3517 kmalloc_trace+0x25/0xe0 mm/slab_common.c:1095 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:721 [inline] ref_tracker_alloc+0x17c/0x5a0 lib/ref_tracker.c:203 __netdev_tracker_alloc include/linux/netdevice.h:4078 [inline] netdev_hold include/linux/netdevice.h:4107 [inline] netdev_hold include/linux/netdevice.h:4102 [inline] register_netdevice+0xe27/0x1490 net/core/dev.c:10178 __ip_tunnel_create+0x4a1/0x670 net/ipv4/ip_tunnel.c:267 ip_tunnel_init_net+0x237/0x5e0 net/ipv4/ip_tunnel.c:1091 ops_init+0xb9/0x650 net/core/net_namespace.c:136 setup_net+0x422/0xa40 net/core/net_namespace.c:339 copy_net_ns+0x2fa/0x670 net/core/net_namespace.c:491 create_new_namespaces+0x3ea/0xb10 kernel/nsproxy.c:110 copy_namespaces+0x464/0x560 kernel/nsproxy.c:179 Memory state around the buggy address: ffff8880705e5900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880705e5980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880705e5a00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880705e5a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880705e5b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc ==================================================================