================================================================== BUG: KASAN: use-after-free in erspan_build_header+0x3bf/0x3d0 net/ipv4/ip_gre.c:698 Read of size 2 at addr ffff8801d83d1ccb by task syz-executor3/7412 CPU: 0 PID: 7412 Comm: syz-executor3 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:0xf7f91c79 RSP: 002b:00000000f778d08c EFLAGS: 00000296 ORIG_RAX: 0000000000000171 RAX: ffffffffffffffda RBX: 0000000000000013 RCX: 0000000020015f41 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020015fec RBP: 0000000000000014 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 4400: 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 ptlock_alloc+0x24/0x70 mm/memory.c:4692 ptlock_init include/linux/mm.h:1790 [inline] pgtable_page_ctor include/linux/mm.h:1824 [inline] pte_alloc_one+0x59/0x100 arch/x86/mm/pgtable.c:32 do_fault_around mm/memory.c:3566 [inline] do_read_fault mm/memory.c:3607 [inline] do_fault mm/memory.c:3712 [inline] handle_pte_fault mm/memory.c:3943 [inline] __handle_mm_fault+0x3b12/0x3ce0 mm/memory.c:4067 handle_mm_fault+0x334/0x8d0 mm/memory.c:4104 __do_page_fault+0x5c9/0xc90 arch/x86/mm/fault.c:1426 do_page_fault+0xee/0x720 arch/x86/mm/fault.c:1501 page_fault+0x4c/0x60 arch/x86/entry/entry_64.S:1261 Freed by task 4400: 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 ptlock_free+0x38/0x42 mm/memory.c:4701 pte_lock_deinit include/linux/mm.h:1800 [inline] pgtable_page_dtor include/linux/mm.h:1832 [inline] ___pte_free_tlb+0x4b/0xc0 arch/x86/mm/pgtable.c:58 __pte_free_tlb arch/x86/include/asm/pgalloc.h:73 [inline] free_pte_range mm/memory.c:440 [inline] free_pmd_range mm/memory.c:458 [inline] free_pud_range mm/memory.c:492 [inline] free_p4d_range mm/memory.c:526 [inline] free_pgd_range+0xaba/0xd90 mm/memory.c:606 free_pgtables+0x270/0x330 mm/memory.c:638 exit_mmap+0x291/0x500 mm/mmap.c:3039 __mmput kernel/fork.c:923 [inline] mmput+0x223/0x6d0 kernel/fork.c:944 exit_mm kernel/exit.c:544 [inline] do_exit+0x90a/0x1ad0 kernel/exit.c:852 do_group_exit+0x149/0x400 kernel/exit.c:968 SYSC_exit_group kernel/exit.c:979 [inline] SyS_exit_group+0x1d/0x20 kernel/exit.c:977 entry_SYSCALL_64_fastpath+0x29/0xa0 The buggy address belongs to the object at ffff8801d83d1cb8 which belongs to the cache page->ptl of size 56 The buggy address is located 19 bytes inside of 56-byte region [ffff8801d83d1cb8, ffff8801d83d1cf0) The buggy address belongs to the page: page:ffffea000760f440 count:1 mapcount:0 mapping:ffff8801d83d1000 index:0xffff8801d83d1f78 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffff8801d83d1000 ffff8801d83d1f78 0000000100000020 raw: ffffea00075eb6e0 ffffea000760f8a0 ffff8801db010040 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801d83d1b80: fb fb fc fc fc fc fb fb fb fb fb fb fb fc fc fc ffff8801d83d1c00: fc fb fb fb fb fb fb fb fc fc fc fc fb fb fb fb >ffff8801d83d1c80: fb fb fb fc fc fc fc fb fb fb fb fb fb fb fc fc ^ ffff8801d83d1d00: fc fc fb fb fb fb fb fb fb fc fc fc fc fb fb fb ffff8801d83d1d80: fb fb fb fb fc fc fc fc fb fb fb fb fb fb fb fc ==================================================================