This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] libelf: Only memcpy ehdr back when not already directly mmapped.


On Fri, 2013-11-08 at 19:28 +0100, Mark Wielaard wrote:
> When the elf file is mmapped ehdr can still point to ehdr_mem if the
> address is unaligned.  In such cases we do need to memcpy the ehdr back
> to the file. We shouldn't when ehdr already comes directly from the mmapped
> file, because that would cause an memcpy call with overlapping addresses
> (ehdr being copied directly over itself).

> +2013-11-08  Mark Wielaard  <mjw@redhat.com>
> +
> +	* elf32_updatefile.c (elfXX_updatemmap): Only memcpy ehdr when not
> +	already directly mmapped.

I pushed this to master.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]