Commit f767593
committed
libbpf: Verify section type in btf_find_elf_sections
JIRA: https://issues.redhat.com/browse/RHEL-110274
commit 8582d9a
Author: Ihor Solodrai <[email protected]>
Date: Thu Apr 10 11:28:23 2025 -0700
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: libbpf/libbpf#894
v1: https://lore.kernel.org/bpf/[email protected]/
Signed-off-by: Ihor Solodrai <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Signed-off-by: Viktor Malik <[email protected]>1 parent 35af19e commit f767593
1 file changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1147 | 1147 | | |
1148 | 1148 | | |
1149 | 1149 | | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
1150 | 1156 | | |
1151 | 1157 | | |
1152 | 1158 | | |
| |||
0 commit comments