]> 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)
commitfeac4292a86d99da44616d74a4dea85ea6eab8bd
tree38e84dcbcb898acfe6208b3cdbab5fbb8546dd40
parentcd091043f44273a8d3e4dd219f8684928ac043fa
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