]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: eliminate negative reordering in tcp_clean_rtx_queue
authorSoheil Hassas Yeganeh <soheil@google.com>
Mon, 15 May 2017 21:05:47 +0000 (17:05 -0400)
committerDavid S. Miller <davem@davemloft.net>
Tue, 16 May 2017 16:45:21 +0000 (12:45 -0400)
commit397d54fb6f75461963064a4d88770c480884b6f8
tree1db6b24ae97377ab0f55c1e36b8dd3ae91880422
parent837ee1eb68706cc7b27dd6696890b92e71b3dd62
tcp: eliminate negative reordering in tcp_clean_rtx_queue

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: 9e7041d24c85 ("[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>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_input.c