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]
Date: Wed, 5 Jun 2024 18:29:56 +0100
From: Dmitry Safonov <0x7f454c46@...il.com>
To: Ratheesh Kannoth <rkannoth@...vell.com>
Cc: Eric Dumazet <edumazet@...gle.com>, "David S. Miller" <davem@...emloft.net>, 
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, David Ahern <dsahern@...nel.org>, 
	Steven Rostedt <rostedt@...dmis.org>, Masami Hiramatsu <mhiramat@...nel.org>, 
	Mathieu Desnoyers <mathieu.desnoyers@...icios.com>, Jonathan Corbet <corbet@....net>, 
	Mohammad Nassiri <mnassiri@...na.com>, Simon Horman <horms@...nel.org>, netdev@...r.kernel.org, 
	linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org, 
	linux-doc@...r.kernel.org
Subject: Re: [PATCH net-next v2 1/6] net/tcp: Use static_branch_tcp_{md5,ao}
 to drop ifdefs

On Wed, 5 Jun 2024 at 05:50, Ratheesh Kannoth <rkannoth@...vell.com> wrote:
>
> On 2024-06-05 at 07:50:02, Dmitry Safonov via B4 Relay (devnull+0x7f454c46.gmail.com@...nel.org) wrote:
> > From: Dmitry Safonov <0x7f454c46@...il.com>
> >
> > It's possible to clean-up some ifdefs by hiding that
> > tcp_{md5,ao}_needed static branch is defined and compiled only
> > under related configs, since commit 4c8530dc7d7d ("net/tcp: Only produce
> > AO/MD5 logs if there are any keys").
> >
> > Signed-off-by: Dmitry Safonov <0x7f454c46@...il.com>
> > ---
> >  include/net/tcp.h   | 14 ++++----------
> >  net/ipv4/tcp_ipv4.c |  8 ++------
> >  2 files changed, 6 insertions(+), 16 deletions(-)
> >
> > diff --git a/include/net/tcp.h b/include/net/tcp.h
> > index 08c3b99501cf..f6dd035e0fa9 100644
> > --- a/include/net/tcp.h
> > +++ b/include/net/tcp.h
> > @@ -2386,21 +2386,15 @@ static inline void tcp_get_current_key(const struct sock *sk,
> >
> >  static inline bool tcp_key_is_md5(const struct tcp_key *key)
> >  {
> > -#ifdef CONFIG_TCP_MD5SIG
> > -     if (static_branch_unlikely(&tcp_md5_needed.key) &&
> > -         key->type == TCP_KEY_MD5)
> > -             return true;
> > -#endif
> > +     if (static_branch_tcp_md5())
> Seems that we lost unlikely hint. Dont we add that as well-> unlikely()

Please, check the definition of static_branch_tcp_md5().
This doesn't have any functional changes but hides ifdefs in
the definition.

Thanks,
             Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ