summaryrefslogtreecommitdiff
path: root/scripts/lib/abi/helpers.py
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2025-03-17 23:45:12 +0300
committerAndrii Nakryiko <andrii@kernel.org>2025-03-17 23:45:13 +0300
commitb02f072a36560a89155a1ebcb2ca6bd881333a8b (patch)
tree62436d27fd49365a4db2b9fa92065b6aabbca28c /scripts/lib/abi/helpers.py
parent812f7702d83d84cdf776d75e2ba5386de9e8acc0 (diff)
parenta024843d92cca491034dac648bcfec967199a4a4 (diff)
downloadlinux-b02f072a36560a89155a1ebcb2ca6bd881333a8b.tar.xz
Merge branch 'support-freplace-prog-from-user-namespace'
Mykyta Yatsenko says: ==================== Support freplace prog from user namespace From: Mykyta Yatsenko <yatsenko@meta.com> Freplace programs can't be loaded from user namespace, as bpf_program__set_attach_target() requires searching for target prog BTF, which is locked under CAP_SYS_ADMIN. This patch set enables this use case by: 1. Relaxing capable check in bpf's BPF_BTF_GET_FD_BY_ID, check for CAP_BPF instead of CAP_SYS_ADMIN, support BPF token in attr argument. 2. Pass BPF token around libbpf from bpf_program__set_attach_target() to bpf syscall where capable check is. 3. Validate positive/negative scenarios in selftests This patch set is enabled by the recent libbpf change[1], that introduced bpf_object__prepare() API. Calling bpf_object__prepare() for freplace program before bpf_program__set_attach_target() initializes BPF token, which is then passed to bpf syscall by libbpf. [1] https://lore.kernel.org/all/20250303135752.158343-1-mykyta.yatsenko5@gmail.com/ ==================== Link: https://patch.msgid.link/20250317174039.161275-1-mykyta.yatsenko5@gmail.com Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Diffstat (limited to 'scripts/lib/abi/helpers.py')
0 files changed, 0 insertions, 0 deletions