]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
libbpf: Detect corrupted ELF symbols section
authorAndrii Nakryiko <andrii@kernel.org>
Wed, 3 Nov 2021 17:32:09 +0000 (10:32 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 3 Nov 2021 20:25:37 +0000 (13:25 -0700)
commit833907876be55205d0ec153dcd819c014404ee16
tree49685afb5fb776e712a385d376c428ef30c910a7
parent8388092b2551f7ae34dad800ce828779f7c948c9
libbpf: Detect corrupted ELF symbols section

Prevent divide-by-zero if ELF is corrupted and has zero sh_entsize.
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-2-andrii@kernel.org
tools/lib/bpf/libbpf.c