summaryrefslogtreecommitdiffstats
path: root/net/netfilter/nf_bpf_link.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2024-01-23 18:21:04 -0800
committerAlexei Starovoitov <ast@kernel.org>2024-01-24 16:21:01 -0800
commitbbc1d24724e110b86a1a7c3c1724ce0d62cc1e2e (patch)
treeb9fdd4d3c3693de18200ab474b48566137367e86 /net/netfilter/nf_bpf_link.c
parentcaf8f28e036c4ba1e823355da6c0c01c39e70ab9 (diff)
downloadlinux-bbc1d24724e110b86a1a7c3c1724ce0d62cc1e2e.tar.gz
linux-bbc1d24724e110b86a1a7c3c1724ce0d62cc1e2e.tar.bz2
linux-bbc1d24724e110b86a1a7c3c1724ce0d62cc1e2e.zip
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
Diffstat (limited to 'net/netfilter/nf_bpf_link.c')
-rw-r--r--net/netfilter/nf_bpf_link.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/nf_bpf_link.c b/net/netfilter/nf_bpf_link.c
index 0e4beae421f8..5257d5e7eb09 100644
--- a/net/netfilter/nf_bpf_link.c
+++ b/net/netfilter/nf_bpf_link.c
@@ -314,7 +314,7 @@ static bool nf_is_valid_access(int off, int size, enum bpf_access_type type,
static const struct bpf_func_proto *
bpf_nf_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
{
- return bpf_base_func_proto(func_id);
+ return bpf_base_func_proto(func_id, prog);
}
const struct bpf_verifier_ops netfilter_verifier_ops = {