================================================================== BUG: KASAN: use-after-free in tcp_highest_sack_seq include/net/tcp.h:1706 [inline] BUG: KASAN: use-after-free in tcp_ack+0x42bb/0x4fd0 net/ipv4/tcp_input.c:3537 Read of size 4 at addr ffff8801c47d1528 by task syz-executor6/3332 CPU: 1 PID: 3332 Comm: syz-executor6 Not tainted 4.14.0-next-20171114+ #42 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_load4_noabort+0x14/0x20 mm/kasan/report.c:429 tcp_highest_sack_seq include/net/tcp.h:1706 [inline] tcp_ack+0x42bb/0x4fd0 net/ipv4/tcp_input.c:3537 tcp_rcv_established+0x672/0x18a0 net/ipv4/tcp_input.c:5439 tcp_v4_do_rcv+0x2ab/0x7d0 net/ipv4/tcp_ipv4.c:1468 tcp_v4_rcv+0x24e5/0x2f80 net/ipv4/tcp_ipv4.c:1729 ip_local_deliver_finish+0x2e2/0xba0 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+0x887/0x19a0 net/ipv4/ip_input.c:397 NF_HOOK include/linux/netfilter.h:250 [inline] ip_rcv+0xc3f/0x1820 net/ipv4/ip_input.c:493 __netif_receive_skb_core+0x1a3e/0x3450 net/core/dev.c:4478 __netif_receive_skb+0x2c/0x1b0 net/core/dev.c:4543 process_backlog+0x203/0x740 net/core/dev.c:5222 napi_poll net/core/dev.c:5620 [inline] net_rx_action+0x792/0x1910 net/core/dev.c:5686 __do_softirq+0x29d/0xbb2 kernel/softirq.c:285 invoke_softirq kernel/softirq.c:365 [inline] irq_exit+0x1d3/0x210 kernel/softirq.c:405 exiting_irq arch/x86/include/asm/apic.h:540 [inline] smp_apic_timer_interrupt+0x16b/0x700 arch/x86/kernel/apic/apic.c:1052 apic_timer_interrupt+0x9d/0xb0 arch/x86/entry/entry_64.S:791 RIP: 0010:__read_once_size include/linux/compiler.h:183 [inline] RIP: 0010:compound_head include/linux/page-flags.h:147 [inline] RIP: 0010:get_page include/linux/mm.h:838 [inline] RIP: 0010:copy_one_pte mm/memory.c:1036 [inline] RIP: 0010:copy_pte_range mm/memory.c:1098 [inline] RIP: 0010:copy_pmd_range mm/memory.c:1149 [inline] RIP: 0010:copy_pud_range mm/memory.c:1183 [inline] RIP: 0010:copy_p4d_range mm/memory.c:1205 [inline] RIP: 0010:copy_page_range+0xeb7/0x27a0 mm/memory.c:1267 RSP: 0018:ffff8801c5d7ec60 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff11 RAX: ffff8801c5d7f058 RBX: ffffea000728aa20 RCX: ffff8801c5d7f058 RDX: dead000000000100 RSI: 00007fb33f80e000 RDI: 80000001ca2a8007 RBP: ffff8801c5d7f180 R08: ffffea000728a540 R09: 0000000000000004 R10: 0000000000000000 R11: ffffffff87469d60 R12: 0000000000000010 R13: dffffc0000000000 R14: ffffea000728aa00 R15: ffff880192df7070 dup_mmap kernel/fork.c:513 [inline] dup_mm kernel/fork.c:1239 [inline] copy_mm+0xd68/0x1310 kernel/fork.c:1293 copy_process.part.36+0x1f31/0x4b30 kernel/fork.c:1797 copy_process kernel/fork.c:1610 [inline] _do_fork+0x1ef/0xff0 kernel/fork.c:2089 SYSC_clone kernel/fork.c:2199 [inline] SyS_clone+0x37/0x50 kernel/fork.c:2193 do_syscall_64+0x26c/0x920 arch/x86/entry/common.c:285 entry_SYSCALL64_slow_path+0x25/0x25 RIP: 0033:0x450faa RSP: 002b:0000000000a6f9e0 EFLAGS: 00000246 ORIG_RAX: 0000000000000038 RAX: ffffffffffffffda RBX: 0000000000a6f9e0 RCX: 0000000000450faa RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000001200011 RBP: 0000000000a6fa20 R08: 0000000000000001 R09: 0000000000d94940 R10: 0000000000d94c10 R11: 0000000000000246 R12: 0000000000000001 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000010 Allocated by task 7633: 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_node+0x144/0x760 mm/slab.c:3638 __alloc_skb+0xf1/0x780 net/core/skbuff.c:193 alloc_skb_fclone include/linux/skbuff.h:1023 [inline] sk_stream_alloc_skb+0x11d/0x900 net/ipv4/tcp.c:870 tcp_sendmsg_locked+0x1341/0x3b80 net/ipv4/tcp.c:1299 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:632 [inline] sock_sendmsg+0xca/0x110 net/socket.c:642 SYSC_sendto+0x358/0x5a0 net/socket.c:1749 SyS_sendto+0x40/0x50 net/socket.c:1717 entry_SYSCALL_64_fastpath+0x1f/0x96 Freed by task 7633: 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:3492 [inline] kmem_cache_free+0x77/0x280 mm/slab.c:3750 kfree_skbmem+0xdd/0x1d0 net/core/skbuff.c:603 __kfree_skb+0x1d/0x20 net/core/skbuff.c:642 tcp_collapse_one+0x114/0x1e0 net/ipv4/tcp_input.c:4685 tcp_collapse+0x935/0xd20 net/ipv4/tcp_input.c:4799 tcp_prune_queue net/ipv4/tcp_input.c:4915 [inline] tcp_try_rmem_schedule+0xaab/0x1820 net/ipv4/tcp_input.c:4352 tcp_data_queue+0x7bd/0x3dd0 net/ipv4/tcp_input.c:4596 tcp_rcv_established+0x844/0x18a0 net/ipv4/tcp_input.c:5448 tcp_v4_do_rcv+0x2ab/0x7d0 net/ipv4/tcp_ipv4.c:1468 sk_backlog_rcv include/net/sock.h:909 [inline] __release_sock+0x124/0x360 net/core/sock.c:2264 release_sock+0xa4/0x2a0 net/core/sock.c:2778 tcp_sendmsg+0x3a/0x50 net/ipv4/tcp.c:1462 inet_sendmsg+0x11f/0x5e0 net/ipv4/af_inet.c:763 sock_sendmsg_nosec net/socket.c:632 [inline] sock_sendmsg+0xca/0x110 net/socket.c:642 ___sys_sendmsg+0x75b/0x8a0 net/socket.c:2048 __sys_sendmsg+0xe5/0x210 net/socket.c:2082 SYSC_sendmsg net/socket.c:2093 [inline] SyS_sendmsg+0x2d/0x50 net/socket.c:2089 entry_SYSCALL_64_fastpath+0x1f/0x96 The buggy address belongs to the object at ffff8801c47d1500 which belongs to the cache skbuff_fclone_cache of size 456 The buggy address is located 40 bytes inside of 456-byte region [ffff8801c47d1500, ffff8801c47d16c8) The buggy address belongs to the page: page:ffffea000711f440 count:1 mapcount:0 mapping:ffff8801c47d1000 index:0x0 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffff8801c47d1000 0000000000000000 0000000100000006 raw: ffffea000761e060 ffffea00064d91a0 ffff8801d9ca0500 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801c47d1400: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc ffff8801c47d1480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8801c47d1500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801c47d1580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801c47d1600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================