================================================================== BUG: KASAN: use-after-free in erspan_build_header+0x3bf/0x3d0 net/ipv4/ip_gre.c:698 Read of size 2 at addr ffff8801bc66e08b by task syz-executor6/21080 CPU: 1 PID: 21080 Comm: syz-executor6 Not tainted 4.15.0+ #198 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 do_syscall_32_irqs_on arch/x86/entry/common.c:327 [inline] do_fast_syscall_32+0x3ee/0xf9d arch/x86/entry/common.c:389 entry_SYSENTER_compat+0x54/0x63 arch/x86/entry/entry_64_compat.S:129 RIP: 0023:0xf7f93c79 RSP: 002b:00000000f778f08c EFLAGS: 00000296 ORIG_RAX: 0000000000000171 RAX: ffffffffffffffda RBX: 0000000000000013 RCX: 0000000020003fd9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020008000 RBP: 000000000000001c R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 4107: 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 kmem_cache_alloc_node_trace+0x150/0x750 mm/slab.c:3653 kmalloc_node include/linux/slab.h:537 [inline] kzalloc_node include/linux/slab.h:699 [inline] __get_vm_area_node+0xae/0x340 mm/vmalloc.c:1402 __vmalloc_node_range+0xa3/0x650 mm/vmalloc.c:1754 __vmalloc_node mm/vmalloc.c:1804 [inline] __vmalloc_node_flags mm/vmalloc.c:1818 [inline] vmalloc+0x45/0x50 mm/vmalloc.c:1840 xt_compat_add_offset+0x228/0x380 net/netfilter/x_tables.c:525 check_compat_entry_size_and_hooks net/ipv4/netfilter/ip_tables.c:1344 [inline] translate_compat_table+0x9cf/0x1b90 net/ipv4/netfilter/ip_tables.c:1421 compat_do_replace.isra.15+0x30e/0x720 net/ipv4/netfilter/ip_tables.c:1524 compat_do_ipt_set_ctl+0x106/0x150 net/ipv4/netfilter/ip_tables.c:1553 compat_nf_sockopt net/netfilter/nf_sockopt.c:144 [inline] compat_nf_setsockopt+0x88/0x130 net/netfilter/nf_sockopt.c:156 compat_ip_setsockopt+0x9d/0xf0 net/ipv4/ip_sockglue.c:1285 inet_csk_compat_setsockopt+0x95/0x120 net/ipv4/inet_connection_sock.c:1042 compat_tcp_setsockopt+0x3d/0x70 net/ipv4/tcp.c:2886 compat_sock_common_setsockopt+0xb2/0x140 net/core/sock.c:2979 C_SYSC_setsockopt net/compat.c:403 [inline] compat_SyS_setsockopt net/compat.c:386 [inline] C_SYSC_socketcall net/compat.c:853 [inline] compat_SyS_socketcall+0xbf7/0x17c0 net/compat.c:788 do_syscall_32_irqs_on arch/x86/entry/common.c:327 [inline] do_fast_syscall_32+0x3ee/0xf9d arch/x86/entry/common.c:389 entry_SYSENTER_compat+0x54/0x63 arch/x86/entry/entry_64_compat.S:129 Freed by task 4107: 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] kfree+0xd6/0x260 mm/slab.c:3803 __vunmap+0x2b9/0x380 mm/vmalloc.c:1545 vfree+0x50/0xe0 mm/vmalloc.c:1606 xt_compat_flush_offsets+0x68/0x130 net/netfilter/x_tables.c:546 translate_compat_table+0x1447/0x1b90 net/ipv4/netfilter/ip_tables.c:1457 compat_do_replace.isra.15+0x30e/0x720 net/ipv4/netfilter/ip_tables.c:1524 compat_do_ipt_set_ctl+0x106/0x150 net/ipv4/netfilter/ip_tables.c:1553 compat_nf_sockopt net/netfilter/nf_sockopt.c:144 [inline] compat_nf_setsockopt+0x88/0x130 net/netfilter/nf_sockopt.c:156 compat_ip_setsockopt+0x9d/0xf0 net/ipv4/ip_sockglue.c:1285 inet_csk_compat_setsockopt+0x95/0x120 net/ipv4/inet_connection_sock.c:1042 compat_tcp_setsockopt+0x3d/0x70 net/ipv4/tcp.c:2886 compat_sock_common_setsockopt+0xb2/0x140 net/core/sock.c:2979 C_SYSC_setsockopt net/compat.c:403 [inline] compat_SyS_setsockopt net/compat.c:386 [inline] C_SYSC_socketcall net/compat.c:853 [inline] compat_SyS_socketcall+0xbf7/0x17c0 net/compat.c:788 do_syscall_32_irqs_on arch/x86/entry/common.c:327 [inline] do_fast_syscall_32+0x3ee/0xf9d arch/x86/entry/common.c:389 entry_SYSENTER_compat+0x54/0x63 arch/x86/entry/entry_64_compat.S:129 The buggy address belongs to the object at ffff8801bc66e080 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 11 bytes inside of 64-byte region [ffff8801bc66e080, ffff8801bc66e0c0) The buggy address belongs to the page: page:ffffea0006f19b80 count:1 mapcount:0 mapping:ffff8801bc66e000 index:0xffff8801bc66ee00 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffff8801bc66e000 ffff8801bc66ee00 000000010000001f raw: ffffea0006eb7ea0 ffffea0006eca3e0 ffff8801db000340 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801bc66df80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801bc66e000: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff8801bc66e080: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff8801bc66e100: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8801bc66e180: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================