BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Thaison Phan" <thaisonphan@google.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH net v3 2/2] tcp: accecn: initialize AccECN fields in syncookie path
Date: Wed, 18 Nov 2026 12:47:28 +0000	[thread overview]
Message-ID: <sashiko-outbox-220941@kernel.org> (raw)
In-Reply-To: <20261117124710.1338951-3-thaisonphan@google.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] tcp: accecn: missing 3rd ACK option init in
  cookie_tcp_reqsk_init()
--

commit 5acfc9564ef55de35a9a6f13ac1b4466ed5e7a69
Author: Thaison Phan <thaisonphan@google.com>

tcp: accecn: initialize AccECN fields in syncookie path

This commit initializes saw_accecn_opt, accecn_fail_mode, syn_ect_rcv, and
syn_ect_snt on the request_sock constructed in the IPv4 and IPv6 syncookie
paths.

> diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
> index 4e0ff3b820627..1a837ed6efa00 100644
> --- a/net/ipv4/syncookies.c
> +++ b/net/ipv4/syncookies.c
> @@ -290,6 +290,9 @@ static int cookie_tcp_reqsk_init(struct sock *sk, struct sk_buff *skb,
>  	 */
>  	treq->txhash = treq->snt_isn;
>  	treq->syn_tos = TCP_SKB_CB(skb)->ip_dsfield;
> +	treq->saw_accecn_opt = TCP_ACCECN_OPT_NOT_SEEN;
> +	treq->accecn_fail_mode = 0;
> +	treq->syn_ect_rcv = 0;
>  
>  #if IS_ENABLED(CONFIG_MPTCP)
>  	treq->is_mptcp = sk_is_mptcp(sk);
> @@ -502,6 +505,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb)
>  		ireq->rcv_wscale = rcv_wscale;
>  	ireq->ecn_ok &= cookie_ecn_ok(net, &rt->dst);
>  	treq->accecn_ok = ireq->ecn_ok && cookie_accecn_ok(th);
> +	treq->syn_ect_snt = READ_ONCE(inet_sk(sk)->tos) & INET_ECN_MASK;
>  
>  	ret = tcp_get_cookie_sock(sk, skb, req, &rt->dst);
>  	/* ip_queue_xmit() depends on our flow being setup

[Severity: Medium]
Does the syncookie path leave tp->saw_accecn_opt stuck at
TCP_ACCECN_OPT_NOT_SEEN when the peer includes an AccECN option on the
third ACK?

In the normal SYN-RECV path, tcp_check_req() calls tcp_accecn_option_init()
on the third ACK to update treq->saw_accecn_opt and treq->accecn_fail_mode
before tcp_ecn_openreq_child() copies them to the child socket.  The
syncookie path bypasses tcp_check_req(), and when tcp_child_process() later
runs tcp_rcv_state_process() -> tcp_ack() on that third ACK, neither
FLAG_FORWARD_PROGRESS nor FLAG_TS_PROGRESS is set, so
__tcp_accecn_process() returns before calling tcp_accecn_process_option().

The established child socket then starts with tp->saw_accecn_opt set to
TCP_ACCECN_OPT_NOT_SEEN, which suppresses outgoing AccECN options in
tcp_established_options(), reports tcpi_accecn_opt_seen as 0 in TCP_INFO,
and skips zeroed-option detection (TCP_ACCECN_OPT_FAIL_RECV) on the third
ACK.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261117124710.1338951-1-thaisonphan@google.com?part=2

      parent reply	other threads:[~2026-11-18 12:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 12:47 [PATCH net v3 0/2] tcp: initialize missing request_sock fields in syncookie path Thaison Phan
2026-11-17 12:47 ` [PATCH net v3 1/2] tcp: initialize ir_rmt_addr and ir_loc_addr in cookie_v6_check() Thaison Phan
2026-11-17 12:47 ` [PATCH net v3 2/2] tcp: accecn: initialize AccECN fields in syncookie path Thaison Phan
2026-11-17 18:06   ` Matthieu Baerts
2026-11-18 12:47   ` sashiko-bot [this message]

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-220941@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=thaisonphan@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox