================================================================== BUG: KASAN: slab-use-after-free in ipv6_addr_equal include/net/ipv6.h:673 [inline] BUG: KASAN: slab-use-after-free in ip6gre_xmit_ipv6 net/ipv6/ip6_gre.c:862 [inline] BUG: KASAN: slab-use-after-free in ip6gre_tunnel_xmit+0x10d3/0x10f0 net/ipv6/ip6_gre.c:925 Read of size 8 at addr ffff88802b8c4cdc by task syz.1.212/6540 CPU: 3 UID: 0 PID: 6540 Comm: syz.1.212 Not tainted 6.13.0-rc7-syzkaller-00043-g619f0b6fad52 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xc3/0x620 mm/kasan/report.c:489 kasan_report+0xd9/0x110 mm/kasan/report.c:602 ipv6_addr_equal include/net/ipv6.h:673 [inline] ip6gre_xmit_ipv6 net/ipv6/ip6_gre.c:862 [inline] ip6gre_tunnel_xmit+0x10d3/0x10f0 net/ipv6/ip6_gre.c:925 __netdev_start_xmit include/linux/netdevice.h:5002 [inline] netdev_start_xmit include/linux/netdevice.h:5011 [inline] xmit_one net/core/dev.c:3620 [inline] dev_hard_start_xmit+0x9a/0x7b0 net/core/dev.c:3636 sch_direct_xmit+0x1ae/0xc30 net/sched/sch_generic.c:343 __dev_xmit_skb net/core/dev.c:3859 [inline] __dev_queue_xmit+0x13d4/0x43e0 net/core/dev.c:4432 dev_queue_xmit include/linux/netdevice.h:3168 [inline] packet_xmit+0x23e/0x360 net/packet/af_packet.c:276 packet_snd net/packet/af_packet.c:3132 [inline] packet_sendmsg+0x2700/0x5660 net/packet/af_packet.c:3164 sock_sendmsg_nosec net/socket.c:711 [inline] __sock_sendmsg net/socket.c:726 [inline] __sys_sendto+0x488/0x4f0 net/socket.c:2197 __do_sys_sendto net/socket.c:2204 [inline] __se_sys_sendto net/socket.c:2200 [inline] __x64_sys_sendto+0xe0/0x1c0 net/socket.c:2200 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f40bab85d29 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:00007f40ba9d8038 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 00007f40bad76080 RCX: 00007f40bab85d29 RDX: 0000000000000028 RSI: 0000000020000180 RDI: 0000000000000003 RBP: 00007f40bac01b08 R08: 0000000020000140 R09: 0000000000000014 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000001 R14: 00007f40bad76080 R15: 00007ffff31f55b8 Allocated by task 6540: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4119 [inline] slab_alloc_node mm/slub.c:4168 [inline] kmem_cache_alloc_node_noprof+0x223/0x3c0 mm/slub.c:4220 kmalloc_reserve+0x18b/0x2c0 net/core/skbuff.c:587 __alloc_skb+0x164/0x380 net/core/skbuff.c:678 alloc_skb include/linux/skbuff.h:1323 [inline] alloc_skb_with_frags+0xe4/0x850 net/core/skbuff.c:6612 sock_alloc_send_pskb+0x7f1/0x980 net/core/sock.c:2884 packet_alloc_skb net/packet/af_packet.c:2981 [inline] packet_snd net/packet/af_packet.c:3075 [inline] packet_sendmsg+0x1f70/0x5660 net/packet/af_packet.c:3164 sock_sendmsg_nosec net/socket.c:711 [inline] __sock_sendmsg net/socket.c:726 [inline] __sys_sendto+0x488/0x4f0 net/socket.c:2197 __do_sys_sendto net/socket.c:2204 [inline] __se_sys_sendto net/socket.c:2200 [inline] __x64_sys_sendto+0xe0/0x1c0 net/socket.c:2200 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 6540: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:582 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2353 [inline] slab_free mm/slub.c:4613 [inline] kmem_cache_free+0x152/0x4c0 mm/slub.c:4715 skb_kfree_head net/core/skbuff.c:1084 [inline] skb_kfree_head net/core/skbuff.c:1081 [inline] skb_free_head+0x18a/0x1d0 net/core/skbuff.c:1098 skb_release_data+0x560/0x730 net/core/skbuff.c:1125 skb_release_all net/core/skbuff.c:1190 [inline] __kfree_skb net/core/skbuff.c:1204 [inline] sk_skb_reason_drop+0x129/0x1a0 net/core/skbuff.c:1242 packet_rcv+0x16c/0x15a0 net/packet/af_packet.c:2277 dev_queue_xmit_nit+0x89f/0xbc0 net/core/dev.c:2377 xmit_one net/core/dev.c:3616 [inline] dev_hard_start_xmit+0x283/0x7b0 net/core/dev.c:3636 sch_direct_xmit+0x1ae/0xc30 net/sched/sch_generic.c:343 __dev_xmit_skb net/core/dev.c:3859 [inline] __dev_queue_xmit+0x13d4/0x43e0 net/core/dev.c:4432 dev_queue_xmit include/linux/netdevice.h:3168 [inline] packet_xmit+0x23e/0x360 net/packet/af_packet.c:276 packet_snd net/packet/af_packet.c:3132 [inline] packet_sendmsg+0x2700/0x5660 net/packet/af_packet.c:3164 sock_sendmsg_nosec net/socket.c:711 [inline] __sock_sendmsg net/socket.c:726 [inline] __sys_sendto+0x488/0x4f0 net/socket.c:2197 __do_sys_sendto net/socket.c:2204 [inline] __se_sys_sendto net/socket.c:2200 [inline] __x64_sys_sendto+0xe0/0x1c0 net/socket.c:2200 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88802b8c4c00 which belongs to the cache skbuff_small_head of size 640 The buggy address is located 220 bytes inside of freed 640-byte region [ffff88802b8c4c00, ffff88802b8c4e80) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88802b8c4f00 pfn:0x2b8c4 head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff888100afaa00 ffffea0000cb4800 dead000000000002 raw: ffff88802b8c4f00 0000000080150010 00000001f5000000 0000000000000000 head: 00fff00000000040 ffff888100afaa00 ffffea0000cb4800 dead000000000002 head: ffff88802b8c4f00 0000000080150010 00000001f5000000 0000000000000000 head: 00fff00000000002 ffffea0000ae3101 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 6041, tgid 6041 (syz-executor), ts 53696631844, free_ts 53685572941 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1558 prep_new_page mm/page_alloc.c:1566 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3476 __alloc_pages_noprof+0x223/0x25b0 mm/page_alloc.c:4753 alloc_pages_mpol_noprof+0x2c8/0x620 mm/mempolicy.c:2269 alloc_slab_page mm/slub.c:2423 [inline] allocate_slab mm/slub.c:2589 [inline] new_slab+0x2c9/0x410 mm/slub.c:2642 ___slab_alloc+0xd7d/0x17a0 mm/slub.c:3830 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3920 __slab_alloc_node mm/slub.c:3995 [inline] slab_alloc_node mm/slub.c:4156 [inline] kmem_cache_alloc_node_noprof+0xfc/0x3c0 mm/slub.c:4220 kmalloc_reserve+0x18b/0x2c0 net/core/skbuff.c:587 __alloc_skb+0x164/0x380 net/core/skbuff.c:678 alloc_skb include/linux/skbuff.h:1323 [inline] alloc_uevent_skb+0x7d/0x210 lib/kobject_uevent.c:289 uevent_net_broadcast_tagged lib/kobject_uevent.c:352 [inline] kobject_uevent_net_broadcast lib/kobject_uevent.c:413 [inline] kobject_uevent_env+0x11cb/0x1870 lib/kobject_uevent.c:608 rx_queue_add_kobject net/core/net-sysfs.c:1124 [inline] net_rx_queue_update_kobjects+0x17a/0x5f0 net/core/net-sysfs.c:1164 register_queue_kobjects net/core/net-sysfs.c:1898 [inline] netdev_register_kobject+0x269/0x3a0 net/core/net-sysfs.c:2143 register_netdevice+0x1473/0x1e90 net/core/dev.c:10618 veth_newlink+0x3c2/0x8f0 drivers/net/veth.c:1844 page last free pid 6041 tgid 6041 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0x661/0x1080 mm/page_alloc.c:2659 __put_partials+0x14c/0x170 mm/slub.c:3157 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4119 [inline] slab_alloc_node mm/slub.c:4168 [inline] __kmalloc_cache_noprof+0x243/0x410 mm/slub.c:4324 kmalloc_noprof include/linux/slab.h:901 [inline] kzalloc_noprof include/linux/slab.h:1037 [inline] kobject_uevent_env+0x265/0x1870 lib/kobject_uevent.c:540 __kobject_del+0x168/0x1f0 lib/kobject.c:601 kobject_cleanup lib/kobject.c:680 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x327/0x5a0 lib/kobject.c:737 net_rx_queue_update_kobjects+0x478/0x5f0 net/core/net-sysfs.c:1178 netif_set_real_num_rx_queues+0x169/0x210 net/core/dev.c:3024 veth_init_queues+0x151/0x190 drivers/net/veth.c:1761 veth_newlink+0x416/0x8f0 drivers/net/veth.c:1856 rtnl_newlink_create net/core/rtnetlink.c:3786 [inline] __rtnl_newlink net/core/rtnetlink.c:3897 [inline] rtnl_newlink+0xb95/0x1d60 net/core/rtnetlink.c:4012 rtnetlink_rcv_msg+0x95b/0xea0 net/core/rtnetlink.c:6922 netlink_rcv_skb+0x16b/0x440 net/netlink/af_netlink.c:2542 Memory state around the buggy address: ffff88802b8c4b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802b8c4c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88802b8c4c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802b8c4d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802b8c4d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================