================================================================== BUG: KASAN: use-after-free in tcp_skb_pcount include/net/tcp.h:912 [inline] BUG: KASAN: use-after-free in tcp_init_tso_segs+0x19d/0x1f0 net/ipv4/tcp_output.c:1790 Read of size 2 at addr ffff8881b8ab7430 by task ksoftirqd/0/7 CPU: 0 PID: 7 Comm: ksoftirqd/0 Not tainted 4.14.143+ #0 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0xca/0x134 lib/dump_stack.c:53 print_address_description+0x60/0x226 mm/kasan/report.c:187 __kasan_report.cold+0x1a/0x41 mm/kasan/report.c:316 tcp_skb_pcount include/net/tcp.h:912 [inline] tcp_init_tso_segs+0x19d/0x1f0 net/ipv4/tcp_output.c:1790 tcp_write_xmit+0x15a/0x4730 net/ipv4/tcp_output.c:2330 __tcp_push_pending_frames+0xa0/0x230 net/ipv4/tcp_output.c:2563 tcp_push_pending_frames include/net/tcp.h:1771 [inline] tcp_data_snd_check net/ipv4/tcp_input.c:5120 [inline] tcp_rcv_established+0x648/0x1610 net/ipv4/tcp_input.c:5567 tcp_v4_do_rcv+0x568/0x700 net/ipv4/tcp_ipv4.c:1467 tcp_v4_rcv+0x23e9/0x3230 net/ipv4/tcp_ipv4.c:1741 ip_local_deliver_finish+0x3a3/0xa30 net/ipv4/ip_input.c:216 NF_HOOK include/linux/netfilter.h:250 [inline] ip_local_deliver+0x373/0x450 net/ipv4/ip_input.c:257 dst_input include/net/dst.h:468 [inline] ip_rcv_finish+0x4ed/0x1610 net/ipv4/ip_input.c:396 NF_HOOK include/linux/netfilter.h:250 [inline] ip_rcv+0xa30/0xf55 net/ipv4/ip_input.c:493 __netif_receive_skb_core+0x13ad/0x2cf0 net/core/dev.c:4477 __netif_receive_skb+0x66/0x210 net/core/dev.c:4515 process_backlog+0x1dc/0x640 net/core/dev.c:5197 napi_poll net/core/dev.c:5598 [inline] net_rx_action+0x366/0xcd0 net/core/dev.c:5664 __do_softirq+0x234/0x9ec kernel/softirq.c:288 run_ksoftirqd+0x2d/0xe0 kernel/softirq.c:670 smpboot_thread_fn+0x5df/0x920 kernel/smpboot.c:164 kthread+0x31f/0x430 kernel/kthread.c:232 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:404 Allocated by task 6378: save_stack mm/kasan/common.c:76 [inline] set_track mm/kasan/common.c:85 [inline] __kasan_kmalloc.part.0+0x53/0xc0 mm/kasan/common.c:495 slab_post_alloc_hook mm/slab.h:439 [inline] slab_alloc_node mm/slub.c:2792 [inline] slab_alloc mm/slub.c:2800 [inline] kmem_cache_alloc+0xee/0x360 mm/slub.c:2805 kmem_cache_alloc_node include/linux/slab.h:361 [inline] __alloc_skb+0xea/0x5c0 net/core/skbuff.c:193 alloc_skb_fclone include/linux/skbuff.h:1022 [inline] sk_stream_alloc_skb+0xf4/0x8a0 net/ipv4/tcp.c:855 tcp_sendmsg_locked+0xf11/0x2f50 net/ipv4/tcp.c:1301 tcp_sendmsg+0x2b/0x40 net/ipv4/tcp.c:1457 inet_sendmsg+0x15b/0x520 net/ipv4/af_inet.c:760 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xb7/0x100 net/socket.c:656 ___sys_sendmsg+0x368/0x890 net/socket.c:2062 __sys_sendmmsg+0x13c/0x360 net/socket.c:2152 SYSC_sendmmsg net/socket.c:2183 [inline] SyS_sendmmsg+0x2f/0x50 net/socket.c:2178 do_syscall_64+0x19b/0x520 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 0xffffffffffffffff Freed by task 6378: save_stack mm/kasan/common.c:76 [inline] set_track mm/kasan/common.c:85 [inline] __kasan_slab_free+0x164/0x210 mm/kasan/common.c:457 slab_free_hook mm/slub.c:1407 [inline] slab_free_freelist_hook mm/slub.c:1458 [inline] slab_free mm/slub.c:3039 [inline] kmem_cache_free+0xd7/0x3b0 mm/slub.c:3055 kfree_skbmem+0x84/0x110 net/core/skbuff.c:607 sk_wmem_free_skb include/net/sock.h:1416 [inline] tcp_remove_empty_skb net/ipv4/tcp.c:929 [inline] tcp_remove_empty_skb+0x264/0x320 net/ipv4/tcp.c:923 tcp_sendmsg_locked+0x1c09/0x2f50 net/ipv4/tcp.c:1435 tcp_sendmsg+0x2b/0x40 net/ipv4/tcp.c:1457 inet_sendmsg+0x15b/0x520 net/ipv4/af_inet.c:760 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xb7/0x100 net/socket.c:656 ___sys_sendmsg+0x368/0x890 net/socket.c:2062 __sys_sendmmsg+0x13c/0x360 net/socket.c:2152 SYSC_sendmmsg net/socket.c:2183 [inline] SyS_sendmmsg+0x2f/0x50 net/socket.c:2178 do_syscall_64+0x19b/0x520 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 0xffffffffffffffff The buggy address belongs to the object at ffff8881b8ab7400 which belongs to the cache skbuff_fclone_cache of size 456 The buggy address is located 48 bytes inside of 456-byte region [ffff8881b8ab7400, ffff8881b8ab75c8) The buggy address belongs to the page: page:ffffea0006e2ad80 count:1 mapcount:0 mapping: (null) index:0x0 compound_mapcount: 0 flags: 0x4000000000010200(slab|head) raw: 4000000000010200 0000000000000000 0000000000000000 00000001800c000c raw: dead000000000100 dead000000000200 ffff8881dab70400 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881b8ab7300: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc ffff8881b8ab7380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881b8ab7400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881b8ab7480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881b8ab7500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================