OSDN Git Service

libbpf: Improve sanity checking during BTF fix up
authorAndrii Nakryiko <andrii@kernel.org>
Wed, 3 Nov 2021 17:32:10 +0000 (10:32 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 3 Nov 2021 20:25:37 +0000 (13:25 -0700)
commit88918dc12dc357a06d8d722a684617b1c87a4654
treef62ea560b498180fca2d5a0b31a14b66fb4c6648
parent833907876be55205d0ec153dcd819c014404ee16
libbpf: Improve sanity checking during BTF fix up

If BTF is corrupted DATASEC's variable type ID might be incorrect.
Prevent this easy to detect situation with extra NULL check.
Reported by oss-fuzz project.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20211103173213.1376990-3-andrii@kernel.org
tools/lib/bpf/libbpf.c