Patch "tcp: do not mangle skb->cb[] in tcp_make_synack()" has been added to the 4.13-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
tcp: do not mangle skb->cb[] in tcp_make_synack()
to the 4.13-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
tcp-do-not-mangle-skb-cb-in-tcp_make_synack.patch
and it can be found in the queue-4.13 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From foo@baz Tue Nov 21 13:07:20 CET 2017
From: Eric Dumazet <[email protected]>
Date: Thu, 2 Nov 2017 12:30:25 -0700
Subject: tcp: do not mangle skb->cb[] in tcp_make_synack()
From: Eric Dumazet <[email protected]>
[ Upstream commit 3b11775033dc87c3d161996c54507b15ba26414a ]
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 ;)
--- net/ipv4/tcp_output.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
net/ipv4/tcp_output.c +2 -7
@@ -3207,13 +3207,8 @@ struct sk_buff *tcp_make_synack(const st th->source =htons (ireq->ir_num); th->dest = ireq->ir_rmt_port; skb->mark = ireq->ir_mark; -/* Setting of flags are superfluous here for callers (and ECE is -* not even correctly set) -*/ -tcp_init_nondata_skb (skb,tcp_rsk (req)->snt_isn, -TCPHDR_SYN |TCPHDR_ACK ); - - th->seq =htonl (TCP_SKB_CB (skb)->seq); + skb->ip_summed =CHECKSUM_PARTIAL ; + th->seq =htonl (tcp_rsk (req)->snt_isn);/* XXX data is queued and acked as is. No buffer/window check */ th->ack_seq =htonl (tcp_rsk (req)->rcv_nxt);
Patches currently in stable-queue which might be from [email protected] are
queue-4.13/tcp-fix-tcp_fastretrans_alert-warning.patch queue-4.13/tcp-do-not-mangle-skb-cb-in-tcp_make_synack.patch queue-4.13/tcp-gso-avoid-refcount_t-warning-from-tcp_gso_segment.patch