libbpf: Improve sanity checking during BTF fix up
mainline inclusion from mainline-5.17-rc1 commit 88918dc1 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I5EUVD CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=88918dc12dc357a06d8d722a684617b1c87a4654 ------------------------------------------------- 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: NAndrii Nakryiko <andrii@kernel.org> Signed-off-by: NAlexei Starovoitov <ast@kernel.org> Acked-by: NYonghong Song <yhs@fb.com> Link: https://lore.kernel.org/bpf/20211103173213.1376990-3-andrii@kernel.org (cherry picked from commit 88918dc1) Signed-off-by: NWang Yufen <wangyufen@huawei.com>
Showing
想要评论请 注册 或 登录