================================================================== BUG: KASAN: use-after-free in tcp_connect+0x268a/0x3070 net/ipv4/tcp_output.c:3417 Read of size 4 at addr ffff8801ca774f28 by task syz-executor.3/25829 CPU: 1 PID: 25829 Comm: syz-executor.3 Not tainted 4.9.155+ #27 ffff8801d999f998 ffffffff81b47871 0000000000000000 ffffea000729dd00 ffff8801ca774f28 0000000000000004 ffffffff82522fca ffff8801d999f9d0 ffffffff81502825 0000000000000000 ffff8801ca774f28 ffff8801ca774f28 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x120 lib/dump_stack.c:51 [] print_address_description+0x6f/0x238 mm/kasan/report.c:256 [] kasan_report_error mm/kasan/report.c:355 [inline] [] kasan_report mm/kasan/report.c:412 [inline] [] kasan_report.cold+0x8c/0x2ba mm/kasan/report.c:397 [] __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:432 [] tcp_connect+0x268a/0x3070 net/ipv4/tcp_output.c:3417 [] tcp_v4_connect+0x1489/0x1c30 net/ipv4/tcp_ipv4.c:250 [] __inet_stream_connect+0x706/0xbf0 net/ipv4/af_inet.c:627 [] inet_stream_connect+0x55/0xa0 net/ipv4/af_inet.c:691 [] SYSC_connect net/socket.c:1575 [inline] [] SyS_connect+0x1a5/0x2e0 net/socket.c:1556 [] do_syscall_64+0x1ad/0x570 arch/x86/entry/common.c:285 [] entry_SYSCALL_64_after_swapgs+0x5d/0xdb Allocated by task 25817: 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.0+0x62/0xf0 mm/kasan/kasan.c:609 kasan_kmalloc+0xb7/0xd0 mm/kasan/kasan.c:594 kasan_slab_alloc+0xf/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+0xe7/0x5e0 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 do_tcp_sendpages net/ipv4/tcp.c:930 [inline] tcp_sendpage net/ipv4/tcp.c:1033 [inline] tcp_sendpage+0x931/0x18e0 net/ipv4/tcp.c:1019 inet_sendpage+0x223/0x520 net/ipv4/af_inet.c:787 kernel_sendpage+0x95/0xf0 net/socket.c:3334 sock_sendpage+0x8b/0xc0 net/socket.c:802 pipe_to_sendpage+0x28d/0x3d0 fs/splice.c:470 splice_from_pipe_feed fs/splice.c:521 [inline] __splice_from_pipe+0x351/0x790 fs/splice.c:645 splice_from_pipe+0x108/0x170 fs/splice.c:680 generic_splice_sendpage+0x3c/0x50 fs/splice.c:851 do_splice_from fs/splice.c:870 [inline] do_splice fs/splice.c:1166 [inline] SYSC_splice fs/splice.c:1416 [inline] SyS_splice+0xddd/0x1440 fs/splice.c:1399 do_syscall_64+0x1ad/0x570 arch/x86/entry/common.c:285 entry_SYSCALL_64_after_swapgs+0x5d/0xdb Freed by task 25829: 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+0xb0/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+0x82/0x100 net/core/skbuff.c:644 __kfree_skb+0x1e/0x30 net/core/skbuff.c:685 sk_wmem_free_skb include/net/sock.h:1362 [inline] tcp_write_queue_purge include/net/tcp.h:1530 [inline] tcp_connect_init net/ipv4/tcp_output.c:3257 [inline] tcp_connect+0xa9b/0x3070 net/ipv4/tcp_output.c:3388 tcp_v4_connect+0x1489/0x1c30 net/ipv4/tcp_ipv4.c:250 __inet_stream_connect+0x706/0xbf0 net/ipv4/af_inet.c:627 inet_stream_connect+0x55/0xa0 net/ipv4/af_inet.c:691 SYSC_connect net/socket.c:1575 [inline] SyS_connect+0x1a5/0x2e0 net/socket.c:1556 do_syscall_64+0x1ad/0x570 arch/x86/entry/common.c:285 entry_SYSCALL_64_after_swapgs+0x5d/0xdb The buggy address belongs to the object at ffff8801ca774f00 which belongs to the cache skbuff_fclone_cache of size 456 The buggy address is located 40 bytes inside of 456-byte region [ffff8801ca774f00, ffff8801ca7750c8) The buggy address belongs to the page: page:ffffea000729dd00 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: ffff8801ca774e00: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc ffff8801ca774e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8801ca774f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801ca774f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801ca775000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================