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)
commiteb3f595dab40b61011c5f123507a7db2df6f0e65
tree38e84dcbcb898acfe6208b3cdbab5fbb8546dd40
parent69b693f0aefa0ed521e8bd02260523b5ae446ad7
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