]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bpf: Take into account BPF token when fetching helper protos
authorAndrii Nakryiko <andrii@kernel.org>
Wed, 24 Jan 2024 02:21:04 +0000 (18:21 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 25 Jan 2024 00:21:01 +0000 (16:21 -0800)
commitbbc1d24724e110b86a1a7c3c1724ce0d62cc1e2e
treeb9fdd4d3c3693de18200ab474b48566137367e86
parentcaf8f28e036c4ba1e823355da6c0c01c39e70ab9
bpf: Take into account BPF token when fetching helper protos

Instead of performing unconditional system-wide bpf_capable() and
perfmon_capable() calls inside bpf_base_func_proto() function (and other
similar ones) to determine eligibility of a given BPF helper for a given
program, use previously recorded BPF token during BPF_PROG_LOAD command
handling to inform the decision.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20240124022127.2379740-8-andrii@kernel.org
drivers/media/rc/bpf-lirc.c
include/linux/bpf.h
kernel/bpf/cgroup.c
kernel/bpf/helpers.c
kernel/bpf/syscall.c
kernel/trace/bpf_trace.c
net/core/filter.c
net/ipv4/bpf_tcp_ca.c
net/netfilter/nf_bpf_link.c