From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.56 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796128316; b=jAzWPV7lU5cRNMpMNNuOQ3QV6nPqoNsdWYfEBvgzLvPSI6syjff6PjWCcxfgfjeimCja 0Q0LKnuq/JJ1+cBLKo8KVSXguTeKcJ7ZPNla+Dcioko8f39PqUsMVXae9JNe0FncUk2sE ZBIPiBT4Ly/Frk0nFUquD/HHI6UIhO0GHDrsNyutpJT2xWlj5M82LRl8uula/hhbhR8PF j+wNelFeO48Ref/4tbCyuADlkQ7el89FwhbjHOnoT1bAkr34oD0K+Fo5uCksw0Qo5Inqn vgfEML1G/NWWm7woop2Xlh+1Vau954GNOFtf5yY4coDHVPJEk+aPrj+XyTL3xLofwjg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796128316; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=bLivO//VkEeNBxtPfLMmXojXJ5uOuM80naOl5nHkzGM=; b=Y97/Z45+rhIr29iSCcIcNBmunae/YAaXq8RBNG78bQh9hstSyBNDe38QNJ2VAQbkH9G0 hOX4yxRI8cxbyicQLoXHDbj6ZCgMZVQHLNHhOfgiFj+5YYfN0mf1KtUim2zMXMkxtZItg 2wmSOenTu2OhsJaYnPfAHVFWUNfHVgWxCMTjlqekDtc8sc6tRRLtv3a98HFqjse+H6QGi d325nLWey9v4/2aUjUdM77nff70YvHLF0eIL8FSgCxGvbLmcrDSF95IMGan10ZtoXJzXb 7ZR71PXCLMld1kVwhH1O0gY7wvi5KOMt3Dzq0oTwi45PG1+bYJJ8b58x2Oa6q/nRW5A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=OKfLQAzf; arc=none smtp.remote-ip=91.218.175.56 Received: from mta0.migadu.com (out-56.mta0.migadu.com [91.218.175.56]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 51EE6606A31A for ; Tue, 1 Dec 2026 12:31:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 51EE6606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=OKfLQAzf X-Envelope-To: netdev@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=s04vQU0Tdl8Dq4urpdgaWh+OgPNeUybYwNQtfWC25K0=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796128313; v=1; x=1796733113; b=OKfLQAzfVzjQq3o9or6kZlOzsSk6Xg4iTEGp2KW6gKvT9MaAXL0o8l0V6NzCEjjwSwjxT6hS MwSKKmy4Ulyo5iXtIHIXCKqQUIG77PkxVNbUp6LL3JJCED3s3/fjL7asl9fhJhCL7cMmnWhlgyZ /2O6T9sooVs3m7aa2ewnKqa0= X-Envelope-To: netdev@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 0fb06376c95ad446; Tue, 01 Dec 2026 12:31:52 +0000 X-Mizu-Trace-ID: 0fb06376c95ad446 X-Migadu-Flow: FLOW_OUT Message-ID: Date: Tue, 1 Dec 2026 20:31:49 +0800 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 net 4/8] tcp: Fix reqsk abort condition on ICMP errors. To: Kuniyuki Iwashima , Eric Dumazet , Neal Cardwell , "David S . Miller" , Jakub Kicinski , Paolo Abeni , Willem de Bruijn Cc: Simon Horman , Kuniyuki Iwashima , netdev@vger.kernel.org References: <20261128080700.3828378-1-kuniyu@google.com> <20261128080700.3828378-5-kuniyu@google.com> From: Jiayuan Chen In-Reply-To: <20261128080700.3828378-5-kuniyu@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 11/28/26 4:06 PM, Kuniyuki Iwashima wrote: > TCP_SYN_SENT and TCP_SYN_RECV sockets treat ICMP soft errors > as hard errors as mentioned in RFC 5461 Section 4.1. > > Commit 9cf7490360bf ("tcp: do not drop syn_recv on all icmp > reports") introduced the abort arg to tcp_req_err() to avoid > aborting TCP_NEW_SYN_RECV reqsk on ICMP_REDIRECT and > ICMP_FRAG_NEEDED. > > However, tcp_v4_err() only checks ICMP_NET_UNREACH and > ICMP_HOST_UNREACH under ICMP_DEST_UNREACH and ignores other > codes such as ICMP_PORT_UNREACH. > > For example, we can see SYN+ACK retransmitted after receiving > hard error: > > --ip_version=ipv4 > 0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3 > +0 bind(3, ..., ...) = 0 > +0 listen(3, 10) = 0 > > +0 < S 0:0(0) win 65535 > +0 > S. 0:0(0) ack 1 > +0 < icmp unreachable port_unreachable [0:0(0)] > +1 > S. 0:0(0) ack 1 > > Similarly, tcp_v6_err() passes fatal from icmpv6_err_convert() > and ignores soft errors such as ICMPV6_TIME_EXCEED, ICMPV6_NOROUTE, > and ICMPV6_ADDR_UNREACH. > > Let's abort reqsk on ICMP_DEST_UNREACH (except ICMP_FRAG_NEEDED), > ICMP_TIME_EXCEEDED, and ICMP_PARAMETERPROB (and their IPv6 > equivalents) to match TCP_SYN_SENT and TCP_SYN_RECV. > > Fixes: 9cf7490360bf ("tcp: do not drop syn_recv on all icmp reports") > Signed-off-by: Kuniyuki Iwashima > --- > v2: Change not to ignore hard error instead of following RFC 1122 > --- Reviewed-by: Jiayuan Chen