]> 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)
commitb2f0affc00bedf0c560d1596761569b033689960
treef62ea560b498180fca2d5a0b31a14b66fb4c6648
parent03edf2fbd2498b1ec896eb7a93a6818a4715e2ae
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