]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
bpf: Add struct bpf_token_info
authorTao Chen <chen.dylane@linux.dev>
Wed, 16 Jul 2025 13:46:53 +0000 (21:46 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 17 Jul 2025 01:38:05 +0000 (18:38 -0700)
commit19d18fdfc79217c86802271c9ce5b4ed174628cc
treea6a54cca9f852079668d034830a22c6773acb409
parent8080500cba05d057dc6cfe4b6afbaf026eb2dd06
bpf: Add struct bpf_token_info

The 'commit 35f96de04127 ("bpf: Introduce BPF token object")' added
BPF token as a new kind of BPF kernel object. And BPF_OBJ_GET_INFO_BY_FD
already used to get BPF object info, so we can also get token info with
this cmd.
One usage scenario, when program runs failed with token, because of
the permission failure, we can report what BPF token is allowing with
this API for debugging.

Acked-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Tao Chen <chen.dylane@linux.dev>
Link: https://lore.kernel.org/r/20250716134654.1162635-1-chen.dylane@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/linux/bpf.h
include/uapi/linux/bpf.h
kernel/bpf/syscall.c
kernel/bpf/token.c
tools/include/uapi/linux/bpf.h