From patchwork Fri Jan 11 02:18:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 211194 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 53AA12C00D7 for ; Fri, 11 Jan 2013 13:19:09 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754828Ab3AKCSw (ORCPT ); Thu, 10 Jan 2013 21:18:52 -0500 Received: from mail-pa0-f52.google.com ([209.85.220.52]:36409 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754019Ab3AKCSu (ORCPT ); Thu, 10 Jan 2013 21:18:50 -0500 Received: by mail-pa0-f52.google.com with SMTP id fb1so713854pad.25 for ; Thu, 10 Jan 2013 18:18:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:subject:from:to:cc:in-reply-to:references:content-type :date:message-id:mime-version:x-mailer:content-transfer-encoding; bh=d75Nw1t18nwl2LUh7Ob6l7CdHapIrk56pJPxZqk/Xys=; b=eePSt6bJG21Tpr7lQR36907EX9rV37lBgllFF0BU6q4rL6olysplsocZFJEjQ22fx2 CmxrU34Q3wO/l7Ao9ivWVkZE3L3pcartntq04Mc430Tv7XCZcn8T51znOICIh1s5jtwb vQcOQWcT2L3M08HuxxpnCKIMQt3+TRTlBPjhLgDn1l5RaadpeybjKvRiEFVhTV5v56rJ N6l9lL99mxWNlbaXuVTuhm6YYoJH1ntUgOEg49sh5CsqWPSbmXaxxk7LqOWVc0jMdxFJ IaFJz+4qJ84bG44KDGIp8fwLEl1YNi9upKMdUrDnWg0rCQRaUyfvuElltseJHC6gikF8 zBaA== X-Received: by 10.68.254.195 with SMTP id ak3mr50592146pbd.37.1357870729953; Thu, 10 Jan 2013 18:18:49 -0800 (PST) Received: from ?IPv6:2620:0:1000:3304:224:d7ff:fee3:2a94? ([2620:0:1000:3304:224:d7ff:fee3:2a94]) by mx.google.com with ESMTPS id bf3sm2094639pab.12.2013.01.10.18.18.48 (version=SSLv3 cipher=RC4-SHA bits=128/128); Thu, 10 Jan 2013 18:18:49 -0800 (PST) Subject: Re: 3.8-rc2/rc3 write() blocked on CLOSE_WAIT TCP socket From: Eric Dumazet To: Eric Wong , David Miller Cc: netdev@vger.kernel.org, Mel Gorman , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Rik van Riel , Minchan Kim , Andrew Morton , Linus Torvalds In-Reply-To: <1357869675.27446.2962.camel@edumazet-glaptop> References: <20130111004915.GA15415@dcvr.yhbt.net> <1357869675.27446.2962.camel@edumazet-glaptop> Date: Thu, 10 Jan 2013 18:18:47 -0800 Message-ID: <1357870727.27446.2988.camel@edumazet-glaptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Eric Dumazet On Thu, 2013-01-10 at 18:01 -0800, Eric Dumazet wrote: > Hmm, it might be commit c3ae62af8e755ea68380fb5ce682e60079a4c388 > tcp: should drop incoming frames without ACK flag set > > It seems RST should be allowed to not have ACK set. > > I'll send a fix, thanks ! Yes, thats definitely the problem, sorry for that. [PATCH] tcp: accept RST without ACK flag commit c3ae62af8e755 (tcp: should drop incoming frames without ACK flag set) added a regression on the handling of RST messages. RST should be allowed to come even without ACK bit set. We validate the RST by checking the exact sequence, as requested by RFC 793 and 5961 3.2, in tcp_validate_incoming() Reported-by: Eric Wong Signed-off-by: Eric Dumazet Acked-by: Neal Cardwell Tested-by: Eric Wong --- net/ipv4/tcp_input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 38e1184..0905997 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -5541,7 +5541,7 @@ slow_path: if (len < (th->doff << 2) || tcp_checksum_complete_user(sk, skb)) goto csum_error; - if (!th->ack) + if (!th->ack && !th->rst) goto discard; /* @@ -5986,7 +5986,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, goto discard; } - if (!th->ack) + if (!th->ack && !th->rst) goto discard; if (!tcp_validate_incoming(sk, skb, th, 0))