]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: do not mangle skb->cb[] in tcp_make_synack()
authorEric Dumazet <edumazet@google.com>
Thu, 2 Nov 2017 19:30:25 +0000 (12:30 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 3 Nov 2017 05:29:01 +0000 (14:29 +0900)
commita0ec7540c86a3b95ce0b2676be54db3b3a95762c
tree01e52ff98514d77a36116f02f3745b1bce20d519
parent431ab9e0b783b8ab532af2898e1eb6f03acae859
tcp: do not mangle skb->cb[] in tcp_make_synack()

Christoph Paasch sent a patch to address the following issue :

tcp_make_synack() is leaving some TCP private info in skb->cb[],
then send the packet by other means than tcp_transmit_skb()

tcp_transmit_skb() makes sure to clear skb->cb[] to not confuse
IPv4/IPV6 stacks, but we have no such cleanup for SYNACK.

tcp_make_synack() should not use tcp_init_nondata_skb() :

tcp_init_nondata_skb() really should be limited to skbs put in write/rtx
queues (the ones that are only sent via tcp_transmit_skb())

This patch fixes the issue and should even save few cpu cycles ;)

Fixes: 14abc9214e5d ("tcp: better TCP_SKB_CB layout to reduce cache line misses")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Christoph Paasch <cpaasch@apple.com>
Reviewed-by: Christoph Paasch <cpaasch@apple.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_output.c