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: <CAADnVQ+90UtuXVj8sCmyQQZCxFFfmcUq05w5DBybWxSN_0AL4A@mail.gmail.com>
Date:   Sun, 10 May 2020 09:09:02 -0700
From:   Alexei Starovoitov <alexei.starovoitov@...il.com>
To:     Yonghong Song <yhs@...com>
Cc:     Andrii Nakryiko <andriin@...com>, bpf <bpf@...r.kernel.org>,
        Martin KaFai Lau <kafai@...com>,
        Network Development <netdev@...r.kernel.org>,
        Alexei Starovoitov <ast@...com>,
        Daniel Borkmann <daniel@...earbox.net>,
        Kernel Team <kernel-team@...com>
Subject: Re: [PATCH bpf-next v4 16/21] tools/libbpf: add bpf_iter support

On Sat, May 9, 2020 at 10:07 PM Yonghong Song <yhs@...com> wrote:
>
>
>
> On 5/9/20 5:35 PM, Alexei Starovoitov wrote:
> > On Sat, May 09, 2020 at 10:59:17AM -0700, Yonghong Song wrote:
> >> @@ -6891,6 +6897,7 @@ static int bpf_object__collect_st_ops_relos(struct bpf_object *obj,
> >>
> >>   #define BTF_TRACE_PREFIX "btf_trace_"
> >>   #define BTF_LSM_PREFIX "bpf_lsm_"
> >> +#define BTF_ITER_PREFIX "__bpf_iter__"
> >>   #define BTF_MAX_NAME_SIZE 128
> >
> > In the kernel source the prefix doesn't stand out, but on libbpf side it looks
> > inconsistent. May be drop __ prefix and keep one _ in the suffix?
>
> Currently, I have context type as
>     struct bpf_iter__bpf_map
> Based on the above proposal, we will have function name as
>     bpf_iter_bpf_map
> It is quite similar to each other. My current usage to have
>      __bpf_iter__bpf_map
> intends to make func name and struct type name quite different.
> Or maybe
>      bpf_iter__bpf_map vs. bpf_iter_bpf_map
> just fine as user should not care about func name
> bpf_iter_bpf_map at all?

Type names bpf_iter_bpf_map and bpf_iter_foo don't look
unique, but I don't see why they should.
If code really required type name uniqueness __bpf_iter__ prefix
wouldn't provide that property anyway.
I think bpf_iter_ falls into the same category of prefixes like
those used by lsm, trace, struct_ops. Or I could be missing
why iter has to be different.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ