๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #18752

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

#18752
From: netdev-bot+sashiko
Date: Wed, 18 Nov 2026 20:36
74 lines
10423 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] This patch makes a comment in the existing TFO selftest wrong.

--

tcp: Fix reqsk abort condition on ICMP errors.

This commit changes the abort condition passed to tcp_req_err() for
TCP_NEW_SYN_RECV sockets so that it follows RFC 1122 Section 4.2.3.9.
In IPv4, only fatal ICMP_DEST_UNREACH codes now drop the reqsk.
In IPv6, ICMPV6_PARAMPROB aborts only for ICMPV6_UNK_NEXTHDR.

> diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
> index fd9588bba9672..f11e090d04fb3 100644
> --- a/net/ipv4/tcp_ipv4.c
> +++ b/net/ipv4/tcp_ipv4.c
> @@ -529,11 +529,8 @@ int tcp_v4_err(struct sk_buff *skb, u32 info)
>  
>  	seq = ntohl(th->seq);
>  	if (sk->sk_state == TCP_NEW_SYN_RECV) {
> -		tcp_req_err(sk, seq, type == ICMP_PARAMETERPROB ||
> -				     type == ICMP_TIME_EXCEEDED ||
> -				     (type == ICMP_DEST_UNREACH &&
> -				      (code == ICMP_NET_UNREACH ||
> -				       code == ICMP_HOST_UNREACH)));
> +		tcp_req_err(sk, seq, (type == ICMP_DEST_UNREACH &&
> +				      icmp_err_convert[code].fatal));

[Severity: Low]
This isn't a bug, but does this change leave a comment in an existing TFO
selftest out of date?

tools/testing/selftests/net/packetdrill/tcp_fastopen_server_icmp-before-accept.pkt
sends host_unreachable to the pending request and then says:

    // Valid ICMP unreach.
       +0 < icmp unreachable host_unreachable [0:10(10)]

    // Unlike the non-TFO case, the req is still there to be accepted.
       +0 accept(3, ..., ...) = 4

That contrast was true before this patch, because ICMP_HOST_UNREACH used
to drop a non-TFO reqsk.

With this change, icmp_err_convert[ICMP_HOST_UNREACH].fatal is 0, so abort
is false. tcp_req_err() then skips inet_csk_reqsk_queue_drop(), and the
non-TFO reqsk stays in the queue and can still be accepted.

The difference between the two cases now runs the other way. The TFO child
is still moved to TCP_CLOSE by tcp_done_with_error(), but the plain reqsk
is left alone.

The tcp_icmp_ipv4.pkt test added later in this series ("4a: Soft errors
must not abort reqsk") checks the new non-TFO behaviour, and it contradicts
this comment. As far as I can tell, no later patch in the series updates
the comment.

Could the comment in tcp_fastopen_server_icmp-before-accept.pkt be updated
to match the new behaviour?

>  		return 0;
>  	}
>  

[ ... ]

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261117053543.84032-1-kuniyu%40google.com
Technical Details
Message-ID: <179503418741.3136.8574236051062236286@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366444-linux-kernel-netdev=dewy.ru
References: <20261117053543.84032-5-kuniyu@google.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366444-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH v1 net 4/8] tcp: Fix reqsk abort condition on ICMP errors.
Date: Wed, 18 Nov 2026 20:36:27 +0000
Organization: Usenet Network
Message-ID: <179503418741.3136.8574236051062236286@kernel.org>
References: <20261117053543.84032-5-kuniyu@google.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2692868"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:rQJ//7pfHjqpRs3Y6KCMsvWYfB0= sha256:YfdWkCETEIp3OuvSJMEe0ErWODyZ191p7PYfDYXVe18=
	sha1:EagcUQ/FMaqWxwjbc09ZaReWgh8= sha256:0Gs6Q3wR385FOtck4u9BGsjL7V1Suo1H23w+yZUhDoM=
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 78A241153D3; Wed, 18 Nov 2026 23:36:59 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.5
X-Spam-Status: No, score=-3.5 tagged_above=-9999 required=6.31
	tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.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 (2048-bit key)
	header.d=kernel.org
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 pzMeg2vWHEA6;
	Wed, 18 Nov 2026 23:36:55 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-366444-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 67DCE1153CF; Wed, 18 Nov 2026 23:36:47 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id BCB6A624813; Wed, 18 Nov 2026 20:36:46 +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=1795034189;
	b=sBcV4vZyogzGrqlvKgJP9KeYLKuH/fYcCgbReKFL8hmxGUV8fV0CibzwNr4tBCth1wX4
	 XXz2dmnk9nSNv3FqMuLez7QxRmZsIgHIfUi8wCnRh6svOizkGimdSkZIxVECwITitx+Be
	 DHLL5JgO+WxxQlIjYRop2CPWyl19GsrpO32oWaudC3pZn8D91UwheD5LKMN5qT9gPr2ql
	 7o09dPJW+nO9z5h1aj9ZZZHHlRMlNPhsX0a6U5ZjylfB1ZIL30p1tm0AjjLngk2hTl9Ql
	 v1lPaPjiKgQwlnTSFknNkc27P7yg+woHhriGTgRX7mV9K/pQQ0/kAJHGOEOzVzHJo+w==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795034189;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=JjTHb+sQJUwdApdF1WR7/s7xH2U4av785xkSHCbz0Qc=;
	b=l6F5fmcPJrFE1dhbdTeUVCUxv3/9YXfHEFKmU2ae9nbbRuL+NTxs24Ztm1nSQCV/SXgZ
	 HUFMjF5XY5zmdDIOnRusCwMfW8h87mP1yWel0E71IL5Lv0Lr3ZC8MIKWaiONJn0tp206w
	 EACM/U87xZ4iuO+GFyFbwbEVvvyJcYnh+PfqPf2NFPOKDWWOIWz+ogPi3LvXv26334ETp
	 Bx9FjYrxcvxDujS/kjP3mvfKkHuPDQ4iMuZSQpuBy9/uXt8oHAn7j22YigACZ1QBBHrlm
	 2xp6j/bw2OO+rxMrvzCtgH2vXZcdg2oFKxD7A+4txxgFAYNEeYx2s6pxzcKnA4iwQ7Q==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=BTktnBPu;
	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 709D160A3803;
	Wed, 18 Nov 2026 20:36:29 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=BTktnBPu
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795034188;
	b=XEliDDBoKoln14gPSIHYxtCmFUstfUG3z2HCquTIaH19vo2rvdA9YgkBA20xtmUt8a8b
	 /Y0SV4xy7aXAMYUaB7UyPViaPaAVTAYdh4bOH+lXslwWtw//Kda+si044E9++ekrGL3/X
	 jS/GhoqQRk+arSo1FpezdPDvwPZD8+SVNOBrb6v61r3LizHkp//QNw+C4Yb0vyCnY0CPt
	 /yggV8cpkMyT1O/K9e/9H5ywfe1xfR+8vimBC1ri5fyDO8XAsvD6p61VQxx80iIGgV5Rp
	 A9zBBY1veegzVAcufXj71y5Z9SRbIeEMeIZ7ZnNbc+bMoezaTGTXt2L7gFPxvSld7cw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795034188;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=JjTHb+sQJUwdApdF1WR7/s7xH2U4av785xkSHCbz0Qc=;
	b=3WCakLNOEv9fyd11wzEqgH7D8PH1Jhimzfh2OmgQ61SXJkVN4nXymUTajJjYsmN7/JQB
	 HA5fU9PqH8yOR97bKgVAg5ZTfR9GYsPur8VDUnNmsHo0VpOYzt4/VwOAiYTzjVLbWRlrH
	 1sc1zLq6pQtbNzOu5qe4oHWXFYDOKHPAi7qm8uLsDRS051xeeZA0IEvyT8T8V9KRS6gFL
	 xrfOF2uVjEoVqC8cEe2tO88N7hFRGiURxG4LEJ65pb4FJkO6DUo2AAHVO4cZRFM1/1AVh
	 qAhWzYf8+YVDNBF0/qO6BbaZj/s/MytIhUHacLn33Si+STpmzl3sjo+mJ9U1Sj2iymQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=BTktnBPu;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 91A2F60A2630
	for <netdev@vger.kernel.org>; Wed, 18 Nov 2026 20:36:28 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0E3F1F000C9;
	Wed, 18 Nov 2026 20:36:27 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795034188;
	bh=JjTHb+sQJUwdApdF1WR7/s7xH2U4av785xkSHCbz0Qc=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=BTktnBPuyVqbgZMFglXwhdDGxw80GKvLgcrdxSXizpd0/1KazOfuvhaIcuUUQppID
	 9r6GUOkUI8o+j4jyxIc37FaAR6+r0qWNdDUo8oEzqjxAbmHM9whjrxXnTaL0QEczUA
	 Spt4LVqm+Fih+M2XqGR1SIl5A5W1Une7jHZit6FIQHUdIG2a5uNI9iI7RM30uyqTEx
	 65nUPpFBg0rVAoUEDjxARsIZghWRb2N/XgAXdMqImLgORW21TyR8eXbCDEhJjFsAUJ
	 yhni8uHzMlDbh1jsrkk9AHMIW8sfXak+wNHaN2N8VU6ZeFOK7k+j+nuUFBmsKKIGmb
	 rZBZC87KvznNw==
X-Cc: edumazet@kernel.org, ncardwell@google.com, davem@davemloft.net,
 kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, kuni1840@gmail.com,
 netdev@vger.kernel.org
X-In-Reply-To: <20261117053543.84032-5-kuniyu@google.com>
X-sashiko-severity: Low
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