* [PATCH net] tcp: eliminate negative reordering in tcp_clean_rtx_queue
@ 2017-05-15 21:05 Soheil Hassas Yeganeh
2017-05-16 16:46 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Soheil Hassas Yeganeh @ 2017-05-15 21:05 UTC (permalink / raw)
To: davem, netdev
Cc: ilpo.jarvinen, Soheil Hassas Yeganeh, Neal Cardwell,
Yuchung Cheng, Eric Dumazet
From: Soheil Hassas Yeganeh <soheil@google.com>
tcp_ack() can call tcp_fragment() which may dededuct the
value tp->fackets_out when MSS changes. When prior_fackets
is larger than tp->fackets_out, tcp_clean_rtx_queue() can
invoke tcp_update_reordering() with negative values. This
results in absurd tp->reodering values higher than
sysctl_tcp_max_reordering.
Note that tcp_update_reordering indeeds sets tp->reordering
to min(sysctl_tcp_max_reordering, metric), but because
the comparison is signed, a negative metric always wins.
Fixes: c7caf8d3ed7a ("[TCP]: Fix reord detection due to snd_una covered holes")
Reported-by: Rebecca Isaacs <risaacs@google.com>
Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
net/ipv4/tcp_input.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 9739962bfb3f..f27dff64e59e 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -3190,7 +3190,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets,
int delta;
/* Non-retransmitted hole got filled? That's reordering */
- if (reord < prior_fackets)
+ if (reord < prior_fackets && reord <= tp->fackets_out)
tcp_update_reordering(sk, tp->fackets_out - reord, 0);
delta = tcp_is_fack(tp) ? pkts_acked :
--
2.13.0.rc2.291.g57267f2277-goog
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] tcp: eliminate negative reordering in tcp_clean_rtx_queue
2017-05-15 21:05 [PATCH net] tcp: eliminate negative reordering in tcp_clean_rtx_queue Soheil Hassas Yeganeh
@ 2017-05-16 16:46 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-05-16 16:46 UTC (permalink / raw)
To: soheil.kdev; +Cc: netdev, ilpo.jarvinen, soheil, ncardwell, ycheng, edumazet
From: Soheil Hassas Yeganeh <soheil.kdev@gmail.com>
Date: Mon, 15 May 2017 17:05:47 -0400
> From: Soheil Hassas Yeganeh <soheil@google.com>
>
> tcp_ack() can call tcp_fragment() which may dededuct the
> value tp->fackets_out when MSS changes. When prior_fackets
> is larger than tp->fackets_out, tcp_clean_rtx_queue() can
> invoke tcp_update_reordering() with negative values. This
> results in absurd tp->reodering values higher than
> sysctl_tcp_max_reordering.
>
> Note that tcp_update_reordering indeeds sets tp->reordering
> to min(sysctl_tcp_max_reordering, metric), but because
> the comparison is signed, a negative metric always wins.
>
> Fixes: c7caf8d3ed7a ("[TCP]: Fix reord detection due to snd_una covered holes")
> Reported-by: Rebecca Isaacs <risaacs@google.com>
> Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com>
> Signed-off-by: Neal Cardwell <ncardwell@google.com>
> Signed-off-by: Yuchung Cheng <ycheng@google.com>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied and queued up for -stable, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-05-16 16:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-15 21:05 [PATCH net] tcp: eliminate negative reordering in tcp_clean_rtx_queue Soheil Hassas Yeganeh
2017-05-16 16:46 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).