================================================================== BUG: KASAN: use-after-free in tcp_connect+0x2606/0x2fa0 net/ipv4/tcp_output.c:3413 Read of size 4 at addr ffff8801c603e2a8 by task syz-executor.4/16249 CPU: 1 PID: 16249 Comm: syz-executor.4 Not tainted 4.9.141+ #23 ffff8801cb867580 ffffffff81b42e79 ffffea0007180f80 ffff8801c603e2a8 0000000000000000 ffff8801c603e2a8 000000000000ffc4 ffff8801cb8675b8 ffffffff815009b8 ffff8801c603e2a8 0000000000000004 0000000000000000 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x128 lib/dump_stack.c:51 [] print_address_description+0x6c/0x234 mm/kasan/report.c:256 [] kasan_report_error mm/kasan/report.c:355 [inline] [] kasan_report.cold.6+0x242/0x2fe mm/kasan/report.c:412 [] __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:432 [] tcp_connect+0x2606/0x2fa0 net/ipv4/tcp_output.c:3413 [] tcp_v6_connect+0x1760/0x1ad0 net/ipv6/tcp_ipv6.c:298 [] __inet_stream_connect+0x6e0/0xbf0 net/ipv4/af_inet.c:627 [] tcp_sendmsg_fastopen net/ipv4/tcp.c:1116 [inline] [] tcp_sendmsg+0x218a/0x2fd0 net/ipv4/tcp.c:1145 [] inet_sendmsg+0x203/0x4d0 net/ipv4/af_inet.c:770 [] sock_sendmsg_nosec net/socket.c:648 [inline] [] sock_sendmsg+0xbb/0x110 net/socket.c:658 [] SYSC_sendto net/socket.c:1683 [inline] [] SyS_sendto+0x220/0x370 net/socket.c:1651 [] do_syscall_32_irqs_on arch/x86/entry/common.c:328 [inline] [] do_fast_syscall_32+0x2f1/0xa10 arch/x86/entry/common.c:390 [] entry_SYSENTER_compat+0x90/0xa2 arch/x86/entry/entry_64_compat.S:137 Allocated by task 16200: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack mm/kasan/kasan.c:505 [inline] set_track mm/kasan/kasan.c:517 [inline] kasan_kmalloc.part.1+0x62/0xf0 mm/kasan/kasan.c:609 kasan_kmalloc+0xaf/0xc0 mm/kasan/kasan.c:594 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:547 slab_post_alloc_hook mm/slab.h:417 [inline] slab_alloc_node mm/slub.c:2715 [inline] slab_alloc mm/slub.c:2723 [inline] kmem_cache_alloc+0xd5/0x2b0 mm/slub.c:2728 kmem_cache_alloc_node include/linux/slab.h:364 [inline] __alloc_skb+0xe6/0x5b0 net/core/skbuff.c:219 alloc_skb_fclone include/linux/skbuff.h:966 [inline] sk_stream_alloc_skb+0xa3/0x5d0 net/ipv4/tcp.c:828 tcp_sendmsg+0xe72/0x2fd0 net/ipv4/tcp.c:1230 inet_sendmsg+0x203/0x4d0 net/ipv4/af_inet.c:770 sock_sendmsg_nosec net/socket.c:648 [inline] sock_sendmsg+0xbb/0x110 net/socket.c:658 sock_write_iter+0x223/0x3b0 net/socket.c:856 new_sync_write fs/read_write.c:496 [inline] __vfs_write+0x3d7/0x580 fs/read_write.c:509 vfs_write+0x187/0x520 fs/read_write.c:557 SYSC_write fs/read_write.c:604 [inline] SyS_write+0xd9/0x1c0 fs/read_write.c:596 do_syscall_32_irqs_on arch/x86/entry/common.c:328 [inline] do_fast_syscall_32+0x2f1/0xa10 arch/x86/entry/common.c:390 entry_SYSENTER_compat+0x90/0xa2 arch/x86/entry/entry_64_compat.S:137 Freed by task 16249: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack mm/kasan/kasan.c:505 [inline] set_track mm/kasan/kasan.c:517 [inline] kasan_slab_free+0xac/0x190 mm/kasan/kasan.c:582 slab_free_hook mm/slub.c:1355 [inline] slab_free_freelist_hook mm/slub.c:1377 [inline] slab_free mm/slub.c:2958 [inline] kmem_cache_free+0xbe/0x310 mm/slub.c:2980 kfree_skbmem+0x7c/0x100 net/core/skbuff.c:644 __kfree_skb+0x1d/0x20 net/core/skbuff.c:685 sk_wmem_free_skb include/net/sock.h:1358 [inline] tcp_write_queue_purge include/net/tcp.h:1530 [inline] tcp_connect_init net/ipv4/tcp_output.c:3253 [inline] tcp_connect+0xa74/0x2fa0 net/ipv4/tcp_output.c:3384 tcp_v6_connect+0x1760/0x1ad0 net/ipv6/tcp_ipv6.c:298 __inet_stream_connect+0x6e0/0xbf0 net/ipv4/af_inet.c:627 tcp_sendmsg_fastopen net/ipv4/tcp.c:1116 [inline] tcp_sendmsg+0x218a/0x2fd0 net/ipv4/tcp.c:1145 inet_sendmsg+0x203/0x4d0 net/ipv4/af_inet.c:770 sock_sendmsg_nosec net/socket.c:648 [inline] sock_sendmsg+0xbb/0x110 net/socket.c:658 SYSC_sendto net/socket.c:1683 [inline] SyS_sendto+0x220/0x370 net/socket.c:1651 do_syscall_32_irqs_on arch/x86/entry/common.c:328 [inline] do_fast_syscall_32+0x2f1/0xa10 arch/x86/entry/common.c:390 entry_SYSENTER_compat+0x90/0xa2 arch/x86/entry/entry_64_compat.S:137 The buggy address belongs to the object at ffff8801c603e280 which belongs to the cache skbuff_fclone_cache of size 456 The buggy address is located 40 bytes inside of 456-byte region [ffff8801c603e280, ffff8801c603e448) The buggy address belongs to the page: page:ffffea0007180f80 count:1 mapcount:0 mapping: (null) index:0x0 compound_mapcount: 0 flags: 0x4000000000004080(slab|head) page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801c603e180: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc ffff8801c603e200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8801c603e280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801c603e300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801c603e380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================