Closed philipderrin closed 5 years ago
Commit 9152ea98ac48 introduced a generic sel4utils_elf_get_section() function and made sel4utils_elf_get_vsyscall() a wrapper for it.
sel4utils_elf_get_section()
sel4utils_elf_get_vsyscall()
Prior to this commit, the result of elf_getSectionNamed() was compared to NULL before it was dereferenced:
elf_getSectionNamed()
https://github.com/seL4/seL4_libs/blob/2ac35765e9aa0e6b38ed7eb0189164b23224ed77/libsel4utils/src/elf.c#L294
After the change, the pointer is dereferenced regardless of whether it is NULL, leading to a crash if the section is not present:
https://github.com/seL4/seL4_libs/blob/9152ea98ac4891733a29def494681f23b77f4612/libsel4utils/src/elf.c#L286
Thanks for reporting this! I'll close this issue when it is fixed.
Commit 9152ea98ac48 introduced a generic
sel4utils_elf_get_section()
function and madesel4utils_elf_get_vsyscall()
a wrapper for it.Prior to this commit, the result of
elf_getSectionNamed()
was compared to NULL before it was dereferenced:https://github.com/seL4/seL4_libs/blob/2ac35765e9aa0e6b38ed7eb0189164b23224ed77/libsel4utils/src/elf.c#L294
After the change, the pointer is dereferenced regardless of whether it is NULL, leading to a crash if the section is not present:
https://github.com/seL4/seL4_libs/blob/9152ea98ac4891733a29def494681f23b77f4612/libsel4utils/src/elf.c#L286