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, 16 Oct 2019 15:10:20 +0200
From:   Daniel Borkmann <daniel@...earbox.net>
To:     Ben Dooks <ben.dooks@...ethink.co.uk>
Cc:     linux-kernel@...ts.codethink.co.uk,
        Alexei Starovoitov <ast@...nel.org>,
        Martin KaFai Lau <kafai@...com>,
        Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <jakub.kicinski@...ronome.com>,
        Jesper Dangaard Brouer <hawk@...nel.org>,
        John Fastabend <john.fastabend@...il.com>,
        netdev@...r.kernel.org, bpf@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: bpf: add static in net/core/filter.c

On Wed, Oct 16, 2019 at 02:02:31PM +0100, Ben Dooks wrote:
> On 16/10/2019 13:26, Daniel Borkmann wrote:
> > On Wed, Oct 16, 2019 at 12:04:46PM +0100, Ben Dooks (Codethink) wrote:
> > > There are a number of structs in net/core/filter.c
> > > that are not exported or declared outside of the
> > > file. Fix the following warnings by making these
> > > all static:
> > > 
> > > net/core/filter.c:8465:31: warning: symbol 'sk_filter_verifier_ops' was not declared. Should it be static?
> > > net/core/filter.c:8472:27: warning: symbol 'sk_filter_prog_ops' was not declared. Should it be static?
> > [...]
> > > net/core/filter.c:8935:27: warning: symbol 'sk_reuseport_prog_ops' was not declared. Should it be static?
> > > 
> > > Signed-off-by: Ben Dooks <ben.dooks@...ethink.co.uk>
> > > ---
> > > Cc: Alexei Starovoitov <ast@...nel.org>
> > > Cc: Daniel Borkmann <daniel@...earbox.net>
> > > Cc: Martin KaFai Lau <kafai@...com>
> > > Cc: Song Liu <songliubraving@...com>
> > > Cc: Yonghong Song <yhs@...com>
> > > Cc: "David S. Miller" <davem@...emloft.net>
> > > Cc: Jakub Kicinski <jakub.kicinski@...ronome.com>
> > > Cc: Jesper Dangaard Brouer <hawk@...nel.org>
> > > Cc: John Fastabend <john.fastabend@...il.com>
> > > Cc: netdev@...r.kernel.org
> > > Cc: bpf@...r.kernel.org
> > > Cc: linux-kernel@...r.kernel.org
> > > ---
> > >   net/core/filter.c | 60 +++++++++++++++++++++++------------------------
> > >   1 file changed, 30 insertions(+), 30 deletions(-)
> > > 
> > > diff --git a/net/core/filter.c b/net/core/filter.c
> > > index ed6563622ce3..f7338fee41f8 100644
> > > --- a/net/core/filter.c
> > > +++ b/net/core/filter.c
> > > @@ -8462,18 +8462,18 @@ static u32 sk_msg_convert_ctx_access(enum bpf_access_type type,
> > >   	return insn - insn_buf;
> > >   }
> > > -const struct bpf_verifier_ops sk_filter_verifier_ops = {
> > > +static const struct bpf_verifier_ops sk_filter_verifier_ops = {
> > >   	.get_func_proto		= sk_filter_func_proto,
> > >   	.is_valid_access	= sk_filter_is_valid_access,
> > >   	.convert_ctx_access	= bpf_convert_ctx_access,
> > >   	.gen_ld_abs		= bpf_gen_ld_abs,
> > >   };
> > 
> > Big obvious NAK. I'm puzzled that you try to fix a compile warning, but without
> > even bothering to compile the result after your patch ...
> 
> builds fine. maybe some effort to stop this happening again should be made.

It doesn't build, because they are used/needed outside:

[...]
  CC      net/core/dev_ioctl.o
  CC      net/core/tso.o
net/core/filter.c:8467:38: error: static declaration of ‘sk_filter_verifier_ops’ follows non-static declaration
 8467 | static const struct bpf_verifier_ops sk_filter_verifier_ops = {
      |                                      ^~~~~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/bpf-cgroup.h:5,
                 from ./include/linux/cgroup-defs.h:22,
                 from ./include/linux/cgroup.h:28,
                 from ./include/net/netprio_cgroup.h:11,
                 from ./include/linux/netdevice.h:42,
                 from ./include/net/sock.h:46,
                 from ./include/linux/sock_diag.h:8,
                 from net/core/filter.c:25:
./include/linux/bpf_types.h:5:44: note: previous declaration of ‘sk_filter_verifier_ops’ was here
    5 | BPF_PROG_TYPE(BPF_PROG_TYPE_SOCKET_FILTER, sk_filter)
      |                                            ^~~~~~~~~
./include/linux/bpf.h:625:39: note: in definition of macro ‘BPF_PROG_TYPE’
  625 |  extern const struct bpf_verifier_ops _name ## _verifier_ops;
      |                                       ^~~~~
[...] ( and more of the same errors ... )

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ