bpf/btf: Fix BTF verification of enum members in struct/union
authorYoshiki Komachi <komachi.yoshiki@gmail.com>
Tue, 10 Mar 2020 07:32:29 +0000 (16:32 +0900)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 10 Mar 2020 17:00:41 +0000 (10:00 -0700)
commitda6c7faeb103c493e505e87643272f70be586635
tree41c62e0d904f0ebaa19ce488df5552bccc485a89
parent1d8006abaab4cb90f81add86e8d1bf9411add05a
bpf/btf: Fix BTF verification of enum members in struct/union

btf_enum_check_member() was currently sure to recognize the size of
"enum" type members in struct/union as the size of "int" even if
its size was packed.

This patch fixes BTF enum verification to use the correct size
of member in BPF programs.

Fixes: 179cde8cef7e ("bpf: btf: Check members of struct/union")
Signed-off-by: Yoshiki Komachi <komachi.yoshiki@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/1583825550-18606-2-git-send-email-komachi.yoshiki@gmail.com
kernel/bpf/btf.c