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] [day] [month] [year] [list]
Date:   Mon, 10 Apr 2017 07:42:23 +0200
From:   Johannes Berg <johannes@...solutions.net>
To:     Alexei Starovoitov <alexei.starovoitov@...il.com>,
        David Miller <davem@...emloft.net>
Cc:     netdev@...r.kernel.org
Subject: Re: [PATCH v2 1/2] bpf: remove struct bpf_prog_type_list


> > If you just don't want to list things multiple times how about:
> > 
> > linux/bpf_verifiers.h:
> > BPF_VERIFIER(BPF_PROG_TYPE_SOCKET_FILTER, sk_filter_prog_ops)
> > BPF_VERIFIER(BPF_PROG_TYPE_SCHED_CLS, tc_cls_prog_ops)
> >  ...
> > 
> > Then in bpf.h:
> > 
> > #define BPF_VERIFIER(TYPE_VAL, SYM) extern const struct
> > bpf_verifier_ops SYM;
> > #include <linux/bpf_verifiers.h"
> > 
> > and in kernel/bpf/syscall.c:
> > 
> > #define BPF_VERIFIER(TYPE_VAL, SYM) [TYPE_VAL] = &SYM,
> > #include <linux/bpf_verifiers.h"
> > 
> > or something like that.
> 
> That is great suggestion! I like it.

It'd doable, but then I need to play with the include guards, like
having "#define __BPF_REINCLUDE" or something like that before
reincluding it, I guess? Unless that file can simply not be included
anywhere?

Maybe I'll play with it - though perhaps it should be named bpf_types.h
or something like that so we don't have to have two files.

johannes

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ