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  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, 7 Dec 2020 22:48:50 -0800
From:   Andrii Nakryiko <andrii.nakryiko@...il.com>
To:     Saeed Mahameed <saeed@...nel.org>
Cc:     bpf <bpf@...r.kernel.org>, Alexei Starovoitov <ast@...com>,
        Daniel Borkmann <daniel@...earbox.net>,
        Networking <netdev@...r.kernel.org>,
        Andrii Nakryiko <andrii@...nel.org>
Subject: Re: [PATCH bpf] tools/bpftool: Add/Fix support for modules btf dump

On Mon, Dec 7, 2020 at 10:45 PM Saeed Mahameed <saeed@...nel.org> wrote:
>
> On Mon, 2020-12-07 at 22:38 -0800, Andrii Nakryiko wrote:
> > On Mon, Dec 7, 2020 at 10:26 PM Saeed Mahameed <saeed@...nel.org>
> > wrote:
> > > On Mon, 2020-12-07 at 19:14 -0800, Andrii Nakryiko wrote:
> > > > On Sun, Dec 6, 2020 at 9:21 PM <saeed@...nel.org> wrote:
> > > > > From: Saeed Mahameed <saeedm@...dia.com>
> > > > >
> [...]
> > > > >
> > > > > I am not sure why this hasn't been added by the original
> > > > > patchset
> > > >
> > > > because I never though of dumping module BTF by id, given there
> > > > is
> > > > nicely named /sys/kernel/btf/<module> :)
> > > >
> > >
> > > What if i didn't compile my kernel with SYSFS ? a user experience
> > > is a
> > > user experience, there is no reason to not support dump a module
> > > btf by
> > > id or to have different behavior for different BTF sources.
> >
> > Hm... I didn't claim otherwise and didn't oppose the feature, why the
> > lecture about user experience?
> >
>
> Sorry wasn't a lecture, just wanted to emphasize the motivation.
>
> > Not having sysfs is a valid point. In such cases, if BTF dumping is
> > from ID and we see that it's a module BTF, finding vmlinux BTF from
> > ID
> > makes sense.
> >
> > > I can revise this patch to support -B option and lookup vmlinux
> > > file if
> > > not provided for module btf dump by ids.
> >
> > yep
> >
> > > but we  still need to pass base_btf to btf__get_from_id() in order
> > > to
> > > support that, as was done for btf__parse_split() ... :/
> >
> > btf__get_from_id_split() might be needed, yes.
> >
> > > Are you sure you don't like the current patch/libbpf API ? it is
> > > pretty
> > > straight forward and correct.
> >
> > I definitely don't like adding btf_get_kernel_id() API to libbpf.
> > There is nothing special about it to warrant adding it as a public
> > API. Everything we discussed can be done by bpftool.
> >
>
> What about the case where sysfs isn't available ?
> we still need to find vmlinux's btf id..

Right, but bpftool is perfectly capable of doing that without adding
APIs to libbpf. That's why I wrote above:

  > > Not having sysfs is a valid point. In such cases, if BTF dumping is
  > > from ID and we see that it's a module BTF, finding vmlinux BTF from
  > > ID
  > > makes sense.

>
>
>

Powered by blists - more mailing lists