================================================================== BUG: KASAN: use-after-free in erspan_build_header+0x3bf/0x3d0 net/ipv4/ip_gre.c:698 Read of size 2 at addr ffff8801ccf757cb by task syz-executor6/4765 CPU: 0 PID: 4765 Comm: syz-executor6 Not tainted 4.15.0-rc9+ #277 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+0x194/0x257 lib/dump_stack.c:53 print_address_description+0x73/0x250 mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report+0x25b/0x340 mm/kasan/report.c:409 __asan_report_load_n_noabort+0xf/0x20 mm/kasan/report.c:440 erspan_build_header+0x3bf/0x3d0 net/ipv4/ip_gre.c:698 erspan_xmit+0x3b8/0x13b0 net/ipv4/ip_gre.c:740 __netdev_start_xmit include/linux/netdevice.h:4042 [inline] netdev_start_xmit include/linux/netdevice.h:4051 [inline] packet_direct_xmit+0x315/0x6b0 net/packet/af_packet.c:266 packet_snd net/packet/af_packet.c:2943 [inline] packet_sendmsg+0x3aed/0x60b0 net/packet/af_packet.c:2968 sock_sendmsg_nosec net/socket.c:638 [inline] sock_sendmsg+0xca/0x110 net/socket.c:648 SYSC_sendto+0x361/0x5c0 net/socket.c:1729 SyS_sendto+0x40/0x50 net/socket.c:1697 entry_SYSCALL_64_fastpath+0x29/0xa0 RIP: 0033:0x452f19 RSP: 002b:00007fa12d5dac58 EFLAGS: 00000212 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 000000000071bea0 RCX: 0000000000452f19 RDX: 0000000000000000 RSI: 0000000020015f41 RDI: 0000000000000013 RBP: 0000000000000038 R08: 0000000020015fec R09: 0000000000000014 R10: 0000000000000000 R11: 0000000000000212 R12: 00000000006ef5e0 R13: 00000000ffffffff R14: 00007fa12d5db6d4 R15: 0000000000000000 Allocated by task 0: 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:551 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:489 kmem_cache_alloc+0x12e/0x760 mm/slab.c:3544 skb_clone+0x1ae/0x480 net/core/skbuff.c:1279 dev_queue_xmit_nit+0x40e/0xc40 net/core/dev.c:1943 xmit_one net/core/dev.c:2999 [inline] dev_hard_start_xmit+0x16b/0xac0 net/core/dev.c:3019 sch_direct_xmit+0x31d/0x6d0 net/sched/sch_generic.c:187 __dev_xmit_skb net/core/dev.c:3212 [inline] __dev_queue_xmit+0x202f/0x2cf0 net/core/dev.c:3479 dev_queue_xmit+0x17/0x20 net/core/dev.c:3544 neigh_hh_output include/net/neighbour.h:472 [inline] neigh_output include/net/neighbour.h:480 [inline] ip_finish_output2+0xf59/0x1560 net/ipv4/ip_output.c:229 ip_finish_output+0x864/0xd10 net/ipv4/ip_output.c:317 NF_HOOK_COND include/linux/netfilter.h:239 [inline] ip_output+0x1d2/0x860 net/ipv4/ip_output.c:405 dst_output include/net/dst.h:460 [inline] ip_local_out+0x95/0x160 net/ipv4/ip_output.c:124 ip_queue_xmit+0x8c6/0x18e0 net/ipv4/ip_output.c:504 tcp_transmit_skb+0x1b1b/0x38c0 net/ipv4/tcp_output.c:1176 tcp_send_ack.part.41+0x389/0x610 net/ipv4/tcp_output.c:3617 tcp_send_ack+0x49/0x60 net/ipv4/tcp_output.c:3587 __tcp_ack_snd_check+0x2c6/0x4b0 net/ipv4/tcp_input.c:5035 tcp_ack_snd_check net/ipv4/tcp_input.c:5048 [inline] tcp_rcv_established+0x93b/0x18c0 net/ipv4/tcp_input.c:5461 tcp_v4_do_rcv+0x2ab/0x7d0 net/ipv4/tcp_ipv4.c:1468 tcp_v4_rcv+0x24c6/0x2eb0 net/ipv4/tcp_ipv4.c:1745 ip_local_deliver_finish+0x2f1/0xc50 net/ipv4/ip_input.c:216 NF_HOOK include/linux/netfilter.h:250 [inline] ip_local_deliver+0x1ce/0x6e0 net/ipv4/ip_input.c:257 dst_input include/net/dst.h:466 [inline] ip_rcv_finish+0x959/0x1e30 net/ipv4/ip_input.c:397 NF_HOOK include/linux/netfilter.h:250 [inline] ip_rcv+0xc5a/0x1840 net/ipv4/ip_input.c:493 __netif_receive_skb_core+0x1a41/0x3460 net/core/dev.c:4484 __netif_receive_skb+0x2c/0x1b0 net/core/dev.c:4549 netif_receive_skb_internal+0x10b/0x670 net/core/dev.c:4622 napi_skb_finish net/core/dev.c:4984 [inline] napi_gro_receive+0x3d0/0x500 net/core/dev.c:5015 receive_buf+0xa16/0x2b30 drivers/net/virtio_net.c:883 virtnet_receive drivers/net/virtio_net.c:1128 [inline] virtnet_poll+0x359/0xbc0 drivers/net/virtio_net.c:1210 napi_poll net/core/dev.c:5626 [inline] net_rx_action+0x792/0x1910 net/core/dev.c:5692 __do_softirq+0x2d7/0xb85 kernel/softirq.c:285 Freed by task 0: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3488 [inline] kmem_cache_free+0x83/0x2a0 mm/slab.c:3746 kfree_skbmem+0x1a1/0x1d0 net/core/skbuff.c:582 __kfree_skb net/core/skbuff.c:642 [inline] kfree_skb+0x165/0x4c0 net/core/skbuff.c:659 packet_rcv_spkt+0x117/0x660 net/packet/af_packet.c:1871 dev_queue_xmit_nit+0x866/0xc40 net/core/dev.c:1975 xmit_one net/core/dev.c:2999 [inline] dev_hard_start_xmit+0x16b/0xac0 net/core/dev.c:3019 sch_direct_xmit+0x31d/0x6d0 net/sched/sch_generic.c:187 __dev_xmit_skb net/core/dev.c:3212 [inline] __dev_queue_xmit+0x202f/0x2cf0 net/core/dev.c:3479 dev_queue_xmit+0x17/0x20 net/core/dev.c:3544 neigh_hh_output include/net/neighbour.h:472 [inline] neigh_output include/net/neighbour.h:480 [inline] ip_finish_output2+0xf59/0x1560 net/ipv4/ip_output.c:229 ip_finish_output+0x864/0xd10 net/ipv4/ip_output.c:317 NF_HOOK_COND include/linux/netfilter.h:239 [inline] ip_output+0x1d2/0x860 net/ipv4/ip_output.c:405 dst_output include/net/dst.h:460 [inline] ip_local_out+0x95/0x160 net/ipv4/ip_output.c:124 ip_queue_xmit+0x8c6/0x18e0 net/ipv4/ip_output.c:504 tcp_transmit_skb+0x1b1b/0x38c0 net/ipv4/tcp_output.c:1176 tcp_send_ack.part.41+0x389/0x610 net/ipv4/tcp_output.c:3617 tcp_send_ack+0x49/0x60 net/ipv4/tcp_output.c:3587 __tcp_ack_snd_check+0x2c6/0x4b0 net/ipv4/tcp_input.c:5035 tcp_ack_snd_check net/ipv4/tcp_input.c:5048 [inline] tcp_rcv_established+0x93b/0x18c0 net/ipv4/tcp_input.c:5461 tcp_v4_do_rcv+0x2ab/0x7d0 net/ipv4/tcp_ipv4.c:1468 tcp_v4_rcv+0x24c6/0x2eb0 net/ipv4/tcp_ipv4.c:1745 ip_local_deliver_finish+0x2f1/0xc50 net/ipv4/ip_input.c:216 NF_HOOK include/linux/netfilter.h:250 [inline] ip_local_deliver+0x1ce/0x6e0 net/ipv4/ip_input.c:257 dst_input include/net/dst.h:466 [inline] ip_rcv_finish+0x959/0x1e30 net/ipv4/ip_input.c:397 NF_HOOK include/linux/netfilter.h:250 [inline] ip_rcv+0xc5a/0x1840 net/ipv4/ip_input.c:493 __netif_receive_skb_core+0x1a41/0x3460 net/core/dev.c:4484 __netif_receive_skb+0x2c/0x1b0 net/core/dev.c:4549 netif_receive_skb_internal+0x10b/0x670 net/core/dev.c:4622 napi_skb_finish net/core/dev.c:4984 [inline] napi_gro_receive+0x3d0/0x500 net/core/dev.c:5015 receive_buf+0xa16/0x2b30 drivers/net/virtio_net.c:883 virtnet_receive drivers/net/virtio_net.c:1128 [inline] virtnet_poll+0x359/0xbc0 drivers/net/virtio_net.c:1210 napi_poll net/core/dev.c:5626 [inline] net_rx_action+0x792/0x1910 net/core/dev.c:5692 __do_softirq+0x2d7/0xb85 kernel/softirq.c:285 The buggy address belongs to the object at ffff8801ccf75700 which belongs to the cache skbuff_head_cache of size 232 The buggy address is located 203 bytes inside of 232-byte region [ffff8801ccf75700, ffff8801ccf757e8) The buggy address belongs to the page: page:ffffea000733dd40 count:1 mapcount:0 mapping:ffff8801ccf750c0 index:0x0 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffff8801ccf750c0 0000000000000000 000000010000000c raw: ffffea0007005920 ffffea00070019a0 ffff8801d9842680 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801ccf75680: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc ffff8801ccf75700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8801ccf75780: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc ^ ffff8801ccf75800: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ffff8801ccf75880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================