================================================================== BUG: KASAN: use-after-free in geneve_xmit_skb drivers/net/geneve.c:990 [inline] BUG: KASAN: use-after-free in geneve_xmit+0x332f/0x34a0 drivers/net/geneve.c:1119 Read of size 2 at addr ffff88806485880b by task syz.4.1075/7445 CPU: 1 PID: 7445 Comm: syz.4.1075 Not tainted 5.15.170-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 print_address_description+0x63/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x16b/0x1c0 mm/kasan/report.c:451 geneve_xmit_skb drivers/net/geneve.c:990 [inline] geneve_xmit+0x332f/0x34a0 drivers/net/geneve.c:1119 __netdev_start_xmit include/linux/netdevice.h:5019 [inline] netdev_start_xmit include/linux/netdevice.h:5033 [inline] __dev_direct_xmit+0x4d9/0x740 net/core/dev.c:4320 dev_direct_xmit include/linux/netdevice.h:3001 [inline] packet_direct_xmit+0x167/0x2a0 net/packet/af_packet.c:246 packet_snd net/packet/af_packet.c:3104 [inline] packet_sendmsg+0x449d/0x5e90 net/packet/af_packet.c:3135 sock_sendmsg_nosec net/socket.c:704 [inline] __sock_sendmsg net/socket.c:716 [inline] ____sys_sendmsg+0x59e/0x8f0 net/socket.c:2436 ___sys_sendmsg+0x252/0x2e0 net/socket.c:2490 __sys_sendmsg net/socket.c:2519 [inline] __do_sys_sendmsg net/socket.c:2528 [inline] __se_sys_sendmsg+0x19a/0x260 net/socket.c:2526 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7fe805413719 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fe80388b038 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007fe8055caf80 RCX: 00007fe805413719 RDX: 0000000000000000 RSI: 00000000200002c0 RDI: 0000000000000003 RBP: 00007fe80548639e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fe8055caf80 R15: 00007fff2ecff388 Allocated by task 6714: 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+0xba/0xf0 mm/kasan/common.c:513 kasan_kmalloc include/linux/kasan.h:264 [inline] __kmalloc_node_track_caller+0x195/0x390 mm/slub.c:4963 kmalloc_reserve net/core/skbuff.c:356 [inline] __alloc_skb+0x12c/0x590 net/core/skbuff.c:427 skb_copy+0x127/0x820 net/core/skbuff.c:1595 mac80211_hwsim_tx_frame_no_nl+0xe37/0x1840 drivers/net/wireless/mac80211_hwsim.c:1569 mac80211_hwsim_tx_frame+0x1cc/0x220 drivers/net/wireless/mac80211_hwsim.c:1788 mac80211_hwsim_beacon_tx+0x48f/0x8a0 drivers/net/wireless/mac80211_hwsim.c:1842 __iterate_interfaces+0x21e/0x4b0 net/mac80211/util.c:793 ieee80211_iterate_active_interfaces_atomic+0xaf/0x140 net/mac80211/util.c:829 mac80211_hwsim_beacon+0xa7/0x180 drivers/net/wireless/mac80211_hwsim.c:1865 __run_hrtimer kernel/time/hrtimer.c:1688 [inline] __hrtimer_run_queues+0x598/0xcf0 kernel/time/hrtimer.c:1752 hrtimer_run_softirq+0x196/0x2c0 kernel/time/hrtimer.c:1769 handle_softirqs+0x3a7/0x930 kernel/softirq.c:558 __do_softirq kernel/softirq.c:592 [inline] invoke_softirq kernel/softirq.c:432 [inline] __irq_exit_rcu+0x157/0x240 kernel/softirq.c:641 irq_exit_rcu+0x5/0x20 kernel/softirq.c:653 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1108 [inline] sysvec_apic_timer_interrupt+0xa0/0xc0 arch/x86/kernel/apic/apic.c:1108 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:676 The buggy address belongs to the object at ffff888064858800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 11 bytes inside of 512-byte region [ffff888064858800, ffff888064858a00) The buggy address belongs to the page: page:ffffea0001921600 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888064858c00 pfn:0x64858 head:ffffea0001921600 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea00018d2d08 ffffea00018d2e08 ffff888017041c80 raw: ffff888064858c00 0000000000100001 00000001ffffffff 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4170, ts 58238813295, free_ts 17169232117 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159 __alloc_pages+0x272/0x700 mm/page_alloc.c:5423 alloc_slab_page mm/slub.c:1775 [inline] allocate_slab mm/slub.c:1912 [inline] new_slab+0xbb/0x4b0 mm/slub.c:1975 ___slab_alloc+0x6f6/0xe10 mm/slub.c:3008 __slab_alloc mm/slub.c:3095 [inline] slab_alloc_node mm/slub.c:3186 [inline] __kmalloc_node_track_caller+0x1f6/0x390 mm/slub.c:4958 kmalloc_reserve net/core/skbuff.c:356 [inline] __alloc_skb+0x12c/0x590 net/core/skbuff.c:427 alloc_skb include/linux/skbuff.h:1162 [inline] alloc_uevent_skb+0x74/0x220 lib/kobject_uevent.c:290 uevent_net_broadcast_tagged lib/kobject_uevent.c:351 [inline] kobject_uevent_net_broadcast+0x178/0x560 lib/kobject_uevent.c:412 kobject_uevent_env+0x567/0x8d0 lib/kobject_uevent.c:608 __kobject_del+0xd3/0x310 lib/kobject.c:625 kobject_cleanup lib/kobject.c:704 [inline] kobject_release lib/kobject.c:744 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x238/0x460 lib/kobject.c:761 netdev_queue_update_kobjects+0x384/0x3f0 net/core/net-sysfs.c:1726 netif_set_real_num_tx_queues+0x17a/0x8b0 net/core/dev.c:2940 veth_init_queues drivers/net/veth.c:1608 [inline] veth_newlink+0xa23/0xe20 drivers/net/veth.c:1726 __rtnl_newlink net/core/rtnetlink.c:3521 [inline] rtnl_newlink+0x14e1/0x2070 net/core/rtnetlink.c:3569 rtnetlink_rcv_msg+0x993/0xee0 net/core/rtnetlink.c:5647 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0xc34/0xcf0 mm/page_alloc.c:3317 free_unref_page+0x95/0x2d0 mm/page_alloc.c:3396 free_contig_range+0x95/0xf0 mm/page_alloc.c:9342 destroy_args+0xfe/0x980 mm/debug_vm_pgtable.c:1018 debug_vm_pgtable+0x40d/0x470 mm/debug_vm_pgtable.c:1331 do_one_initcall+0x22b/0x7a0 init/main.c:1302 do_initcall_level+0x157/0x210 init/main.c:1375 do_initcalls+0x49/0x90 init/main.c:1391 kernel_init_freeable+0x425/0x5c0 init/main.c:1615 kernel_init+0x19/0x290 init/main.c:1506 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Memory state around the buggy address: ffff888064858700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888064858780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888064858800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888064858880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888064858900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================