diff options
| author | 2025-03-17 17:40:36 +0000 | |
|---|---|---|
| committer | 2025-03-17 13:45:11 -0700 | |
| commit | 0de445d18e36ca5914337217c118016ba5db574d (patch) | |
| tree | e4524bbe1683861784add30e3447b4a53c7f69fb /include/uapi/linux | |
| parent | bpf, x86: Fix objtool warning for timed may_goto (diff) | |
| download | wireguard-linux-0de445d18e36ca5914337217c118016ba5db574d.tar.xz wireguard-linux-0de445d18e36ca5914337217c118016ba5db574d.zip | |
bpf: BPF token support for BPF_BTF_GET_FD_BY_ID
Currently BPF_BTF_GET_FD_BY_ID requires CAP_SYS_ADMIN, which does not
allow running it from user namespace. This creates a problem when
freplace program running from user namespace needs to query target
program BTF.
This patch relaxes capable check from CAP_SYS_ADMIN to CAP_BPF and adds
support for BPF token that can be passed in attributes to syscall.
Signed-off-by: Mykyta Yatsenko <yatsenko@meta.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20250317174039.161275-2-mykyta.yatsenko5@gmail.com
Diffstat (limited to 'include/uapi/linux')
| -rw-r--r-- | include/uapi/linux/bpf.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index bb37897c0393..661de2444965 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h @@ -1652,6 +1652,7 @@ union bpf_attr { }; __u32 next_id; __u32 open_flags; + __s32 fd_by_id_token_fd; }; struct { /* anonymous struct used by BPF_OBJ_GET_INFO_BY_FD */ |
