diff options
author | Roman Gushchin <guroan@gmail.com> | 2018-12-11 02:43:00 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2018-12-13 02:33:33 +0300 |
commit | 1b2b234b1318afb3775d4c6624fd5a96558f19df (patch) | |
tree | b473e992413a2c8c60195ae7c2606fb172012569 /kernel/bpf/arraymap.c | |
parent | a0517a0f7ef23550b4484c37e2b9c2d32abebf64 (diff) | |
download | linux-1b2b234b1318afb3775d4c6624fd5a96558f19df.tar.xz |
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>
Diffstat (limited to 'kernel/bpf/arraymap.c')
-rw-r--r-- | kernel/bpf/arraymap.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c index 24583da9ffd1..25632a75d630 100644 --- a/kernel/bpf/arraymap.c +++ b/kernel/bpf/arraymap.c @@ -382,6 +382,7 @@ static void percpu_array_map_seq_show_elem(struct bpf_map *map, void *key, } static int array_map_check_btf(const struct bpf_map *map, + const struct btf *btf, const struct btf_type *key_type, const struct btf_type *value_type) { |