================================================================== BUG: KASAN: slab-use-after-free in device_for_each_child+0xa7/0x170 drivers/base/core.c:4036 Read of size 8 at addr ffff8880238295f8 by task kbnepd bnep0/5211 CPU: 1 PID: 5211 Comm: kbnepd bnep0 Not tainted 6.9.0-rc4-next-20240418-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 device_for_each_child+0xa7/0x170 drivers/base/core.c:4036 pm_runtime_set_memalloc_noio+0x114/0x260 drivers/base/power/runtime.c:248 netdev_unregister_kobject+0x178/0x250 net/core/net-sysfs.c:2106 unregister_netdevice_many_notify+0x11dd/0x16e0 net/core/dev.c:11208 unregister_netdevice_many net/core/dev.c:11236 [inline] unregister_netdevice_queue+0x303/0x370 net/core/dev.c:11115 unregister_netdevice include/linux/netdevice.h:3118 [inline] unregister_netdev+0x1c/0x30 net/core/dev.c:11254 bnep_session+0x2e09/0x3000 net/bluetooth/bnep/core.c:525 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Allocated by task 12: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3897 [inline] slab_alloc_node mm/slub.c:3957 [inline] kmem_cache_alloc_node_noprof+0x16b/0x310 mm/slub.c:4000 kmalloc_reserve+0xa8/0x2a0 net/core/skbuff.c:578 __alloc_skb+0x1f3/0x440 net/core/skbuff.c:669 alloc_skb include/linux/skbuff.h:1313 [inline] ndisc_alloc_skb+0xed/0x2c0 net/ipv6/ndisc.c:422 ndisc_send_rs+0x27b/0x6b0 net/ipv6/ndisc.c:703 addrconf_dad_completed+0x76c/0xcd0 net/ipv6/addrconf.c:4359 addrconf_dad_work+0xdc2/0x16f0 process_one_work kernel/workqueue.c:3218 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3299 worker_thread+0x86d/0xd70 kernel/workqueue.c:3380 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Freed by task 12: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579 poison_slab_object+0xe0/0x150 mm/kasan/common.c:240 __kasan_slab_free+0x37/0x60 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2190 [inline] slab_free mm/slub.c:4393 [inline] kmem_cache_free+0x145/0x340 mm/slub.c:4468 skb_kfree_head net/core/skbuff.c:1034 [inline] skb_free_head net/core/skbuff.c:1048 [inline] skb_release_data+0x667/0x890 net/core/skbuff.c:1075 skb_release_all net/core/skbuff.c:1140 [inline] __kfree_skb net/core/skbuff.c:1154 [inline] kfree_skb_reason+0x1a3/0x3b0 net/core/skbuff.c:1190 kfree_skb include/linux/skbuff.h:1262 [inline] ip6_mc_input+0xa1b/0xc30 net/ipv6/ip6_input.c:589 NF_HOOK+0x3a4/0x450 include/linux/netfilter.h:314 __netif_receive_skb_one_core net/core/dev.c:5605 [inline] __netif_receive_skb+0x1ea/0x650 net/core/dev.c:5719 process_backlog+0x391/0x7d0 net/core/dev.c:6048 __napi_poll+0xcb/0x490 net/core/dev.c:6702 napi_poll net/core/dev.c:6771 [inline] net_rx_action+0x7bb/0x10a0 net/core/dev.c:6887 __do_softirq+0x2c6/0x980 kernel/softirq.c:554 The buggy address belongs to the object at ffff888023829500 which belongs to the cache skbuff_small_head of size 640 The buggy address is located 248 bytes inside of freed 640-byte region [ffff888023829500, ffff888023829780) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x23828 head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff80000000040(head|node=0|zone=1|lastcpupid=0xfff) page_type: 0xffffefff(slab) raw: 00fff80000000040 ffff888018ac7a00 dead000000000122 0000000000000000 raw: 0000000000000000 0000000080150015 00000001ffffefff 0000000000000000 head: 00fff80000000040 ffff888018ac7a00 dead000000000122 0000000000000000 head: 0000000000000000 0000000080150015 00000001ffffefff 0000000000000000 head: 00fff80000000002 ffffea00008e0a01 ffffffffffffffff 0000000000000000 head: 0000000000000004 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0x1d2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 12, tgid 469223971 (kworker/u8:1), ts 12, free_ts 296802417932 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1476 prep_new_page mm/page_alloc.c:1484 [inline] get_page_from_freelist+0x2ce2/0x2d90 mm/page_alloc.c:3446 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4704 __alloc_pages_node_noprof include/linux/gfp.h:244 [inline] alloc_pages_node_noprof include/linux/gfp.h:271 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2259 allocate_slab+0x5a/0x2e0 mm/slub.c:2422 new_slab mm/slub.c:2475 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3624 __slab_alloc+0x58/0xa0 mm/slub.c:3714 __slab_alloc_node mm/slub.c:3767 [inline] slab_alloc_node mm/slub.c:3945 [inline] kmem_cache_alloc_node_noprof+0x1fe/0x310 mm/slub.c:4000 kmalloc_reserve+0xa8/0x2a0 net/core/skbuff.c:578 __alloc_skb+0x1f3/0x440 net/core/skbuff.c:669 skb_copy+0xef/0x770 net/core/skbuff.c:2072 mac80211_hwsim_tx_frame_no_nl+0x1068/0x18d0 drivers/net/wireless/virtual/mac80211_hwsim.c:1857 mac80211_hwsim_tx_frame+0x1cc/0x220 drivers/net/wireless/virtual/mac80211_hwsim.c:2206 mac80211_hwsim_beacon_tx+0x3be/0x7e0 drivers/net/wireless/virtual/mac80211_hwsim.c:2306 __iterate_interfaces+0x223/0x4c0 net/mac80211/util.c:772 ieee80211_iterate_active_interfaces_atomic+0xd8/0x170 net/mac80211/util.c:808 page last free pid 5224 tgid 5224 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1096 [inline] free_unref_page+0xd22/0xea0 mm/page_alloc.c:2609 __folio_put+0x3b9/0x620 mm/swap.c:129 folio_put include/linux/mm.h:1509 [inline] free_large_kmalloc+0x105/0x1c0 mm/slub.c:4485 kfree+0x1c4/0x350 mm/slub.c:4508 hci_release_dev+0x1516/0x16a0 net/bluetooth/hci_core.c:2840 bt_host_release+0x83/0x90 net/bluetooth/hci_sysfs.c:94 device_release+0x99/0x1c0 kobject_cleanup lib/kobject.c:689 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x22f/0x480 lib/kobject.c:737 vhci_release+0x8b/0xd0 drivers/bluetooth/hci_vhci.c:675 __fput+0x406/0x8b0 fs/file_table.c:422 task_work_run+0x24f/0x310 kernel/task_work.c:180 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xa1b/0x27e0 kernel/exit.c:877 do_group_exit+0x207/0x2c0 kernel/exit.c:1026 get_signal+0x16a1/0x1740 kernel/signal.c:2911 arch_do_signal_or_restart+0x96/0x860 arch/x86/kernel/signal.c:310 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0xc9/0x370 kernel/entry/common.c:218 Memory state around the buggy address: ffff888023829480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888023829500: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888023829580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888023829600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888023829680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================