This is the mail archive of the
mailing list for the elfutils project.
Re: [PATCH 2/2] libdwfl: elf_from_remote_memory only trust shdrs of last file-only segment.
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Sun, 16 Mar 2014 17:48:46 +0100
- Subject: Re: [PATCH 2/2] libdwfl: elf_from_remote_memory only trust shdrs of last file-only segment.
On Wed, 12 Mar 2014 11:46:29 +0100, Mark Wielaard wrote:
> The test whether the shdrs are included in the mapped in segments is
> contents_size >= shdrs_end. And contents_size depends on segments_end
> (the last actual mapped file contents of the segment). segments_end is
> rounded up based on the page_size. The segments_end == segments_end_mem
> check sees whether this rounding up can be trusted to actually contain
> the file contents, or that the extra space will be used for something
> else. It is no accident that catches the issue in this case. That was
> the intent.
I was reading it more carefully now, originally I got confused by the last
chunk so I did not realize the rest of the patch is right, discussed in:
> > * or just all non-writable PT_LOAD segments
> This would be a nice one. But interesting sections like .dynamic (and
> sometimes .dynsym and .dynstr) are not in read-only segments,
OK, I agree.