diff options
| author | Andrii Nakryiko <[email protected]> | 2023-11-30 10:52:19 -0800 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2023-12-06 10:02:59 -0800 |
| commit | 4cbb270e115bc197ff2046aeb54cc951666b16ec (patch) | |
| tree | 649b1a6a47043000dff55125dc5a91ad91fd24b7 /kernel/trace | |
| parent | e1cef620f598853a90f17701fcb1057a6768f7b8 (diff) | |
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'kernel/trace')
| -rw-r--r-- | kernel/trace/bpf_trace.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c index 1648bde28f01..774cf476a892 100644 --- a/kernel/trace/bpf_trace.c +++ b/kernel/trace/bpf_trace.c @@ -1626,7 +1626,7 @@ bpf_tracing_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) case BPF_FUNC_trace_vprintk: return bpf_get_trace_vprintk_proto(); default: - return bpf_base_func_proto(func_id); + return bpf_base_func_proto(func_id, prog); } } |