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

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

 



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

-- 
1.8.3.1





[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