๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by netdev-bot+sashiko Wed, 18 Nov 2026 20:36
Re: [PATCH v1 net 4/8] tcp: Fix reqsk abort condition on ICMP errors.
#18752
Author: 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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads