================================================================== BUG: KASAN: use-after-free in erspan_build_header+0x3bf/0x3d0 net/ipv4/ip_gre.c:698 Read of size 2 at addr ffff8801c1fd6d4b by task syz-executor7/18149 CPU: 0 PID: 18149 Comm: syz-executor7 Not tainted 4.15.0+ #287 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:0x453299 RSP: 002b:00007fe530870c58 EFLAGS: 00000212 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 000000000071bea0 RCX: 0000000000453299 RDX: 0000000000000000 RSI: 0000000020003fd9 RDI: 0000000000000014 RBP: 00000000000005e0 R08: 0000000020008000 R09: 000000000000001c R10: 0000000000000000 R11: 0000000000000212 R12: 00000000006f7da0 R13: 00000000ffffffff R14: 00007fe5308716d4 R15: 0000000000000000 Allocated by task 4155: 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+0x1b12/0x38b0 net/ipv4/tcp_output.c:1176 tcp_write_xmit+0x686/0x51c0 net/ipv4/tcp_output.c:2367 __tcp_push_pending_frames+0xa0/0x250 net/ipv4/tcp_output.c:2543 tcp_push+0x547/0x780 net/ipv4/tcp.c:730 tcp_sendmsg_locked+0x268d/0x3b60 net/ipv4/tcp.c:1424 tcp_sendmsg+0x2f/0x50 net/ipv4/tcp.c:1461 inet_sendmsg+0x11f/0x5e0 net/ipv4/af_inet.c:763 sock_sendmsg_nosec net/socket.c:638 [inline] sock_sendmsg+0xca/0x110 net/socket.c:648 sock_write_iter+0x31a/0x5d0 net/socket.c:917 call_write_iter include/linux/fs.h:1772 [inline] new_sync_write fs/read_write.c:469 [inline] __vfs_write+0x684/0x970 fs/read_write.c:482 vfs_write+0x189/0x510 fs/read_write.c:544 SYSC_write fs/read_write.c:589 [inline] SyS_write+0xef/0x220 fs/read_write.c:581 entry_SYSCALL_64_fastpath+0x29/0xa0 Freed by task 4155: 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+0x1b12/0x38b0 net/ipv4/tcp_output.c:1176 tcp_write_xmit+0x686/0x51c0 net/ipv4/tcp_output.c:2367 __tcp_push_pending_frames+0xa0/0x250 net/ipv4/tcp_output.c:2543 tcp_push+0x547/0x780 net/ipv4/tcp.c:730 tcp_sendmsg_locked+0x268d/0x3b60 net/ipv4/tcp.c:1424 tcp_sendmsg+0x2f/0x50 net/ipv4/tcp.c:1461 inet_sendmsg+0x11f/0x5e0 net/ipv4/af_inet.c:763 sock_sendmsg_nosec net/socket.c:638 [inline] sock_sendmsg+0xca/0x110 net/socket.c:648 sock_write_iter+0x31a/0x5d0 net/socket.c:917 call_write_iter include/linux/fs.h:1772 [inline] new_sync_write fs/read_write.c:469 [inline] __vfs_write+0x684/0x970 fs/read_write.c:482 vfs_write+0x189/0x510 fs/read_write.c:544 SYSC_write fs/read_write.c:589 [inline] SyS_write+0xef/0x220 fs/read_write.c:581 entry_SYSCALL_64_fastpath+0x29/0xa0 The buggy address belongs to the object at ffff8801c1fd6c80 which belongs to the cache skbuff_head_cache of size 232 The buggy address is located 203 bytes inside of 232-byte region [ffff8801c1fd6c80, ffff8801c1fd6d68) The buggy address belongs to the page: page:ffffea000707f580 count:1 mapcount:0 mapping:ffff8801c1fd6000 index:0xffff8801c1fd6dc0 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffff8801c1fd6000 ffff8801c1fd6dc0 000000010000000b raw: ffffea0007486ee0 ffffea0006c467a0 ffff8801d9fe6680 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801c1fd6c00: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc ffff8801c1fd6c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8801c1fd6d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc ^ ffff8801c1fd6d80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ffff8801c1fd6e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================