]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
bpf: Avoid warning on unexpected map for tail call
authorPaul Chaignon <paul.chaignon@gmail.com>
Thu, 3 Jul 2025 21:35:09 +0000 (23:35 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 4 Jul 2025 02:30:54 +0000 (19:30 -0700)
commit032547272eb0884470165e6a8fd73b80688e847f
tree3f54d544fb308e4ac8db50da9c73c883efdc38f7
parent71b4a9959e228708c702008d99273ad65442e21e
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: d2e4c1e6c294 ("bpf: Constant map key tracking for prog array pokes")
Fixes: 0df1a55afa83 ("bpf: Warn on internal verifier errors")
Reported-by: syzbot+efb099d5833bca355e51@syzkaller.appspotmail.com
Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/1f395b74e73022e47e04a31735f258babf305420.1751578055.git.paul.chaignon@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/verifier.c