aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/bpf.c
diff options
context:
space:
mode:
authorAndrea Terzolo <[email protected]>2023-06-26 09:36:14 +0000
committerAndrii Nakryiko <[email protected]>2023-06-30 19:27:16 +0000
commit2d2c95162de8fc6875c9c3d39f83527ae28e2e8a (patch)
tree3854001902f1bdeb613e907c098bfbb30179af3b /tools/lib/bpf/bpf.c
parentselftests/bpf: Verify that the cgroup_skb filters receive expected packets. (diff)
downloadkernel-2d2c95162de8fc6875c9c3d39f83527ae28e2e8a.tar.gz
kernel-2d2c95162de8fc6875c9c3d39f83527ae28e2e8a.zip
libbpf: Skip modules BTF loading when CAP_SYS_ADMIN is missing
If during CO-RE relocations libbpf is not able to find the target type in the running kernel BTF, it searches for it in modules' BTF. The downside of this approach is that loading modules' BTF requires CAP_SYS_ADMIN and this prevents BPF applications from running with more granular capabilities (e.g. CAP_BPF) when they don't need to search types into modules' BTF. This patch skips by default modules' BTF loading phase when CAP_SYS_ADMIN is missing. Suggested-by: Andrii Nakryiko <[email protected]> Co-developed-by: Federico Di Pierro <[email protected]> Signed-off-by: Federico Di Pierro <[email protected]> Signed-off-by: Andrea Terzolo <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/CAGQdkDvYU_e=_NX+6DRkL_-TeH3p+QtsdZwHkmH0w3Fuzw0C4w@mail.gmail.com Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/lib/bpf/bpf.c')
0 files changed, 0 insertions, 0 deletions