bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Stanislav Fomichev <sdf@fomichev.me>
Cc: Andrii Nakryiko <andriin@fb.com>, bpf <bpf@vger.kernel.org>,
	Networking <netdev@vger.kernel.org>,
	Alexei Starovoitov <ast@fb.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Kernel Team <kernel-team@fb.com>
Subject: Re: [PATCH v3 bpf-next 1/4] libbpf: stop enforcing kern_version, populate it for users
Date: Mon, 7 Oct 2019 09:42:59 -0700	[thread overview]
Message-ID: <CAEf4Bza-8EtVagW8PG1pVVDp+jXGg59kW9FJNbYbWAxar3S6Gg@mail.gmail.com> (raw)
In-Reply-To: <20191007161437.GB2096@mini-arch>

On Mon, Oct 7, 2019 at 9:14 AM Stanislav Fomichev <sdf@fomichev.me> wrote:
> On 10/04, Andrii Nakryiko wrote:
> > Kernel version enforcement for kprobes/kretprobes was removed from
> > 5.0 kernel in 6c4fc209fcf9 ("bpf: remove useless version check for prog load").
> > Since then, BPF programs were specifying SEC("version") just to please
> > libbpf. We should stop enforcing this in libbpf, if even kernel doesn't
> > care. Furthermore, libbpf now will pre-populate current kernel version
> > of the host system, in case we are still running on old kernel.
> [..]
> > This patch also removes __bpf_object__open_xattr from libbpf.h, as
> > nothing in libbpf is relying on having it in that header. That function
> > was never exported as LIBBPF_API and even name suggests its internal
> > version. So this should be safe to remove, as it doesn't break ABI.
> This gives me the following (I don't know why bpftool was allowed to link
> against non-LIBBPF_API exposed function):
> + make -s -j72 -C tools/bpf/bpftool
> prog.c: In function ‘load_with_options’:
> prog.c:1227:8: warning: implicit declaration of function ‘__bpf_object__open_xattr’; did you mean ‘bpf_object__open_xattr’? [-Wimplicit-function-declaration]
>   obj = __bpf_object__open_xattr(&open_attr, bpf_flags);
>         ^~~~~~~~~~~~~~~~~~~~~~~~
>         bpf_object__open_xattr
> prog.c:1227:8: warning: nested extern declaration of ‘__bpf_object__open_xattr’ [-Wnested-externs]
> prog.c:1227:6: warning: assignment to ‘struct bpf_object *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
>   obj = __bpf_object__open_xattr(&open_attr, bpf_flags);
>       ^

Cool, I somehow didn't find any users of that API, but I looked only
in libbpf and selftests, forgot about bpftool. I'll fix it to use new

Thanks for reporting!

> Warning: Kernel ABI header at 'tools/include/uapi/linux/if_link.h' differs from latest version at 'include/uapi/linux/if_link.h'
> /usr/bin/ld: prog.o: in function `load_with_options':
> prog.c:(.text+0x49b): undefined reference to `__bpf_object__open_xattr'
> collect2: error: ld returned 1 exit statu
> > Signed-off-by: Andrii Nakryiko <andriin@fb.com>
> > ---


  reply	other threads:[~2019-10-07 16:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-04 22:40 [PATCH v3 bpf-next 0/4] Add new-style bpf_object__open APIs Andrii Nakryiko
2019-10-04 22:40 ` [PATCH v3 bpf-next 1/4] libbpf: stop enforcing kern_version, populate it for users Andrii Nakryiko
2019-10-07 16:14   ` Stanislav Fomichev
2019-10-07 16:42     ` Andrii Nakryiko [this message]
2019-10-04 22:40 ` [PATCH v3 bpf-next 2/4] libbpf: add bpf_object__open_{file,mem} w/ extensible opts Andrii Nakryiko
2019-10-06  1:24   ` Alexei Starovoitov
2019-10-06  2:35     ` Andrii Nakryiko
2019-10-04 22:40 ` [PATCH v3 bpf-next 3/4] libbpf: fix bpf_object__name() to actually return object name Andrii Nakryiko
2019-10-04 22:40 ` [PATCH v3 bpf-next 4/4] selftests/bpf: switch tests to new bpf_object__open_{file,mem}() APIs Andrii Nakryiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEf4Bza-8EtVagW8PG1pVVDp+jXGg59kW9FJNbYbWAxar3S6Gg@mail.gmail.com \
    --to=andrii.nakryiko@gmail.com \
    --cc=andriin@fb.com \
    --cc=ast@fb.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=sdf@fomichev.me \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).