protocol 0000 is buggy, dev ip6tnl0 ================================================================== BUG: KASAN: use-after-free in atomic_sub_return include/asm-generic/atomic-instrumented.h:258 [inline] BUG: KASAN: use-after-free in skb_release_data+0x16a/0x790 net/core/skbuff.c:559 Write of size 4 at addr ffff8801c71eb160 by task syz-executor2/6302 CPU: 0 PID: 6302 Comm: syz-executor2 Not tainted 4.16.0+ #11 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x1a7/0x27d lib/dump_stack.c:53 print_address_description+0x73/0x250 mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report+0x23c/0x360 mm/kasan/report.c:412 check_memory_region_inline mm/kasan/kasan.c:260 [inline] check_memory_region+0x137/0x190 mm/kasan/kasan.c:267 kasan_check_write+0x14/0x20 mm/kasan/kasan.c:278 atomic_sub_return include/asm-generic/atomic-instrumented.h:258 [inline] skb_release_data+0x16a/0x790 net/core/skbuff.c:559 skb_release_all+0x4a/0x60 net/core/skbuff.c:627 __kfree_skb net/core/skbuff.c:641 [inline] kfree_skb+0x16b/0x4c0 net/core/skbuff.c:659 ip6_tnl_start_xmit+0x184/0x2070 net/ipv6/ip6_tunnel.c:1404 __netdev_start_xmit include/linux/netdevice.h:4066 [inline] netdev_start_xmit include/linux/netdevice.h:4075 [inline] xmit_one net/core/dev.c:3026 [inline] dev_hard_start_xmit+0x24e/0xac0 net/core/dev.c:3042 __dev_queue_xmit+0x26cf/0x2fd0 net/core/dev.c:3557 dev_queue_xmit+0x17/0x20 net/core/dev.c:3590 packet_snd net/packet/af_packet.c:2944 [inline] packet_sendmsg+0x3ad9/0x6020 net/packet/af_packet.c:2969 sock_sendmsg_nosec net/socket.c:630 [inline] sock_sendmsg+0xca/0x110 net/socket.c:640 SYSC_sendto+0x361/0x5c0 net/socket.c:1747 SyS_sendto+0x40/0x50 net/socket.c:1715 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x4552d9 RSP: 002b:00007f399ee2dc68 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 00007f399ee2e6d4 RCX: 00000000004552d9 RDX: 0000000000000000 RSI: 00000000200000c0 RDI: 0000000000000015 RBP: 000000000072bea0 R08: 0000000020000180 R09: 000000000000001c R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000004f3 R14: 00000000006fa768 R15: 0000000000000000 Allocated by task 6302: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:552 __do_kmalloc_node mm/slab.c:3670 [inline] __kmalloc_node_track_caller+0x47/0x70 mm/slab.c:3684 __kmalloc_reserve.isra.39+0x41/0xd0 net/core/skbuff.c:137 __alloc_skb+0x12a/0x760 net/core/skbuff.c:205 alloc_skb include/linux/skbuff.h:983 [inline] alloc_skb_with_frags+0x10d/0x750 net/core/skbuff.c:5229 sock_alloc_send_pskb+0x7b3/0x9e0 net/core/sock.c:2085 packet_alloc_skb net/packet/af_packet.c:2803 [inline] packet_snd net/packet/af_packet.c:2894 [inline] packet_sendmsg+0x1ed7/0x6020 net/packet/af_packet.c:2969 sock_sendmsg_nosec net/socket.c:630 [inline] sock_sendmsg+0xca/0x110 net/socket.c:640 SYSC_sendto+0x361/0x5c0 net/socket.c:1747 SyS_sendto+0x40/0x50 net/socket.c:1715 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 6302: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:520 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:527 __cache_free mm/slab.c:3486 [inline] kfree+0xd9/0x260 mm/slab.c:3801 skb_free_head+0x74/0xb0 net/core/skbuff.c:550 skb_release_data+0x5c1/0x790 net/core/skbuff.c:570 skb_release_all+0x4a/0x60 net/core/skbuff.c:627 __kfree_skb net/core/skbuff.c:641 [inline] consume_skb+0x160/0x490 net/core/skbuff.c:701 packet_rcv+0x15b/0x17a0 net/packet/af_packet.c:2162 dev_queue_xmit_nit+0x866/0xc40 net/core/dev.c:1991 xmit_one net/core/dev.c:3022 [inline] dev_hard_start_xmit+0x16b/0xac0 net/core/dev.c:3042 __dev_queue_xmit+0x26cf/0x2fd0 net/core/dev.c:3557 dev_queue_xmit+0x17/0x20 net/core/dev.c:3590 packet_snd net/packet/af_packet.c:2944 [inline] packet_sendmsg+0x3ad9/0x6020 net/packet/af_packet.c:2969 sock_sendmsg_nosec net/socket.c:630 [inline] sock_sendmsg+0xca/0x110 net/socket.c:640 SYSC_sendto+0x361/0x5c0 net/socket.c:1747 SyS_sendto+0x40/0x50 net/socket.c:1715 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 The buggy address belongs to the object at ffff8801c71eb080 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 224 bytes inside of 512-byte region [ffff8801c71eb080, ffff8801c71eb280) The buggy address belongs to the page: page:ffffea00071c7ac0 count:1 mapcount:0 mapping:ffff8801c71eb080 index:0xffff8801c71eb580 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffff8801c71eb080 ffff8801c71eb580 0000000100000004 raw: ffffea00071cd0a0 ffffea00071efda0 ffff8801dac00940 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801c71eb000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801c71eb080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8801c71eb100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801c71eb180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801c71eb200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================