From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH RFC net-next 1/1] tcp: close socket without reset on incoming data Date: Sat, 19 May 2018 17:00:50 -0400 (EDT) Message-ID: <20180519.170050.615996932572513152.davem@davemloft.net> References: <20180518190141.899-1-dbanerje@akamai.com> <20180518190141.899-2-dbanerje@akamai.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org To: dbanerje@akamai.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:34782 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752526AbeESVAy (ORCPT ); Sat, 19 May 2018 17:00:54 -0400 In-Reply-To: <20180518190141.899-2-dbanerje@akamai.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Debabrata Banerjee Date: Fri, 18 May 2018 15:01:41 -0400 > When TCP_CLOSE_NORST is set before a close(), offload sinking of > unwanted data to the kernel with low resource usage, with a timeout of > TCP_LINGER2. The socket will transition to FIN_WAIT1 and then FIN_WAIT2 > where it will ack data until either the timeout is hit, or a RST or FIN > is received. > > Signed-off-by: Debabrata Banerjee This is a very serious protocol violation. You're telling the remote end that you received the data even though the socket was closed and nothing actually "sunk" the bytes. This doesn't even go into the issues of sending cumulative ACKs in response to data which is arbitrarily out-of-order. The whole problem is that the post data is sent before the client looks to see if the server is willing to accept the post data or not. A: I'd like to send you 200MB of crap [ 200MB of craaaa... B: Sorry I won't be accepting that, please don't send it. CLOSE, send reset since some of crap is queued up and was never read A: aaaaapp... received RESET A: Why didn't B accept my 200MB of crap? Sorry, you'll need to deal with this issue in another way. Thanks.