Files
linux/net
Eric Dumazet c8daffacf0 net: merge CVE-2018-5390 patch
PD#172028: merge CVE patch

tcp: free batches of packets in tcp_prune_ofo_queue()

[ Upstream commit 72cd43ba64 ]

Juha-Matti Tilli reported that malicious peers could inject tiny
packets in out_of_order_queue, forcing very expensive calls
to tcp_collapse_ofo_queue() and tcp_prune_ofo_queue() for
every incoming packet. out_of_order_queue rb-tree can contain
thousands of nodes, iterating over all of them is not nice.

Before linux-4.9, we would have pruned all packets in ofo_queue
in one go, every XXXX packets. XXXX depends on sk_rcvbuf and skbs
truesize, but is about 7000 packets with tcp_rmem[2] default of 6 MB.

Since we plan to increase tcp_rmem[2] in the future to cope with
modern BDP, can not revert to the old behavior, without great pain.

Strategy taken in this patch is to purge ~12.5 % of the queue capacity.

Change-Id: I647968cc33ccb0acd37ce647923b7cc320eaaf4f
Fixes: 36a6503fed ("tcp: refine tcp_prune_ofo_queue() to not drop all packets")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Juha-Matti Tilli <juha-matti.tilli@iki.fi>
Acked-by: Yuchung Cheng <ycheng@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2018-09-03 03:55:47 -07:00
..
2018-05-16 10:08:44 +02:00
2018-07-17 12:36:18 +02:00
2018-06-13 16:37:10 +02:00
2017-11-15 15:53:17 +01:00
2018-04-13 19:48:29 +02:00
2018-09-03 03:55:47 -07:00
2018-07-17 12:36:18 +02:00
2018-05-19 14:06:17 +02:00
2018-07-17 12:36:18 +02:00
2018-05-30 13:19:56 +02:00
2018-06-13 16:16:42 +02:00
2018-05-30 07:50:32 +02:00
2018-05-30 07:50:25 +02:00
2018-05-16 11:39:34 +02:00
2018-04-24 11:26:46 +02:00
2018-01-31 14:13:00 +01:00