]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: btf: Validate type reference
authorMartin KaFai Lau <kafai@fb.com>
Wed, 18 Apr 2018 22:55:58 +0000 (15:55 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 19 Apr 2018 19:46:24 +0000 (21:46 +0200)
commiteff646e2238c3e90877ea258d455a362081f14a0
tree38e84dcbcb898acfe6208b3cdbab5fbb8546dd40
parentaf3cbd4c20fa037dfd8e36c04f3a21605b2f6ed9
bpf: btf: Validate type reference

After collecting all btf_type in the first pass in an earlier patch,
the second pass (in this patch) can validate the reference types
(e.g. the referring type does exist and it does not refer to itself).

While checking the reference type, it also gathers other information (e.g.
the size of an array).  This info will be useful in checking the
struct's members in a later patch.  They will also be useful in doing
pretty print later.

Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Acked-by: Alexei Starovoitov <ast@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
include/linux/btf.h [new file with mode: 0644]
kernel/bpf/btf.c