]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit511760db3ed3ddffadc452801b3a84c9bdbd55da
treef62ea560b498180fca2d5a0b31a14b66fb4c6648
parent5b5a0d963f7709a48d21776919bcef7275b93576
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