lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0703301740060.23854@kivilampi-30.cs.helsinki.fi>
Date:	Fri, 30 Mar 2007 17:55:46 +0300 (EEST)
From:	"Ilpo Järvinen" <ilpo.jarvinen@...sinki.fi>
To:	David Miller <davem@...emloft.net>
cc:	netdev@...r.kernel.org
Subject: [PATCH] [TCP]: SACK reneging clears stale recv_sack_cache

Though not very efficient, the previous way of maintaining a
stale SACK cache past reneging protected better against misuse
because receiver couldn't cause set-clear ping-pong for
SACKED_ACKED for a large number of skbs.

Mostly copy-paste from sacktag clearer. Compile tested.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@...sinki.fi>
---
 net/ipv4/tcp_input.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 97b9be2..ea196de 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1509,7 +1509,7 @@ void tcp_enter_loss(struct sock *sk, int
 	const struct inet_connection_sock *icsk = inet_csk(sk);
 	struct tcp_sock *tp = tcp_sk(sk);
 	struct sk_buff *skb;
-	int cnt = 0;
+	int cnt = 0, i;
 
 	/* Reduce ssthresh if it has not yet been made inside this window. */
 	if (icsk->icsk_ca_state <= TCP_CA_Disorder || tp->snd_una == tp->high_seq ||
@@ -1527,8 +1527,15 @@ void tcp_enter_loss(struct sock *sk, int
 
 	/* Push undo marker, if it was plain RTO and nothing
 	 * was retransmitted. */
-	if (!how)
+	if (!how) {
 		tp->undo_marker = tp->snd_una;
+	} else {
+		/* We're going to flush SACKed state, every SACK counts again */
+		for (i = 0; i < ARRAY_SIZE(tp->recv_sack_cache); i++) {
+			tp->recv_sack_cache[i].start_seq = 0;
+			tp->recv_sack_cache[i].end_seq = 0;
+		}
+	}
 
 	tcp_for_write_queue(skb, sk) {
 		if (skb == tcp_send_head(sk))
-- 
1.4.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ