[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240704181154.5866-1-kuniyu@amazon.com>
Date: Thu, 4 Jul 2024 11:11:54 -0700
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: <pabeni@...hat.com>
CC: <0x7f454c46@...il.com>, <davem@...emloft.net>, <dsahern@...nel.org>,
<edumazet@...gle.com>, <kuba@...nel.org>, <kuni1840@...il.com>,
<kuniyu@...zon.com>, <netdev@...r.kernel.org>
Subject: Re: [PATCH v1 net] tcp: Don't flag tcp_sk(sk)->rx_opt.saw_unknown for TCP AO.
From: Paolo Abeni <pabeni@...hat.com>
Date: Thu, 04 Jul 2024 12:05:42 +0200
> On Tue, 2024-07-02 at 20:35 -0700, Kuniyuki Iwashima wrote:
> > When we process segments with TCP AO, we don't check it in
> > tcp_parse_options(). Thus, opt_rx->saw_unknown is set to 1,
> > which unconditionally triggers the BPF TCP option parser.
> >
> > Let's avoid the unnecessary BPF invocation.
> >
> > Fixes: 0a3a809089eb ("net/tcp: Verify inbound TCP-AO signed segments")
> > Signed-off-by: Kuniyuki Iwashima <kuniyu@...zon.com>
> > ---
> > net/ipv4/tcp_input.c | 7 +++++++
> > 1 file changed, 7 insertions(+)
> >
> > diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> > index e67cbeeeb95b..77294fd5fd3e 100644
> > --- a/net/ipv4/tcp_input.c
> > +++ b/net/ipv4/tcp_input.c
> > @@ -4223,6 +4223,13 @@ void tcp_parse_options(const struct net *net,
> > * checked (see tcp_v{4,6}_rcv()).
> > */
> > break;
> > +#endif
> > +#ifdef CONFIG_TCP_AO
> > + case TCPOPT_AO:
> > + /* TCP AO has already been checked
> > + * (see tcp_inbound_ao_hash()).
> > + */
> > + break;
> > #endif
> > case TCPOPT_FASTOPEN:
> > tcp_parse_fastopen_option(
>
> [not strictly related to this patch] possibly even MPTCP could benefit
> from a similar change, but I'm unsure if we want to add even more cases
> to this statement.
Exactly, it seem no one has tried to inject/parse a new option with MPTCP.
Powered by blists - more mailing lists