================================================================== BUG: KASAN: use-after-free in device_for_each_child+0x17a/0x190 drivers/base/core.c:4044 Read of size 8 at addr ffff888060ca95f8 by task kbnepd bnep0/12434 CPU: 1 PID: 12434 Comm: kbnepd bnep0 Not tainted 6.9.0-rc5-syzkaller-00053-ge33c4963bf53 #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+0x116/0x1f0 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 device_for_each_child+0x17a/0x190 drivers/base/core.c:4044 pm_runtime_set_memalloc_noio+0xf2/0x180 drivers/base/power/runtime.c:248 netdev_unregister_kobject+0x1ed/0x270 net/core/net-sysfs.c:2106 unregister_netdevice_many_notify+0xc8a/0x19f0 net/core/dev.c:11135 unregister_netdevice_many net/core/dev.c:11163 [inline] unregister_netdevice_queue+0x307/0x3f0 net/core/dev.c:11042 unregister_netdevice include/linux/netdevice.h:3115 [inline] unregister_netdev+0x1c/0x30 net/core/dev.c:11181 bnep_session+0x220d/0x2d60 net/bluetooth/bnep/core.c:525 kthread+0x2c1/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x400000000 pfn:0x60ca9 flags: 0xfff80000000000(node=0|zone=1|lastcpupid=0xfff) page_type: 0xffffffff() raw: 00fff80000000000 0000000000000000 dead000000000122 0000000000000000 raw: 0000000400000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 2, migratetype Unmovable, gfp_mask 0x102000(__GFP_NOWARN|__GFP_HARDWALL), pid 13804, tgid 2118797877 (syz-executor.0), ts 13805, free_ts 813868382315 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1534 prep_new_page mm/page_alloc.c:1541 [inline] get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3317 __alloc_pages+0x22b/0x2460 mm/page_alloc.c:4575 alloc_pages_mpol+0x275/0x610 mm/mempolicy.c:2264 stack_depot_save_flags+0x566/0x8f0 lib/stackdepot.c:635 kasan_save_stack+0x42/0x60 mm/kasan/common.c:48 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:240 [inline] __kasan_slab_free+0x11d/0x1a0 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2106 [inline] slab_free mm/slub.c:4280 [inline] kmem_cache_free+0x12e/0x380 mm/slub.c:4344 skb_kfree_head net/core/skbuff.c:1094 [inline] skb_kfree_head net/core/skbuff.c:1091 [inline] skb_free_head+0x19a/0x1e0 net/core/skbuff.c:1108 skb_release_data+0x76c/0x990 net/core/skbuff.c:1136 skb_release_all net/core/skbuff.c:1202 [inline] __kfree_skb net/core/skbuff.c:1216 [inline] kfree_skb_reason+0x12d/0x210 net/core/skbuff.c:1252 __neigh_event_send+0x805/0x13b0 net/core/neighbour.c:1231 neigh_event_send_probe include/net/neighbour.h:466 [inline] neigh_event_send include/net/neighbour.h:472 [inline] neigh_event_send include/net/neighbour.h:470 [inline] neigh_resolve_output+0x5ed/0x950 net/core/neighbour.c:1547 neigh_output include/net/neighbour.h:542 [inline] ip_finish_output2+0x82d/0x25e0 net/ipv4/ip_output.c:235 page last free pid 13805 tgid 13804 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1141 [inline] free_unref_page_prepare+0x527/0xb10 mm/page_alloc.c:2347 free_unref_page+0x33/0x3c0 mm/page_alloc.c:2487 stack_depot_save_flags+0x2da/0x8f0 lib/stackdepot.c:673 kasan_save_stack+0x42/0x60 mm/kasan/common.c:48 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:240 [inline] __kasan_slab_free+0x11d/0x1a0 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2106 [inline] slab_free mm/slub.c:4280 [inline] kmem_cache_free+0x12e/0x380 mm/slub.c:4344 skb_kfree_head net/core/skbuff.c:1094 [inline] skb_kfree_head net/core/skbuff.c:1091 [inline] skb_free_head+0x19a/0x1e0 net/core/skbuff.c:1108 skb_release_data+0x76c/0x990 net/core/skbuff.c:1136 skb_release_all net/core/skbuff.c:1202 [inline] __kfree_skb net/core/skbuff.c:1216 [inline] kfree_skb_reason+0x12d/0x210 net/core/skbuff.c:1252 __neigh_event_send+0x805/0x13b0 net/core/neighbour.c:1231 neigh_event_send_probe include/net/neighbour.h:466 [inline] neigh_event_send include/net/neighbour.h:472 [inline] neigh_event_send include/net/neighbour.h:470 [inline] neigh_resolve_output+0x5ed/0x950 net/core/neighbour.c:1547 neigh_output include/net/neighbour.h:542 [inline] ip_finish_output2+0x82d/0x25e0 net/ipv4/ip_output.c:235 __ip_finish_output net/ipv4/ip_output.c:313 [inline] __ip_finish_output+0x49e/0x950 net/ipv4/ip_output.c:295 ip_finish_output+0x31/0x310 net/ipv4/ip_output.c:323 Memory state around the buggy address: ffff888060ca9480: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888060ca9500: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888060ca9580: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888060ca9600: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888060ca9680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================