bpf: verifier: bail out if the argument is not a map
authorBenjamin Tissoires <bentiss@kernel.org>
Sat, 20 Apr 2024 09:09:07 +0000 (11:09 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 24 Apr 2024 01:31:24 +0000 (18:31 -0700)
commitad2c03e691be3268eefc75ff1d892db3f0e79f62
tree915aecb9964c714c552cd7b37c765e0eb053858c
parentf1d0a2fbb0088675cceeab73d1f4b4308b289984
bpf: verifier: bail out if the argument is not a map

When a kfunc is declared with a KF_ARG_PTR_TO_MAP, we should have
reg->map_ptr set to a non NULL value, otherwise, that means that the
underlying type is not a map.

Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
Link: https://lore.kernel.org/r/20240420-bpf_wq-v2-7-6c986a5a741f@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/verifier.c