================================================================== 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 ffff8880538ac6dc by task syz.1.598/8076 CPU: 3 UID: 0 PID: 8076 Comm: syz.1.598 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:0x7fb80d985d29 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:00007fb80e6f4038 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 00007fb80db76080 RCX: 00007fb80d985d29 RDX: 0000000000000028 RSI: 0000000020000180 RDI: 0000000000000003 RBP: 00007fb80da01b08 R08: 0000000020000140 R09: 0000000000000014 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fb80db76080 R15: 00007ffc83268db8 Allocated by task 8076: 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 8076: 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 ffff8880538ac600 which belongs to the cache skbuff_small_head of size 640 The buggy address is located 220 bytes inside of freed 640-byte region [ffff8880538ac600, ffff8880538ac880) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x538ac 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 ffff88801e2bca00 ffffea00008baf00 dead000000000002 raw: 0000000000000000 0000000080150015 00000001f5000000 0000000000000000 head: 00fff00000000040 ffff88801e2bca00 ffffea00008baf00 dead000000000002 head: 0000000000000000 0000000080150015 00000001f5000000 0000000000000000 head: 00fff00000000002 ffffea00014e2b01 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 0xf2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_MEMALLOC), pid 9, tgid 9 (kworker/0:1), ts 80527568345, free_ts 80120782846 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 __netdev_alloc_skb+0x76/0x920 net/core/skbuff.c:742 netdev_alloc_skb include/linux/skbuff.h:3402 [inline] dev_alloc_skb include/linux/skbuff.h:3415 [inline] __ieee80211_beacon_get+0xc1f/0x16b0 net/mac80211/tx.c:5474 ieee80211_beacon_get_tim+0xa7/0x280 net/mac80211/tx.c:5596 ieee80211_beacon_get include/net/mac80211.h:5635 [inline] mac80211_hwsim_beacon_tx+0x4ea/0xa10 drivers/net/wireless/virtual/mac80211_hwsim.c:2311 __iterate_interfaces+0x2e5/0x640 net/mac80211/util.c:758 ieee80211_iterate_active_interfaces_atomic+0x71/0x1b0 net/mac80211/util.c:794 page last free pid 6732 tgid 6732 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] __do_kmalloc_node mm/slub.c:4297 [inline] __kmalloc_noprof+0x1cd/0x510 mm/slub.c:4310 kmalloc_noprof include/linux/slab.h:905 [inline] tomoyo_realpath_from_path+0xb9/0x720 security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_check_open_permission+0x2ad/0x3c0 security/tomoyo/file.c:771 tomoyo_file_open+0x6b/0x90 security/tomoyo/tomoyo.c:334 security_file_open+0x84/0x1e0 security/security.c:3105 do_dentry_open+0x57e/0x1ea0 fs/open.c:928 vfs_open+0x82/0x3f0 fs/open.c:1075 do_open fs/namei.c:3828 [inline] path_openat+0x1e6a/0x2d60 fs/namei.c:3987 do_filp_open+0x20c/0x470 fs/namei.c:4014 do_sys_openat2+0x17a/0x1e0 fs/open.c:1402 do_sys_open fs/open.c:1417 [inline] __do_sys_openat fs/open.c:1433 [inline] __se_sys_openat fs/open.c:1428 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1428 Memory state around the buggy address: ffff8880538ac580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880538ac600: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880538ac680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880538ac700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880538ac780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================