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  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:   Thu, 28 May 2020 19:23:49 +0200
From:   Jiri Olsa <>
To:     Andrii Nakryiko <>
Cc:     Alexei Starovoitov <>,
        Jiri Olsa <>,
        Alexei Starovoitov <>,
        Daniel Borkmann <>,
        Networking <>, bpf <>,
        Yonghong Song <>, Martin KaFai Lau <>,
        David Miller <>,
        John Fastabend <>,
        Jesper Dangaard Brouer <>,
        Wenbo Zhang <>,
        KP Singh <>,
        Andrii Nakryiko <>,
        Brendan Gregg <>,
        Florent Revest <>,
        Al Viro <>
Subject: Re: [PATCH 7/9] bpf: Compile the BTF id whitelist data in vmlinux

On Thu, May 14, 2020 at 03:46:26PM -0700, Andrii Nakryiko wrote:


> > I was thinking of putting the names in __init section and generate the BTF
> > ids on kernel start, but the build time generation seemed more convenient..
> > let's see the linking times with 'real size' whitelist and we can reconsider
> >
> Being able to record such places where to put BTF ID in code would be
> really nice, as Alexei mentioned. There are many potential use cases
> where it would be good to have BTF IDs just put into arbitrary
> variables/arrays. This would trigger compilation error, if someone
> screws up the name, or function is renamed, or if function can be
> compiled out under some configuration. E.g., assuming some reasonable
> implementation of the macro

I'm struggling with this part.. to get some reasonable reference
to function/name into 32 bits? any idea? ;-)


> static const u32 d_path_whitelist[] = {
>     BTF_ID_FUNC(vfs_fallocate),
>     BTF_ID_FUNC(do_truncate),
> #endif
> };
> Would be nice and very explicit. Given this is not going to be sorted,
> you won't be able to use binary search, but if whitelists are
> generally small, it should be fine as is. If not, hashmap could be
> built in runtime and would be, probably, faster than binary search for
> longer sets of BTF IDs.
> I wonder if we can do some assembly magic with generating extra
> symbols and/or relocations to achieve this? What do you think? Is it
> doable/desirable/better?
> > thanks,
> > jirka
> >

Powered by blists - more mailing lists