Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp917448pxb; Sat, 17 Apr 2021 00:30:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyc6TSNAIQE26Q8fQSa6ycuetgFt//16KAkamR4IUUGfyXMog/dNZ+qVcgaMa8fVQcaVl0f X-Received: by 2002:a17:90a:ab10:: with SMTP id m16mr13781379pjq.6.1618644640785; Sat, 17 Apr 2021 00:30:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618644640; cv=none; d=google.com; s=arc-20160816; b=D+GIm64jAdGt1owkOL5ILKOhlz/cqQmMRakjof05ZibJZeJOjP/Y0UfkbVzQQBxFQC brmef5VD+JBcszlwQJSU6PImzrEss60oPIEQ9FVpMegyZKMwgWvvowHhhI27VNefeLR1 Z/HfYTp+lIVR3L84/XeTG2vK9vf/QFdfe28g4KCBcuvIzVHi8982IB1KmacOQhPYTmyn Agzg2ZjvBs6MDv4AJJgX1pWwlDHmzAKhCMFfazzOh4QztAUNhKvi/QkYXgzKzWLzlXPO 7mhJsn8pkSoxayPNrv86gTKNWsOFn1BdaGGcYrzbGESI5We7Vdz6Bwng0jo8dyCaMq4m yzAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=k/g7n4zhM8QbREUG9JlAIaHTC8RZXxpPcF2wFxlWXtM=; b=ugn5+xss2PESRaCNxlM2DI2fRG/Of6FdYHLfBHi7IYkzPzal4pKNwqbOIKMDGCIOKV Gesfa2kQuljmPgoatVxc65CM+kUlilW3B3JZGB/xMHW166k1gZeO0PG+mNg7hTxLsS9m A0cUv694ZmIySBCGAk3Vd6fQCt12lTccfYCbIpkPnc4C8URiIAlXljKjSBtz6G19RCR4 RwGVCv1m8ylN4HIitNvJgVekP5cWKhioVRvJA39Tf0ShNv29RZIG4vUSmrMwSPmkfVEU PKhgq9paRrXQWGDHW/YZUemcC7gfjt9NooYWwH3+kS5nvg1aXzKS20ORMexc4OVT/ZAd fRAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p3si9721740plo.211.2021.04.17.00.30.29; Sat, 17 Apr 2021 00:30:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230365AbhDQH2a (ORCPT + 99 others); Sat, 17 Apr 2021 03:28:30 -0400 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:51799 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229631AbhDQH2a (ORCPT ); Sat, 17 Apr 2021 03:28:30 -0400 Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 13H7RiqZ014175; Sat, 17 Apr 2021 09:27:44 +0200 Date: Sat, 17 Apr 2021 09:27:44 +0200 From: Willy Tarreau To: Eric Dumazet Cc: David Ahern , Florian Westphal , Keyu Man , "davem@davemloft.net" , "yoshfuji@linux-ipv6.org" , "dsahern@kernel.org" , Jakub Kicinski , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Zhiyun Qian Subject: Re: PROBLEM: DoS Attack on Fragment Cache Message-ID: <20210417072744.GB14109@1wt.eu> References: <02917697-4CE2-4BBE-BF47-31F58BC89025@hxcore.ol> <52098fa9-2feb-08ae-c24f-1e696076c3b9@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 17, 2021 at 06:44:40AM +0200, Eric Dumazet wrote: > On Sat, Apr 17, 2021 at 2:31 AM David Ahern wrote: > > > > [ cc author of 648700f76b03b7e8149d13cc2bdb3355035258a9 ] > > I think this has been discussed already. There is no strategy that > makes IP reassembly units immune to DDOS attacks. For having tried to deal with this in the past as well, I agree with this conclusion, which is also another good example of why fragments should really be avoided as much as possible over hostile networks. However I also found that random drops of previous entries is the approach which seems to offer the most statistical opportunities to legitimate traffic to still work under attack (albeit really poorly considering that any lost fragment requires retransmission of the whole series). In this case the chance for a packet to be successfully reassembled would vary proportionally to the inverse of its number of fragments, which reasonably limits the impact of attacks (without being an ultimate solution of course). > We added rb-tree and sysctls to let admins choose to use GB of RAM if > they really care. I agree that for those who care, the real solution is to make sure they can store all the traffic they receive during a reassembly period. Legitimate traffic mostly reassembles quickly so keeping 1 second of traffic at 10 Gbps is only 1.25 GB of RAM after all... Willy