bpf: Allow to specify kernel module BTFs when attaching BPF programs
Add ability for user-space programs to specify non-vmlinux BTF when attaching BTF-powered BPF programs: raw_tp, fentry/fexit/fmod_ret, LSM, etc. For this, attach_prog_fd (now with the alias name attach_btf_obj_fd) should specify FD of a module or vmlinux BTF object. For backwards compatibility reasons, 0 denotes vmlinux BTF. Only kernel BTF (vmlinux or module) can be specified. Signed-off-by:Andrii Nakryiko <andrii@kernel.org> Signed-off-by:
Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20201203204634.1325171-11-andrii@kernel.org
Showing
- include/linux/btf.h 1 addition, 0 deletionsinclude/linux/btf.h
- include/uapi/linux/bpf.h 6 additions, 1 deletioninclude/uapi/linux/bpf.h
- kernel/bpf/btf.c 5 additions, 0 deletionskernel/bpf/btf.c
- kernel/bpf/syscall.c 51 additions, 31 deletionskernel/bpf/syscall.c
- tools/include/uapi/linux/bpf.h 6 additions, 1 deletiontools/include/uapi/linux/bpf.h
Please register or sign in to comment