All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "tcp: fix wraparound issue in tcp_lp" has been added to the 4.4-stable tree
@ 2017-05-11 10:48 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-05-11 10:48 UTC (permalink / raw)
  To: edumazet, davem, gregkh; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    tcp: fix wraparound issue in tcp_lp

to the 4.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-fix-wraparound-issue-in-tcp_lp.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From foo@baz Thu May 11 12:38:23 CEST 2017
From: Eric Dumazet <edumazet@google.com>
Date: Mon, 1 May 2017 15:29:48 -0700
Subject: tcp: fix wraparound issue in tcp_lp

From: Eric Dumazet <edumazet@google.com>


[ Upstream commit a9f11f963a546fea9144f6a6d1a307e814a387e7 ]

Be careful when comparing tcp_time_stamp to some u32 quantity,
otherwise result can be surprising.

Fixes: 7c106d7e782b ("[TCP]: TCP Low Priority congestion control")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/ipv4/tcp_lp.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- a/net/ipv4/tcp_lp.c
+++ b/net/ipv4/tcp_lp.c
@@ -264,13 +264,15 @@ static void tcp_lp_pkts_acked(struct soc
 {
 	struct tcp_sock *tp = tcp_sk(sk);
 	struct lp *lp = inet_csk_ca(sk);
+	u32 delta;
 
 	if (rtt_us > 0)
 		tcp_lp_rtt_sample(sk, rtt_us);
 
 	/* calc inference */
-	if (tcp_time_stamp > tp->rx_opt.rcv_tsecr)
-		lp->inference = 3 * (tcp_time_stamp - tp->rx_opt.rcv_tsecr);
+	delta = tcp_time_stamp - tp->rx_opt.rcv_tsecr;
+	if ((s32)delta > 0)
+		lp->inference = 3 * delta;
 
 	/* test if within inference */
 	if (lp->last_drop && (tcp_time_stamp - lp->last_drop < lp->inference))


Patches currently in stable-queue which might be from edumazet@google.com are

queue-4.4/tcp-do-not-underestimate-skb-truesize-in-tcp_trim_head.patch
queue-4.4/tcp-fix-wraparound-issue-in-tcp_lp.patch
queue-4.4/tcp-do-not-inherit-fastopen_req-from-parent.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-05-11 10:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-11 10:48 Patch "tcp: fix wraparound issue in tcp_lp" has been added to the 4.4-stable tree gregkh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.