Skip to content
Commit 3bfb49d7 authored by Marco Elver's avatar Marco Elver Committed by Alexei Starovoitov
Browse files

bpf: Refactor bpf_tracing_func_proto() and remove bpf_get_probe_write_proto()



With bpf_get_probe_write_proto() no longer printing a message, we can
avoid it being a special case with its own permission check.

Refactor bpf_tracing_func_proto() similar to bpf_base_func_proto() to
have a section conditional on bpf_token_capable(CAP_SYS_ADMIN), where
the proto for bpf_probe_write_user() is returned. Finally, remove the
unnecessary bpf_get_probe_write_proto().

This simplifies the code, and adding additional CAP_SYS_ADMIN-only
helpers in future avoids duplicating the same CAP_SYS_ADMIN check.

Suggested-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Signed-off-by: default avatarMarco Elver <elver@google.com>
Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/r/20241129090040.2690691-2-elver@google.com


Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent b28573eb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment