]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.9.28/tcp-fix-wraparound-issue-in-tcp_lp.patch
Remove duplicated commits
[thirdparty/kernel/stable-queue.git] / releases / 4.9.28 / tcp-fix-wraparound-issue-in-tcp_lp.patch
1 From foo@baz Thu May 11 11:08:24 CEST 2017
2 From: Eric Dumazet <edumazet@google.com>
3 Date: Mon, 1 May 2017 15:29:48 -0700
4 Subject: tcp: fix wraparound issue in tcp_lp
5
6 From: Eric Dumazet <edumazet@google.com>
7
8
9 [ Upstream commit a9f11f963a546fea9144f6a6d1a307e814a387e7 ]
10
11 Be careful when comparing tcp_time_stamp to some u32 quantity,
12 otherwise result can be surprising.
13
14 Fixes: 7c106d7e782b ("[TCP]: TCP Low Priority congestion control")
15 Signed-off-by: Eric Dumazet <edumazet@google.com>
16 Signed-off-by: David S. Miller <davem@davemloft.net>
17 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
18 ---
19 net/ipv4/tcp_lp.c | 6 ++++--
20 1 file changed, 4 insertions(+), 2 deletions(-)
21
22 --- a/net/ipv4/tcp_lp.c
23 +++ b/net/ipv4/tcp_lp.c
24 @@ -264,13 +264,15 @@ static void tcp_lp_pkts_acked(struct soc
25 {
26 struct tcp_sock *tp = tcp_sk(sk);
27 struct lp *lp = inet_csk_ca(sk);
28 + u32 delta;
29
30 if (sample->rtt_us > 0)
31 tcp_lp_rtt_sample(sk, sample->rtt_us);
32
33 /* calc inference */
34 - if (tcp_time_stamp > tp->rx_opt.rcv_tsecr)
35 - lp->inference = 3 * (tcp_time_stamp - tp->rx_opt.rcv_tsecr);
36 + delta = tcp_time_stamp - tp->rx_opt.rcv_tsecr;
37 + if ((s32)delta > 0)
38 + lp->inference = 3 * delta;
39
40 /* test if within inference */
41 if (lp->last_drop && (tcp_time_stamp - lp->last_drop < lp->inference))