aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/libbpf_common.h
diff options
context:
space:
mode:
authorSong Liu <[email protected]>2023-11-07 04:57:24 +0000
committerAlexei Starovoitov <[email protected]>2023-11-10 03:07:38 +0000
commit0b51940729150e807fc4b7767164e6bb6cf4f7dd (patch)
tree4937cbe0b7a90c82ccf94fefa34244db49e3fa1e /tools/lib/bpf/libbpf_common.h
parentbpf: Add __bpf_dynptr_data* for in kernel use (diff)
downloadkernel-0b51940729150e807fc4b7767164e6bb6cf4f7dd.tar.gz
kernel-0b51940729150e807fc4b7767164e6bb6cf4f7dd.zip
bpf: Factor out helper check_reg_const_str()
ARG_PTR_TO_CONST_STR is used to specify constant string args for BPF helpers. The logic that verifies a reg is ARG_PTR_TO_CONST_STR is implemented in check_func_arg(). As we introduce kfuncs with constant string args, it is necessary to do the same check for kfuncs (in check_kfunc_args). Factor out the logic for ARG_PTR_TO_CONST_STR to a new check_reg_const_str() so that it can be reused. check_func_arg() ensures check_reg_const_str() is only called with reg of type PTR_TO_MAP_VALUE. Add a redundent type check in check_reg_const_str() to avoid misuse in the future. Other than this redundent check, there is no change in behavior. Signed-off-by: Song Liu <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Acked-by: Andrii Nakryiko <[email protected]> Acked-by: Vadim Fedorenko <[email protected]> Link: https://lore.kernel.org/bpf/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/lib/bpf/libbpf_common.h')
0 files changed, 0 insertions, 0 deletions