diff options
author | 2025-03-17 13:45:12 -0700 | |
---|---|---|
committer | 2025-03-17 13:45:13 -0700 | |
commit | b02f072a36560a89155a1ebcb2ca6bd881333a8b (patch) | |
tree | 62436d27fd49365a4db2b9fa92065b6aabbca28c /scripts/gdb/linux/stackdepot.py | |
parent | bpf, x86: Fix objtool warning for timed may_goto (diff) | |
parent | selftests/bpf: Test freplace from user namespace (diff) | |
download | wireguard-linux-b02f072a36560a89155a1ebcb2ca6bd881333a8b.tar.xz wireguard-linux-b02f072a36560a89155a1ebcb2ca6bd881333a8b.zip |
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/gdb/linux/stackdepot.py')
0 files changed, 0 insertions, 0 deletions