Incorrect ELF might have PT_NOTE slightly larger than the needed to contain all notes, and the PT_NOTE size could be larger than one page. Then rtld mmaps just the notes bytes to parse. After the last note, we iterate past the mapped region trying to read the Elf_Note header. This was found in wild. Require full Elf_Note to fit into the [start_note, end_note) region to continue the parsing.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Comment Actions
I can confirm that this patch fixes the problem for me. Tested on stable/15-n285266-30211e66b989
| libexec/rtld-elf/rtld.c | ||
|---|---|---|
| 1792 | I personally find if statements that omit one of the components a bit confusing. No worries if you prefer it as is.. | |