mbox series

[v3,net-next,0/8] tcp: Clean up and refactor cookie_v[46]_check().

Message ID 20231129022924.96156-1-kuniyu@amazon.com (mailing list archive)
Headers show
Series tcp: Clean up and refactor cookie_v[46]_check(). | expand

Message

Kuniyuki Iwashima Nov. 29, 2023, 2:29 a.m. UTC
This is a preparation series for upcoming arbitrary SYN Cookie
support with BPF. [0]

There are slight differences between cookie_v[46]_check().  Such a
discrepancy caused an issue in the past, and BPF SYN Cookie support
will add more churn.

The primary purpose of this series is to clean up and refactor
cookie_v[46]_check() to minimise such discrepancies and make the
BPF series easier to review.

[0]: https://lore.kernel.org/netdev/20231121184245.69569-1-kuniyu@amazon.com/


Changes:
  v3:
    Patch 8: Fix ecn_ok init (Eric Dumazet)

  v2: https://lore.kernel.org/netdev/20231125011638.72056-1-kuniyu@amazon.com/
    Patch 7: Remove duplicated treq->syn_tos init (Simon Horman)

  v1: https://lore.kernel.org/netdev/20231123012521.62841-1-kuniyu@amazon.com/


Kuniyuki Iwashima (8):
  tcp: Clean up reverse xmas tree in cookie_v[46]_check().
  tcp: Cache sock_net(sk) in cookie_v[46]_check().
  tcp: Clean up goto labels in cookie_v[46]_check().
  tcp: Don't pass cookie to __cookie_v[46]_check().
  tcp: Don't initialise tp->tsoffset in tcp_get_cookie_sock().
  tcp: Move TCP-AO bits from cookie_v[46]_check() to tcp_ao_syncookie().
  tcp: Factorise cookie-independent fields initialisation in
    cookie_v[46]_check().
  tcp: Factorise cookie-dependent fields initialisation in
    cookie_v[46]_check()

 include/linux/netfilter_ipv6.h   |   8 +-
 include/net/tcp.h                |  22 ++--
 include/net/tcp_ao.h             |   6 +-
 net/core/filter.c                |  15 +--
 net/ipv4/syncookies.c            | 215 ++++++++++++++++---------------
 net/ipv4/tcp_ao.c                |  16 ++-
 net/ipv6/syncookies.c            | 108 +++++++---------
 net/netfilter/nf_synproxy_core.c |   4 +-
 8 files changed, 198 insertions(+), 196 deletions(-)

Comments

Kuniyuki Iwashima Nov. 30, 2023, 12:33 a.m. UTC | #1
From: Kuniyuki Iwashima <kuniyu@amazon.com>
Date: Tue, 28 Nov 2023 18:29:16 -0800
> This is a preparation series for upcoming arbitrary SYN Cookie
> support with BPF. [0]
> 
> There are slight differences between cookie_v[46]_check().  Such a
> discrepancy caused an issue in the past, and BPF SYN Cookie support
> will add more churn.
> 
> The primary purpose of this series is to clean up and refactor
> cookie_v[46]_check() to minimise such discrepancies and make the
> BPF series easier to review.
> 
> [0]: https://lore.kernel.org/netdev/20231121184245.69569-1-kuniyu@amazon.com/
> 
> 
> Changes:
>   v3:
>     Patch 8: Fix ecn_ok init (Eric Dumazet)

I just realised that Reviewed-by tag for patch 2 of v2 series contained
a wrong email address, and I happend to copy-and-paste it for patch 1-7...

> Reviewed-by: Eric Dumazet <edumazert@google.com>
https://lore.kernel.org/netdev/CANn89iLy5cuVU6Pbb4hU7otefEn1ufRswJUo5JZ-LC8aGVUCSg@mail.gmail.com/

Sorry for bothering, but it would be appreciated if it's fixed while
merging.

Thanks!
Jakub Kicinski Nov. 30, 2023, 4:19 a.m. UTC | #2
On Wed, 29 Nov 2023 16:33:49 -0800 Kuniyuki Iwashima wrote:
> I just realised that Reviewed-by tag for patch 2 of v2 series contained
> a wrong email address, and I happend to copy-and-paste it for patch 1-7...
> 
> > Reviewed-by: Eric Dumazet <edumazert@google.com>  
> https://lore.kernel.org/netdev/CANn89iLy5cuVU6Pbb4hU7otefEn1ufRswJUo5JZ-LC8aGVUCSg@mail.gmail.com/
> 
> Sorry for bothering, but it would be appreciated if it's fixed while
> merging.

Fixed, thanks for catching!
patchwork-bot+netdevbpf@kernel.org Nov. 30, 2023, 4:20 a.m. UTC | #3
Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 28 Nov 2023 18:29:16 -0800 you wrote:
> This is a preparation series for upcoming arbitrary SYN Cookie
> support with BPF. [0]
> 
> There are slight differences between cookie_v[46]_check().  Such a
> discrepancy caused an issue in the past, and BPF SYN Cookie support
> will add more churn.
> 
> [...]

Here is the summary with links:
  - [v3,net-next,1/8] tcp: Clean up reverse xmas tree in cookie_v[46]_check().
    https://git.kernel.org/netdev/net-next/c/34efc9cfe7c6
  - [v3,net-next,2/8] tcp: Cache sock_net(sk) in cookie_v[46]_check().
    https://git.kernel.org/netdev/net-next/c/45c28509fee6
  - [v3,net-next,3/8] tcp: Clean up goto labels in cookie_v[46]_check().
    https://git.kernel.org/netdev/net-next/c/50468cddd6bc
  - [v3,net-next,4/8] tcp: Don't pass cookie to __cookie_v[46]_check().
    https://git.kernel.org/netdev/net-next/c/7577bc8249c3
  - [v3,net-next,5/8] tcp: Don't initialise tp->tsoffset in tcp_get_cookie_sock().
    https://git.kernel.org/netdev/net-next/c/efce3d1fdff5
  - [v3,net-next,6/8] tcp: Move TCP-AO bits from cookie_v[46]_check() to tcp_ao_syncookie().
    https://git.kernel.org/netdev/net-next/c/7b0f570f879a
  - [v3,net-next,7/8] tcp: Factorise cookie-independent fields initialisation in cookie_v[46]_check().
    https://git.kernel.org/netdev/net-next/c/de5626b95e13
  - [v3,net-next,8/8] tcp: Factorise cookie-dependent fields initialisation in cookie_v[46]_check()
    https://git.kernel.org/netdev/net-next/c/8e7bab6b9652

You are awesome, thank you!
Eric Dumazet Nov. 30, 2023, 8:39 a.m. UTC | #4
On Thu, Nov 30, 2023 at 5:19 AM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Wed, 29 Nov 2023 16:33:49 -0800 Kuniyuki Iwashima wrote:
> > I just realised that Reviewed-by tag for patch 2 of v2 series contained
> > a wrong email address, and I happend to copy-and-paste it for patch 1-7...
> >
> > > Reviewed-by: Eric Dumazet <edumazert@google.com>
> > https://lore.kernel.org/netdev/CANn89iLy5cuVU6Pbb4hU7otefEn1ufRswJUo5JZ-LC8aGVUCSg@mail.gmail.com/
> >
> > Sorry for bothering, but it would be appreciated if it's fixed while
> > merging.
>
> Fixed, thanks for catching!

Indeed, thanks Jakub and Kuniyuki :)