Re: [PATCH] libdwfl: Read no more than required to parse dynamic sections

2022-12-13 Thread Mark Wielaard
Hi Gavin, On Thu, 2022-12-01 at 13:13 -0800, Gavin Li wrote: > Awesome, thanks for looking over this. I only have one comment: > there's an extra "xlatefrom.d_size = xlatefrom.d_size;" line that > should be removed. Thanks for spotting that. Odd the compiler didn't warn for that. There is a xlate

Re: [PATCH] libdwfl: Read no more than required to parse dynamic sections

2022-12-01 Thread Gavin Li
Awesome, thanks for looking over this. I only have one comment: there's an extra "xlatefrom.d_size = xlatefrom.d_size;" line that should be removed. dwfl_elf_phdr_memory_callback is called from dwfl_link_map_report but if any issues arise, those could be addressed in a separate patch. Best, Gavin

Re: [PATCH] libdwfl: Read no more than required to parse dynamic sections

2022-11-30 Thread Mark Wielaard
Hi Gavin, On Tue, Nov 29, 2022 at 01:48:42PM -0800, Gavin Li wrote: > I think for the purposes of reading small segments (like PT_DYNAMIC > and PT_NOTE), we should ignore *buffer_available altogether. Thanks for walking me through the code. I think you are right and none of the buffer_available c

Re: [PATCH] libdwfl: Read no more than required to parse dynamic sections

2022-11-29 Thread Gavin Li
Hi Mark, Thanks for looking over this patch. Responses are inline. > The code as written doesn't seem to guarantee that > dwfl_segment_report_module will always be called with > dwfl_elf_phdr_memory_callback as memory_callback. Although it probably > will be in practice. All file/line references

Re: [PATCH] libdwfl: Read no more than required to parse dynamic sections

2022-11-29 Thread Mark Wielaard
Hi Gavin, On Mon, 2022-11-28 at 22:26 -0800, ga...@matician.com wrote: > Since size checking has been moved to > dwfl_elf_phdr_memory_callback(), > there is no longer a need for dwfl_segment_report_module() to enforce > the same. Reading beyond the end of the dynamic section actually causes > issu