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:   Mon, 22 Mar 2021 09:56:19 -0700
From:   Andrii Nakryiko <andrii.nakryiko@...il.com>
To:     Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc:     Andrii Nakryiko <andrii@...nel.org>, bpf <bpf@...r.kernel.org>,
        Networking <netdev@...r.kernel.org>,
        Alexei Starovoitov <ast@...com>,
        Daniel Borkmann <daniel@...earbox.net>,
        Kernel Team <kernel-team@...com>
Subject: Re: [PATCH bpf-next 3/3] selftests/bpf: allow compiling BPF objects
 without BTF

On Sun, Mar 21, 2021 at 6:07 PM Alexei Starovoitov
<alexei.starovoitov@...il.com> wrote:
>
> On Sat, Mar 20, 2021 at 10:00:57AM -0700, Andrii Nakryiko wrote:
> > On Fri, Mar 19, 2021 at 7:22 PM Alexei Starovoitov
> > <alexei.starovoitov@...il.com> wrote:
> > >
> > > On Fri, Mar 19, 2021 at 01:59:09PM -0700, Andrii Nakryiko wrote:
> > > > Add ability to skip BTF generation for some BPF object files. This is done
> > > > through using a convention of .nobtf.c file name suffix.
> > > >
> > > > Also add third statically linked file to static_linked selftest. This file has
> > > > no BTF, causing resulting object file to have only some of DATASEC BTF types.
> > > > It also is using (from BPF code) global variables. This tests both libbpf's
> > > > static linking logic and bpftool's skeleton generation logic.
> > >
> > > I don't like the long term direction of patch 1 and 3.
> > > BTF is mandatory for the most bpf kernel features added in the last couple years.
> > > Making user space do quirks for object files without BTF is not something
> > > we should support or maintain. If there is no BTF the linker and skeleton
> > > generation shouldn't crash, of course, but they should reject such object.
> >
> > I don't think tools need to enforce any policies like that. They are
> > tools and should be unassuming about the way they are going to be used
> > to the extent possible.
>
> Right and bpftool/skeleton was used with BTF since day one.
> Without BTF the skeleton core ideas are lost. The skeleton api
> gives no benefit. So what's the point of adding support for skeleton without BTF?
> Is there a user that would benefit? If so, what will they gain from
> such BTF-less skeleton?

The only part of skeleton API that's not available is convenient
user-space access to global variables. If you don't use global
variables you don't use BTF at all with skeleton. So all features but
one work without BTF just fine: compile-time maps and progs (and
links) references, embedding object file in .skel.h, and even
automatic memory-mapping of .data/.rodata/.bss (just unknown struct
layout).

Compile-time maps and progs and separately object file embedding in C
header are useful in their own rights, even individually. There is no
single "core idea" of the BPF skeleton in my mind. What is it for you?

So given none of the fixes are horrible hacks and won't incur
additional maintenance costs, what's the problem with accepting them?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ