Skip to content

Commit 0325472

Browse files
pchaignoAlexei Starovoitov
authored andcommitted
bpf: Avoid warning on unexpected map for tail call
Before handling the tail call in record_func_key(), we check that the map is of the expected type and log a verifier error if it isn't. Such an error however doesn't indicate anything wrong with the verifier. The check for map<>func compatibility is done after record_func_key(), by check_map_func_compatibility(). Therefore, this patch logs the error as a typical reject instead of a verifier error. Fixes: d2e4c1e ("bpf: Constant map key tracking for prog array pokes") Fixes: 0df1a55 ("bpf: Warn on internal verifier errors") Reported-by: [email protected] Signed-off-by: Paul Chaignon <[email protected]> Acked-by: Eduard Zingerman <[email protected]> Link: https://lore.kernel.org/r/1f395b74e73022e47e04a31735f258babf305420.1751578055.git.paul.chaignon@gmail.com Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 71b4a99 commit 0325472

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/bpf/verifier.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11082,8 +11082,8 @@ record_func_key(struct bpf_verifier_env *env, struct bpf_call_arg_meta *meta,
1108211082
if (func_id != BPF_FUNC_tail_call)
1108311083
return 0;
1108411084
if (!map || map->map_type != BPF_MAP_TYPE_PROG_ARRAY) {
11085-
verifier_bug(env, "expected array map for tail call");
11086-
return -EFAULT;
11085+
verbose(env, "expected prog array map for tail call");
11086+
return -EINVAL;
1108711087
}
1108811088

1108911089
reg = &regs[BPF_REG_3];

0 commit comments

Comments
 (0)