bpf: pass struct btf pointer to the map_check_btf() callback
authorRoman Gushchin <guroan@gmail.com>
Mon, 10 Dec 2018 23:43:00 +0000 (15:43 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 12 Dec 2018 23:33:33 +0000 (15:33 -0800)
commit1b2b234b1318afb3775d4c6624fd5a96558f19df
treeb473e992413a2c8c60195ae7c2606fb172012569
parenta0517a0f7ef23550b4484c37e2b9c2d32abebf64
bpf: pass struct btf pointer to the map_check_btf() callback

If key_type or value_type are of non-trivial data types
(e.g. structure or typedef), it's not possible to check them without
the additional information, which can't be obtained without a pointer
to the btf structure.

So, let's pass btf pointer to the map_check_btf() callbacks.

Signed-off-by: Roman Gushchin <guro@fb.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/linux/bpf.h
kernel/bpf/arraymap.c
kernel/bpf/lpm_trie.c
kernel/bpf/syscall.c