mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thaison Phan <thaisonphan@google.com>
To: Eric Dumazet <edumazet@kernel.org>
Cc: "Thaison Phan" <thaisonphan@google.com>,
	"Matthieu Baerts" <matttbe@kernel.org>,
	"Neal Cardwell" <ncardwell@google.com>,
	"Kuniyuki Iwashima" <kuniyu@google.com>,
	"David S. Miller" <davem@davemloft.net>,
	"David Ahern" <dsahern@kernel.org>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Simon Horman" <horms@kernel.org>,
	"Ilpo Järvinen" <ij@kernel.org>,
	"Olivier Tilmans" <olivier.tilmans@nokia.com>,
	"Chia-Yu Chang" <chia-yu.chang@nokia-bell-labs.com>,
	"Stan Iliev" <stani@google.com>,
	netdev-bot+sashiko@kernel.org, netdev@vger.kernel.org,
	bpf@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v2 2/2] tcp: accecn: initialize AccECN fields in syncookie path
Date: Wed, 18 Nov 2026 20:15:40 +0000	[thread overview]
Message-ID: <20261118201540.2446821-1-thaisonphan@google.com> (raw)
In-Reply-To: <CAL4Wiir50_Z+m00GyU9BpRdAqgXs8V-L0S8kmmES=JiYyt==gg@mail.gmail.com>

On Wed, Nov 18, 2026 at 10:30:58AM +0100, Eric Dumazet wrote:
> Sashiko has a point about the BPF custom syncookie case.
>
> Requests coming from cookie_bpf_check() also reach this line, but the
> kernel did not send that SYN-ACK, a TC/XDP program did. The listener's
> tos/tclass says nothing about the ECN codepoint the program used, and
> struct bpf_tcp_req_attrs has no way to report it.
[...]
> Could you send a v3 doing something like this (untested)?
>
> In cookie_tcp_reqsk_init():
>
>         treq->saw_accecn_opt = TCP_ACCECN_OPT_NOT_SEEN;
>         treq->accecn_fail_mode = 0;
>         treq->syn_ect_rcv = 0;
>         treq->syn_ect_snt = 0;
>
> In cookie_v4_check():
>
>         /* SYN-ACK was not sent by the kernel if req->syncookie is set. */
>         if (!req->syncookie)
>                 treq->syn_ect_snt = READ_ONCE(inet_sk(sk)->tos) & INET_ECN_MASK;
>
> And the same in cookie_v6_check() with np->tclass.
>
> Letting the BPF program report the codepoint it used (a new field in
> struct bpf_tcp_req_attrs) would be net-next material.
>
> The other Sashiko remark (AccECN option carried by the third ACK is not
> processed in the syncookie path, unlike tcp_check_req()) looks correct,
> but this is not something added by this patch. It can be handled
> separately, no need to grow this series.
>
> Please mention the BPF case in the changelog. You can keep the
> Reviewed-by tags on both patches.

Makes sense, thanks for catching that and suggesting the fix. Since v3 [1]
already went out yesterday for Chia-Yu's changelog clarification, I'll fold
the !req->syncookie check, restore treq->syn_ect_snt = 0, and note the BPF
custom syncookie behavior in v4.

I think the Sashiko remark on the (AccEcn Option carried by the third ACK) is
correct as well, but I agree we can fix that in a separate patch set as it
isn't directly related to uninitialized fields.

[1] https://lore.kernel.org/netdev/20261117124710.1338951-1-thaisonphan@google.com/

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

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16  2:37 [PATCH net v2 0/2] tcp: initialize missing request_sock " Thaison Phan
2026-11-16  2:37 ` [PATCH net v2 1/2] tcp: initialize ir_rmt_addr and ir_loc_addr in cookie_v6_check() Thaison Phan
2026-11-16  2:37 ` [PATCH net v2 2/2] tcp: accecn: initialize AccECN fields in syncookie path Thaison Phan
2026-11-17 17:37   ` Matthieu Baerts
2026-11-18  5:40   ` netdev-bot+sashiko
2026-11-18  9:30   ` Eric Dumazet
2026-11-18 20:15     ` Thaison Phan [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=20261118201540.2446821-1-thaisonphan@google.com \
    --to=thaisonphan@google.com \
    --cc=bpf@vger.kernel.org \
    --cc=chia-yu.chang@nokia-bell-labs.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=ij@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matttbe@kernel.org \
    --cc=ncardwell@google.com \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olivier.tilmans@nokia.com \
    --cc=pabeni@redhat.com \
    --cc=stani@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

all inboxes | Powered by JetHome®