All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Neil Spring" <ntspring@meta.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH net-next v8 1/2] tcp: rehash onto different local ECMP path on retransmit timeout
Date: Fri, 30 Oct 2026 04:54:24 +0000	[thread overview]
Message-ID: <sashiko-outbox-190462@kernel.org> (raw)
In-Reply-To: <20260522215733.929238-2-ntspring@meta.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] IPv6 flowlabel reflection (REPFLOW) is broken for SYN-ACKs when syncookies are triggered.
--

commit b64f3a9b6e1ac0e884a330cb07667e97df46001c
Author: Neil Spring <ntspring@meta.com>

tcp: rehash onto different local ECMP path on retransmit timeout

This commit updates the TCP transmit hashing logic to re-roll the txhash on
RTO, PLB, and spurious retransmission events. It additionally ensures the
cached destination route is invalidated and sets up the routing lookup to
use the new txhash for selecting a different local ECMP path.

> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c

[ ... ]

> @@ -7656,6 +7659,11 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops,
>  	/* Note: tcp_v6_init_req() might override ir_iif for link locals */
>  	inet_rsk(req)->ir_iif = inet_request_bound_dev_if(sk, skb);
>  
> +	if (want_cookie) {
> +		isn = cookie_init_sequence(af_ops, sk, skb, &req->mss);
> +		tcp_rsk(req)->txhash = isn;
> +	}
> +
>  	dst = af_ops->route_req(sk, skb, &fl, req, isn);

[Severity: High]
Could this change break IPv6 flowlabel reflection (REPFLOW) for SYN-ACKs when
syncookies are active?

By moving the cookie initialization before the route_req() call, isn is now
a non-zero cookie value rather than zero when a SYN flood is detected.

For IPv6, af_ops->route_req() maps to tcp_v6_route_req(), which passes this
isn value as the tw_isn parameter to tcp_v6_init_req().

Because tw_isn is now the generated syncookie (a non-zero value) rather than 0,
the if (!tw_isn && ...) check inside tcp_v6_init_req() evaluates to false.
This causes it to skip saving the SYN packet's ireq->pktopts.

Later, when tcp_v6_send_synack() attempts to send the SYN-ACK, it checks:

	if (inet6_test_bit(REPFLOW, sk) && ireq->pktopts)

Since ireq->pktopts was not saved and is NULL, the SYN-ACK fails to reflect
the IPv6 flowlabel during SYN floods.

>  	if (!dst)
>  		goto drop_and_free;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260522215733.929238-1-ntspring@meta.com?part=1

  reply	other threads:[~2026-10-30  4:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-22 21:57 [PATCH net-next v8 0/2] tcp: rehash onto different local ECMP path on retransmit timeout Neil Spring
2026-05-22 21:57 ` [PATCH net-next v8 1/2] " Neil Spring
2026-10-30  4:54   ` sashiko-bot [this message]
2026-05-22 21:57 ` [PATCH net-next v8 2/2] selftests: net: add local ECMP rehash test Neil Spring

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=sashiko-outbox-190462@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=ntspring@meta.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.