This is the mail archive of the
mailing list for the elfutils project.
Re: [PATCH] libelf: Only memcpy ehdr back when not already directly mmapped.
- From: Mark Wielaard <mjw at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Mon, 11 Nov 2013 15:09:29 +0100
- Subject: 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 <firstname.lastname@example.org>
> + * elf32_updatefile.c (elfXX_updatemmap): Only memcpy ehdr when not
> + already directly mmapped.
I pushed this to master.