summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorMykyta Yatsenko <yatsenko@meta.com>2024-03-25 15:22:10 +0000
committerAlexei Starovoitov <ast@kernel.org>2024-03-28 18:30:53 -0700
commit786bf0e7e2ec90b349a7bab6e97947982ab31f2c (patch)
tree06035090d80edace56555e7454bc414989f07903 /kernel
parent59b418c7063d30e0a3e1f592d47df096db83185c (diff)
downloadlinux-stable-786bf0e7e2ec90b349a7bab6e97947982ab31f2c.tar.gz
linux-stable-786bf0e7e2ec90b349a7bab6e97947982ab31f2c.tar.bz2
linux-stable-786bf0e7e2ec90b349a7bab6e97947982ab31f2c.zip
bpf: improve error message for unsupported helper
BPF verifier emits "unknown func" message when given BPF program type does not support BPF helper. This message may be confusing for users, as important context that helper is unknown only to current program type is not provided. This patch changes message to "program of this type cannot use helper " and aligns dependent code in libbpf and tests. Any suggestions on improving/changing this message are welcome. Signed-off-by: Mykyta Yatsenko <yatsenko@meta.com> Acked-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Quentin Monnet <qmo@kernel.org> Link: https://lore.kernel.org/r/20240325152210.377548-1-yatsenko@meta.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/bpf/verifier.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 17f26ba1a9e0..edb650667f44 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -10201,8 +10201,8 @@ static int check_helper_call(struct bpf_verifier_env *env, struct bpf_insn *insn
if (env->ops->get_func_proto)
fn = env->ops->get_func_proto(func_id, env->prog);
if (!fn) {
- verbose(env, "unknown func %s#%d\n", func_id_name(func_id),
- func_id);
+ verbose(env, "program of this type cannot use helper %s#%d\n",
+ func_id_name(func_id), func_id);
return -EINVAL;
}