Re: [PATCH v3 bpf-next 1/4] libbpf: stop enforcing kern_version, populate it for users

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Oct 7, 2019 at 9:14 AM Stanislav Fomichev <sdf@xxxxxxxxxxx> 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
APIs.

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@xxxxxx>
> > ---

[...]




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux