Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: kuniyu@google.com
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
Subject: Re: [PATCH v1 net 4/8] tcp: Fix reqsk abort condition on ICMP errors.
Date: Wed, 18 Nov 2026 20:36:27 +0000	[thread overview]
Message-ID: <179503418741.3136.8574236051062236286@kernel.org> (raw)
In-Reply-To: <20261117053543.84032-5-kuniyu@google.com>

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

  parent reply	other threads:[~2026-11-18 20:36 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17  5:35 [PATCH v1 net 0/8] tcp: Misc fixes for tcp_v[46]_err() Kuniyuki Iwashima
2026-11-17  5:35 ` [PATCH v1 net 1/8] tcp: Don't accept ICMP for SND.NXT in TCP_SYN_SENT Kuniyuki Iwashima
2026-11-17  8:35   ` Eric Dumazet
2026-11-17 23:30     ` Kuniyuki Iwashima
2026-11-17  5:35 ` [PATCH v1 net 2/8] tcp: Don't use inner IP TTL for IP_MINTTL in tcp_v4_err() Kuniyuki Iwashima
2026-11-17  8:42   ` Eric Dumazet
2026-11-17 23:35     ` Kuniyuki Iwashima
2026-11-18 20:36   ` netdev-bot+sashiko
2026-11-17  5:35 ` [PATCH v1 net 3/8] tcp: Don't bypass GTSM check for reqsk Kuniyuki Iwashima
2026-11-17  8:45   ` Eric Dumazet
2026-11-17 23:42     ` Kuniyuki Iwashima
2026-11-18 20:36   ` netdev-bot+sashiko
2026-11-17  5:35 ` [PATCH v1 net 4/8] tcp: Fix reqsk abort condition on ICMP errors Kuniyuki Iwashima
2026-11-17  8:49   ` Eric Dumazet
2026-11-17 23:44     ` Kuniyuki Iwashima
2026-11-18 20:36   ` netdev-bot+sashiko [this message]
2026-11-17  5:35 ` [PATCH v1 net 5/8] tcp: Check ip_sk_accept_pmtu() in tcp_v4_err() Kuniyuki Iwashima
2026-11-17  8:54   ` Eric Dumazet
2026-11-17  5:35 ` [PATCH v1 net 6/8] selftest: net: packetdrill: Add ICMP and ICMPv6 tests Kuniyuki Iwashima
2026-11-17  8:58   ` Eric Dumazet
2026-11-17 23:45     ` Kuniyuki Iwashima
2026-11-17  5:35 ` [PATCH v1 net 7/8] tcp: Pass inet_sdif() to __inet_lookup_established() in tcp_v4_err() Kuniyuki Iwashima
2026-11-17  9:01   ` Eric Dumazet
2026-11-18 20:36   ` netdev-bot+sashiko
2026-11-17  5:35 ` [PATCH v1 net 8/8] tcp: Pass inet6_iif() to __inet6_lookup_established() in tcp_v6_err() Kuniyuki Iwashima
2026-11-17  9:03   ` Eric Dumazet
2026-11-17 23:56     ` Kuniyuki Iwashima

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179503418741.3136.8574236051062236286@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuni1840@gmail.com \
    --cc=kuniyu@google.com \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox