🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #25235

Re: [PATCH v2 net 4/8] tcp: Fix reqsk abort condition on ICMP errors.

#25235
From: Jiayuan Chen
Date: Tue, 01 Dec 2026 12:31
44 lines
9774 bytes

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 <mss 1460,nop,nop,sackOK>
>   +0 > S. 0:0(0) ack 1 <mss 1460,nop,nop,sackOK>
>   +0 < icmp unreachable port_unreachable [0:0(0)]
>   +1 > S. 0:0(0) ack 1 <mss 1460,nop,nop,sackOK>
>
> 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 <kuniyu@google.com>
> ---
> v2: Change not to ignore hard error instead of following RFC 1122
> ---

Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Technical Details
Message-ID: <b0c41ea6-63b2-447c-a179-63d1ef5fe773@linux.dev>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375023-linux-kernel-netdev=dewy.ru
References: <20261128080700.3828378-1-kuniyu@google.com> <20261128080700.3828378-5-kuniyu@google.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375023-linux-kernel-netdev=dewy.ru
From: jiayuan.chen@linux.dev (Jiayuan Chen)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH v2 net 4/8] tcp: Fix reqsk abort condition on ICMP errors.
Date: Tue, 1 Dec 2026 20:31:49 +0800
Organization: Usenet Network
Message-ID: <b0c41ea6-63b2-447c-a179-63d1ef5fe773@linux.dev>
References: <20261128080700.3828378-1-kuniyu@google.com>
 <20261128080700.3828378-5-kuniyu@google.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="1709116"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:GkyEv83QpPYyTLqRx59KL5TEaX4= sha256:bQv3s/oOBetUAib+LUHlUdhU2DHS0W93ivFxie9IqY4=
	sha1:JWw+PBPS30/HsMDAoCDJBbI43O4= sha256:b19a4UDmD1ckknNNjbjqZqYVVF46rntvA5UtH2esOA8=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 7E509117354; Tue,  1 Dec 2026 15:32:11 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.05
X-Spam-Status: No, score=-2.05 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	HK_RANDOM_FROM=1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3,
	SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=linux.dev
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id p0JJWdK9y_bM;
	Tue,  1 Dec 2026 15:32:08 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-375023-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id B1A0A117378; Tue,  1 Dec 2026 15:31:59 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 8C02D2C33B; Tue,  1 Dec 2026 12:31:57 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796128317;
	b=xwfXkYZZJs3B3Y7qwcrLch+fYpl6sDvH6gDYwqh/dpXBJKPhbrHPBcwzYj/+HWYOXtsm
	 KQlYrXSh9mrG5iqvDLfJ5yNUpZI7rdZhxTE5WcA9LiQ8nEIeEw2wtZ8DhEVuFVEAR2RJt
	 srEQs31fV+2F6JXgJYtbCQAvMGjJZrYw+PCRi8DG98dIKwTNC1MkklLx3LKATrMCF04h+
	 /CU49+TjLYhRoxapA4kqUG/iuo6to3j/sL1Rn3p55ucJA75Jtz/AKmPCpJJfo8B1V+18A
	 4kr9k72YvGJXDZjl47aTQsf31HQUHJ66u+JyOOwWZG031b/4wXlA2y8L+F8usRWwoOQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796128317;
	h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature:
	 X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:User-Agent:
	 Subject:To:Cc:References:From:In-Reply-To:Content-Type:
	 Content-Transfer-Encoding;
	bh=bLivO//VkEeNBxtPfLMmXojXJ5uOuM80naOl5nHkzGM=;
	b=SXRqbkUT5SpYInoPuytb1l3gbB112JaZz9sdYNTyANQ8eOdt4MbxjZb/9am8htx3rPbF
	 DEt4bILICox2cd7CklA1j1+erSNRs2fsehJ3xsgNxf3wlvnwFtcLSimn/eNbQx63xPSyi
	 kyb/DrHTht7rIcZSowxkREc78XVukfGksv0efE7UzGVvHfcWKkWbJZbKy6ZavZUB2SptV
	 2z8yfF6AAu+jvl4I6XnHgEDi8TD7kCdXFoWv4dtQQKklfTsngaIHxXyyB3uQeo/X0Q9ub
	 FgpalYWccZuD10wP0T7TbfzXgFJsB0WtY10BZ+ConRTgb4h4KIxc2zrAqEnZDktjHGA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=OKfLQAzf;
	dmarc=pass header.from=linux.dev;
	spf=pass smtp.mailfrom=linux.dev;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 3E67F606A32C;
	Tue,  1 Dec 2026 12:31:57 +0000 (UTC)
X-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-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.56
X-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==
X-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==
X-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
X-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 <netdev@vger.kernel.org>; Tue,  1 Dec 2026 12:31:54 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 51EE6606A31A
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev
X-Envelope-To: netdev@vger.kernel.org
X-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
X-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
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-User-Agent: Mozilla Thunderbird
X-Cc: Simon Horman <horms@kernel.org>, Kuniyuki Iwashima <kuni1840@gmail.com>,
 netdev@vger.kernel.org
X-In-Reply-To: <20261128080700.3828378-5-kuniyu@google.com>