Skip to content

Remove libcap dependency from bpf selftests

Martin KaFai Lau bpf 2 versions Applied

Status from this message: This series was applied to bpf/bpf-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 0 repliesApplied 3/3
  2. v13 patches 7 repliesSuperseded

Changes in v2 from the cover letter

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

Patches in v2 All 3 applied

#Subject and filesSizeRepliesApplied
1/3bpf: selftests: Add helpers to directly use the capget and capset syscalltools/testing/selftests/bpf/cap_helpers.c tools/testing/selftests/bpf/cap_helpers.h+86 -00 repliesApplied
2/3bpf: selftests: Remove libcap usage from test_verifiertools/testing/selftests/bpf/Makefile tools/testing/selftests/bpf/test_verifier.c+27 -640 repliesApplied
3/3bpf: selftests: Remove libcap usage from test_progstools/testing/selftests/bpf/Makefile tools/testing/selftests/bpf/prog_tests/bind_perm.c+11 -380 repliesApplied

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchJohn FastabendStanislav Fomichev
1/3A-b
2/3A-b
3/3A-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 bpf-next 0/3] Remove libcap dependency from bpf selftests

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
Signature · 1 line
2.30.2