Skip to content

tcp: more robust ooo handling

Eric Dumazet netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5tcp: free batches of packets in tcp_prune_ofo_queue()net/ipv4/tcp_input.c+11 -40 replies
2/5tcp: avoid collapses in tcp_prune_queue() if possiblenet/ipv4/tcp_input.c+3 -00 replies
3/5tcp: detect malicious patterns in tcp_collapse_ofo_queue()net/ipv4/tcp_input.c+13 -20 replies
4/5tcp: call tcp_drop() from tcp_data_queue_ofo()net/ipv4/tcp_input.c+2 -20 replies
5/5tcp: add tcp_ooo_try_coalesce() helpernet/ipv4/tcp_input.c+21 -40 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchYuchung ChengSoheil Hassas Yeganeh
SeriesA-b A-b
1/5A-b A-b
2/5A-b A-b
3/5A-b
4/5A-b A-b
5/5A-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net 0/5] tcp: more robust ooo handling

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.

With tcp_rmem[2] default of 6MB, the ooo queue could contain ~7000 nodes.

This patch series makes sure we cut cpu cycles enough to render the attack not critical.

We might in the future go further, like disconnecting or black-holing proven malicious flows.

Eric Dumazet (5):
tcp: free batches of packets in tcp_prune_ofo_queue()
tcp: avoid collapses in tcp_prune_queue() if possible
tcp: detect malicious patterns in tcp_collapse_ofo_queue()
tcp: call tcp_drop() from tcp_data_queue_ofo()
tcp: add tcp_ooo_try_coalesce() helper

 net/ipv4/tcp_input.c | 62 +++++++++++++++++++++++++++++++++++---------
 1 file changed, 50 insertions(+), 12 deletions(-)
Signature · 1 line
2.18.0.233.g985f88cf7e-goog