This is a note to let you know that I've just added the patch titled
tcp: tcp_replace_ts_recent() should not be called from
tcp_validate_incoming()
to the 3.4-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-tcp_replace_ts_recent-should-not-be-called-from-tcp_validate_incoming.patch
and it can be found in the queue-3.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
>From 30b88186c7eeed4f8caa901014164fd337f7fb7b Mon Sep 17 00:00:00 2001
From: Eric Dumazet <[email protected]>
Date: Tue, 13 Nov 2012 05:37:18 +0000
Subject: tcp: tcp_replace_ts_recent() should not be called from
tcp_validate_incoming()
From: Eric Dumazet <[email protected]>
[ Upstream commit bd090dfc634ddd711a5fbd0cadc6e0ab4977bcaf ]
We added support for RFC 5961 in latest kernels but TCP fails
to perform exhaustive check of ACK sequence.
We can update our view of peer tsval from a frame that is
later discarded by tcp_ack()
This makes timestamps enabled sessions vulnerable to injection of
a high tsval : peers start an ACK storm, since the victim
sends a dupack each time it receives an ACK from the other peer.
As tcp_validate_incoming() is called before tcp_ack(), we should
not peform tcp_replace_ts_recent() from it, and let callers do it
at the right time.
Signed-off-by: Eric Dumazet <[email protected]>
Cc: Neal Cardwell <[email protected]>
Cc: Yuchung Cheng <[email protected]>
Cc: Nandita Dukkipati <[email protected]>
Cc: H.K. Jerry Chu <[email protected]>
Cc: Romain Francoise <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
net/ipv4/tcp_input.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -5337,11 +5337,6 @@ static bool tcp_validate_incoming(struct
goto discard;
}
- /* ts_recent update must be made after we are sure that the packet
- * is in window.
- */
- tcp_replace_ts_recent(tp, TCP_SKB_CB(skb)->seq);
-
/* step 3: check security and precedence [ignored] */
/* step 4: Check for a SYN
@@ -5576,6 +5571,11 @@ step5:
if (th->ack && tcp_ack(sk, skb, FLAG_SLOWPATH) < 0)
goto discard;
+ /* ts_recent update must be made after we are sure that the packet
+ * is in window.
+ */
+ tcp_replace_ts_recent(tp, TCP_SKB_CB(skb)->seq);
+
tcp_rcv_rtt_measure_ts(sk, skb);
/* Process urgent data. */
@@ -6046,6 +6046,11 @@ int tcp_rcv_state_process(struct sock *s
} else
goto discard;
+ /* ts_recent update must be made after we are sure that the packet
+ * is in window.
+ */
+ tcp_replace_ts_recent(tp, TCP_SKB_CB(skb)->seq);
+
/* step 6: check the URG bit */
tcp_urg(sk, skb, th);
Patches currently in stable-queue which might be from [email protected] are
queue-3.4/tcp-implement-rfc-5961-4.2.patch
queue-3.4/tcp-implement-rfc-5961-3.2.patch
queue-3.4/tcp-rfc-5961-5.2-blind-data-injection-attack-mitigation.patch
queue-3.4/tcp-refine-syn-handling-in-tcp_validate_incoming.patch
queue-3.4/tcp-tcp_replace_ts_recent-should-not-be-called-from-tcp_validate_incoming.patch
queue-3.4/net-sched-integer-overflow-fix.patch
queue-3.4/tcp-fix-msg_sendpage_notlast-logic.patch
queue-3.4/bonding-bonding-driver-does-not-consider-the-gso_max_size-gso_max_segs-setting-of-slave-devices.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html