lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL+tcoDoUXfVHSkVjMfsb=vGJ30Fa=ucakWHOVhhPNVRpV6m2w@mail.gmail.com>
Date: Fri, 9 Feb 2024 18:46:05 +0800
From: Jason Xing <kerneljasonxing@...il.com>
To: Kuniyuki Iwashima <kuniyu@...zon.com>
Cc: davem@...emloft.net, dsahern@...nel.org, edumazet@...gle.com, 
	kernelxing@...cent.com, kuba@...nel.org, netdev@...r.kernel.org, 
	pabeni@...hat.com
Subject: Re: [PATCH v2 net-next 2/2] tcp: add more DROP REASONs in receive process

On Fri, Feb 9, 2024 at 5:15 PM Kuniyuki Iwashima <kuniyu@...zon.com> wrote:
>
> From: Jason Xing <kerneljasonxing@...il.com>
> Date: Fri,  9 Feb 2024 14:12:13 +0800
> > From: Jason Xing <kernelxing@...cent.com>
> >
> > As the title said, add more reasons to narrow down the range about
> > why the skb should be dropped.
> >
> > Signed-off-by: Jason Xing <kernelxing@...cent.com>
> > ---
> >  include/net/dropreason-core.h | 11 ++++++++++-
> >  include/net/tcp.h             |  4 ++--
> >  net/ipv4/tcp_input.c          | 26 +++++++++++++++++---------
> >  net/ipv4/tcp_ipv4.c           | 19 ++++++++++++-------
> >  net/ipv4/tcp_minisocks.c      | 10 +++++-----
> >  net/ipv6/tcp_ipv6.c           | 19 ++++++++++++-------
> >  6 files changed, 58 insertions(+), 31 deletions(-)
> >
> > diff --git a/include/net/dropreason-core.h b/include/net/dropreason-core.h
> > index efbc5dfd9e84..9a7643be9d07 100644
> > --- a/include/net/dropreason-core.h
> > +++ b/include/net/dropreason-core.h
> > @@ -31,6 +31,8 @@
> >       FN(TCP_AOFAILURE)               \
> >       FN(SOCKET_BACKLOG)              \
> >       FN(TCP_FLAGS)                   \
> > +     FN(TCP_CONNREQNOTACCEPTABLE)    \
> > +     FN(TCP_ABORTONDATA)             \
> >       FN(TCP_ZEROWINDOW)              \
> >       FN(TCP_OLD_DATA)                \
> >       FN(TCP_OVERWINDOW)              \
> [...]
> > @@ -6654,7 +6657,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)
> >                       rcu_read_unlock();
> >
> >                       if (!acceptable)
> > -                             return 1;
> > +                             return SKB_DROP_REASON_TCP_CONNREQNOTACCEPTABLE;
>
> This sounds a bit ambiguous, and I think it can be more specific
> if tcp_conn_request() returns the drop reason and we change the
> acceptable evaluation.

Sure, are you suggesting adding more reasons into .conn_request
callback functions, like tcp_v4_conn_request(), right?

If you don't mind, I can do it next time because it involves more
effort which could be put into a seperate patch or patchset.

Thanks,
Jason

>
>   acceptable = icsk->icsk_af_ops->conn_request(sk, skb) >= 0;
>
>
> >                       consume_skb(skb);
> >                       return 0;
> >               }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ