From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: [PATCH net 0/5] tcp: more robust ooo handling Date: Mon, 23 Jul 2018 09:28:16 -0700 Message-ID: <20180723162821.11556-1-edumazet@google.com> Cc: netdev , Eric Dumazet , Eric Dumazet To: "David S . Miller" , Juha-Matti Tilli , Yuchung Cheng , Soheil Hassas Yeganeh Return-path: Received: from mail-pl0-f53.google.com ([209.85.160.53]:34922 "EHLO mail-pl0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388112AbeGWRaY (ORCPT ); Mon, 23 Jul 2018 13:30:24 -0400 Received: by mail-pl0-f53.google.com with SMTP id w3-v6so445668plq.2 for ; Mon, 23 Jul 2018 09:28:25 -0700 (PDT) Sender: netdev-owner@vger.kernel.org List-ID: 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(-) -- 2.18.0.233.g985f88cf7e-goog