Re: [PATCH bpf-next 0/3] Remove libcap dependency from bpf selftests

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

 



On Tue, Mar 15, 2022 at 6:48 PM Martin KaFai Lau <kafai@xxxxxx> wrote:
>
> After upgrading to the newer libcap (>= 2.60),
> the libcap commit aca076443591 ("Make cap_t operations thread safe.")
> added a "__u8 mutex;" to the "struct _cap_struct".  It caused a few byte
> shift that breaks the assumption made in the "struct libcap" definition
> in test_verifier.c.
>
> This set is to remove the libcap dependency from the bpf selftests.
>
> Martin KaFai Lau (3):
>   bpf: selftests: Add helpers to directly use the capget and capset
>     syscall
>   bpf: selftests: Remove libcap usage from test_verifier
>   bpf: selftests: Remove libcap usage from test_progs
>

Love the clean up and dropping the dependency on libcap! But it
currently breaks CI, probably because of missing CAP_BPF definitions
due to old system headers. Let's add #ifndef CAP_BPF/#define CAP_BPF
XXX/#endif guards for newer capabilities to make it work in CI as
well?

  [0] https://github.com/kernel-patches/bpf/runs/5563642266?check_suite_focus=true

>  tools/testing/selftests/bpf/Makefile          |  8 +-
>  tools/testing/selftests/bpf/cap_helpers.c     | 68 ++++++++++++++
>  tools/testing/selftests/bpf/cap_helpers.h     | 10 +++
>  .../selftests/bpf/prog_tests/bind_perm.c      | 45 ++--------
>  tools/testing/selftests/bpf/test_verifier.c   | 89 ++++++-------------
>  5 files changed, 118 insertions(+), 102 deletions(-)
>  create mode 100644 tools/testing/selftests/bpf/cap_helpers.c
>  create mode 100644 tools/testing/selftests/bpf/cap_helpers.h
>
> --
> 2.30.2
>



[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