diff options
| author | Ihor Solodrai <ihor.solodrai@linux.dev> | 2025-04-10 11:28:23 -0700 |
|---|---|---|
| committer | Andrii Nakryiko <andrii@kernel.org> | 2025-04-15 15:18:55 -0700 |
| commit | 8582d9ab3efdebb88e0cd8beed8e0b9de76443e7 (patch) | |
| tree | c44084c599af3f4a9474658b418951506c2e6a4a /tools/testing/selftests/bpf/prog_tests/prog_array_init.c | |
| parent | libbpf: Fix buffer overflow in bpf_object__init_prog (diff) | |
| download | linux-8582d9ab3efdebb88e0cd8beed8e0b9de76443e7.tar.gz linux-8582d9ab3efdebb88e0cd8beed8e0b9de76443e7.zip | |
libbpf: Verify section type in btf_find_elf_sections
A valid ELF file may contain a SHT_NOBITS .BTF section. This case is
not handled correctly in btf_parse_elf, which leads to a segfault.
Before attempting to load BTF section data, check that the section
type is SHT_PROGBITS, which is the expected type for BTF data. Fail
with an error if the type is different.
Bug report: https://github.com/libbpf/libbpf/issues/894
v1: https://lore.kernel.org/bpf/20250408184104.3962949-1-ihor.solodrai@linux.dev/
Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20250410182823.1591681-1-ihor.solodrai@linux.dev
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/prog_array_init.c')
0 files changed, 0 insertions, 0 deletions
