mbox series

[v2,bpf-next,0/3] Remove libcap dependency from bpf selftests

Message ID 20220316173816.2035581-1-kafai@fb.com (mailing list archive)
Headers show
Series Remove libcap dependency from bpf selftests | expand

Message

Martin KaFai Lau March 16, 2022, 5:38 p.m. UTC
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.

v2:
- Define CAP_PERFMON and CAP_BPF when the older <linux/capability.h>
  does not have them. (Andrii)

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

 tools/testing/selftests/bpf/Makefile          |  8 +-
 tools/testing/selftests/bpf/cap_helpers.c     | 67 ++++++++++++++
 tools/testing/selftests/bpf/cap_helpers.h     | 19 ++++
 .../selftests/bpf/prog_tests/bind_perm.c      | 44 ++--------
 tools/testing/selftests/bpf/test_verifier.c   | 88 ++++++-------------
 5 files changed, 124 insertions(+), 102 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/cap_helpers.c
 create mode 100644 tools/testing/selftests/bpf/cap_helpers.h

Comments

patchwork-bot+netdevbpf@kernel.org March 16, 2022, 10:20 p.m. UTC | #1
Hello:

This series was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@kernel.org>:

On Wed, 16 Mar 2022 10:38:16 -0700 you 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.
> 
> [...]

Here is the summary with links:
  - [v2,bpf-next,1/3] bpf: selftests: Add helpers to directly use the capget and capset syscall
    https://git.kernel.org/bpf/bpf-next/c/663af70aabb7
  - [v2,bpf-next,2/3] bpf: selftests: Remove libcap usage from test_verifier
    https://git.kernel.org/bpf/bpf-next/c/b1c2768a82b9
  - [v2,bpf-next,3/3] bpf: selftests: Remove libcap usage from test_progs
    https://git.kernel.org/bpf/bpf-next/c/82cb2b30773e

You are awesome, thank you!