mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
bpf: btf: Add BPF_BTF_LOAD command
This patch adds a BPF_BTF_LOAD command which 1) loads and verifies the BTF (implemented in earlier patches) 2) returns a BTF fd to userspace. In the next patch, the BTF fd can be specified during BPF_MAP_CREATE. It currently limits to CAP_SYS_ADMIN. Signed-off-by: Martin KaFai Lau <kafai@fb.com> Acked-by: Alexei Starovoitov <ast@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
This commit is contained in:
parent
b00b8daec8
commit
f56a653c1f
4 changed files with 97 additions and 0 deletions
|
@ -8,7 +8,11 @@
|
|||
|
||||
struct btf;
|
||||
struct btf_type;
|
||||
union bpf_attr;
|
||||
|
||||
void btf_put(struct btf *btf);
|
||||
int btf_new_fd(const union bpf_attr *attr);
|
||||
struct btf *btf_get_by_fd(int fd);
|
||||
/* Figure out the size of a type_id. If type_id is a modifier
|
||||
* (e.g. const), it will be resolved to find out the type with size.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue