]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: fix BTF verification of enums
authorAlexei Starovoitov <ast@kernel.org>
Tue, 17 Sep 2019 17:45:37 +0000 (10:45 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 19 Sep 2019 12:22:44 +0000 (14:22 +0200)
commitd8cf207ff992b6830e19afa554de7918677f858c
tree44705f0e9fad8a7b3206d3b582e06875ce86f565
parent73e71cd09667ce848c4280ea5cbf4db1e73251d8
bpf: fix BTF verification of enums

vmlinux BTF has enums that are 8 byte and 1 byte in size.
2 byte enum is a valid construct as well.
Fix BTF enum verification to accept those sizes.

Fixes: cd091043f442 ("bpf: btf: Introduce BPF Type Format (BTF)")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
kernel/bpf/btf.c