From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Subject: Re: [PATCH stable 4.4 7/9] tcp: detect malicious patterns in tcp_collapse_ofo_queue() Date: Wed, 15 Aug 2018 15:19:13 +0200 Message-ID: <20180815131913.GC31330@kroah.com> References: <1534339268-111834-1-git-send-email-maowenan@huawei.com> <1534339268-111834-8-git-send-email-maowenan@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dwmw2@infradead.org, netdev@vger.kernel.org, eric.dumazet@gmail.com, edumazet@google.com, davem@davemloft.net, ycheng@google.com, jdw@amazon.de To: Mao Wenan Return-path: Received: from mail.linuxfoundation.org ([140.211.169.12]:45324 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728885AbeHOQLZ (ORCPT ); Wed, 15 Aug 2018 12:11:25 -0400 Content-Disposition: inline In-Reply-To: <1534339268-111834-8-git-send-email-maowenan@huawei.com> Sender: netdev-owner@vger.kernel.org List-ID: On Wed, Aug 15, 2018 at 09:21:06PM +0800, Mao Wenan wrote: > From: Eric Dumazet > > [ Upstream commit 3d4bf93ac12003f9b8e1e2de37fe27983deebdcf ] > > In case an attacker feeds tiny packets completely out of order, > tcp_collapse_ofo_queue() might scan the whole rb-tree, performing > expensive copies, but not changing socket memory usage at all. > > 1) Do not attempt to collapse tiny skbs. > 2) Add logic to exit early when too many tiny skbs are detected. > > We prefer not doing aggressive collapsing (which copies packets) > for pathological flows, and revert to tcp_prune_ofo_queue() which > will be less expensive. > > In the future, we might add the possibility of terminating flows > that are proven to be malicious. > > Signed-off-by: Eric Dumazet > Acked-by: Soheil Hassas Yeganeh > Signed-off-by: David S. Miller > Signed-off-by: Greg Kroah-Hartman > Signed-off-by: root signed off by from "root"? :) And why are you adding the patch back after removing it? thanks, greg k-h