Skip to content

RFC bpf: Add a new kfunc bpf_current_capable

Yafang Shao bpf linux-kselftest lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 13 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2bpf: Add bpf_current_capable kfunckernel/bpf/helpers.c+6 -026 replies
2/2selftests/bpf: Add selftest for bpf_current_capabletools/testing/selftests/bpf/prog_tests/bpf_current_cap.c tools/testing/selftests/bpf/progs/test_bpf_current_cap.c+117 -00 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchHagar Gamal Halim HemdanYafang Shao
1/2A-b Based-on-patch-by
2/2

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

Read the v1 thread

Cover letter [RFC PATCH bpf-next 0/2] bpf: Add a new kfunc bpf_current_capable

Add a new kfunc bpf_current_capable to check whether the current task has a specific capability. In our use case, we will use it in a lsm bpf program to verify if the user operation is permitted based on our security policy.

Yafang Shao (2):
bpf: Add bpf_current_capable kfunc selftests/bpf: Add selftest for bpf_current_capable

 kernel/bpf/helpers.c                               |  6 ++
 .../selftests/bpf/prog_tests/bpf_current_cap.c     | 80 ++++++++++++++++++++++
 .../selftests/bpf/progs/test_bpf_current_cap.c     | 37 ++++++++++
 3 files changed, 123 insertions(+)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/bpf_current_cap.c
 create mode 100644 tools/testing/selftests/bpf/progs/test_bpf_current_cap.c
Signature · 1 line
1.8.3.1