All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiayuan Chen <jiayuan.chen@linux.dev>
To: Kuniyuki Iwashima <kuniyu@google.com>,
	Eric Dumazet <edumazet@kernel.org>,
	Neal Cardwell <ncardwell@google.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Willem de Bruijn <willemb@google.com>
Cc: Simon Horman <horms@kernel.org>,
	Kuniyuki Iwashima <kuni1840@gmail.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH v2 net 4/8] tcp: Fix reqsk abort condition on ICMP errors.
Date: Tue, 1 Dec 2026 20:31:49 +0800	[thread overview]
Message-ID: <b0c41ea6-63b2-447c-a179-63d1ef5fe773@linux.dev> (raw)
In-Reply-To: <20261128080700.3828378-5-kuniyu@google.com>



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>



  reply	other threads:[~2026-12-01 12:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-28  8:06 [PATCH v2 net 0/8] tcp: Misc fixes for tcp_v[46]_err() and tcp_v[46]_rcv() Kuniyuki Iwashima
2026-11-28  8:06 ` [PATCH v2 net 1/8] tcp: Don't use inner IP TTL for IP_MINTTL in tcp_v4_err() Kuniyuki Iwashima
2026-11-28  8:06 ` [PATCH v2 net 2/8] tcp: Don't bypass GTSM check for reqsk in tcp_v[46]_err() Kuniyuki Iwashima
2026-11-28  8:06 ` [PATCH v2 net 3/8] tcp: Don't bypass GTSM check for reqsk in tcp_v[46]_rcv() Kuniyuki Iwashima
2026-11-28  8:06 ` [PATCH v2 net 4/8] tcp: Fix reqsk abort condition on ICMP errors Kuniyuki Iwashima
2026-12-01 12:31   ` Jiayuan Chen [this message]
2026-11-28  8:06 ` [PATCH v2 net 5/8] tcp: Check ip_sk_accept_pmtu() in tcp_v4_err() Kuniyuki Iwashima
2026-11-28  8:06 ` [PATCH v2 net 6/8] selftest: net: packetdrill: Add ICMP and ICMPv6 tests Kuniyuki Iwashima
2026-11-28  8:06 ` [PATCH v2 net 7/8] tcp: Pass inet_sdif() to __inet_lookup_established() in tcp_v4_err() Kuniyuki Iwashima
2026-11-28  8:06 ` [PATCH v2 net 8/8] tcp: Pass inet6_iif() to __inet6_lookup_established() in tcp_v6_err() 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=b0c41ea6-63b2-447c-a179-63d1ef5fe773@linux.dev \
    --to=jiayuan.chen@linux.dev \
    --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 \
    --cc=willemb@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.