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: Make sure version xlate dest buffer is fully defined.


On Sat, 2015-01-03 at 23:02 +0100, Mark Wielaard wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=1170810#c16
> contains an example of usage of undefined memory when version section
> data needs to be translated, but the version xlate functions detect they
> cannot fully transform the section data. To make sure the dest buffer
> data is completely defined this patch makes sure all data is moved
> from src to dest first. This is somewhat inefficient since normally
> all data will be fully converted. But the translation functions have
> no way to indicate only partial data was converted.
> 
> Reported-by: Alexander Cherepanov <cherepan@mccme.ru>
> Signed-off-by: Mark Wielaard <mjw@redhat.com>
>
> --- a/libelf/ChangeLog
> +++ b/libelf/ChangeLog
> @@ -1,3 +1,8 @@
> +2015-01-03  Mark Wielaard  <mjw@redhat.com>
> +
> +	* version_xlate.h (elf_cvt_Verdef): Use memmove to copy src to dest.
> +	(elf_cvt_Verneed): Likewise.

I have finally pushed this to master.
I don't particularly like this solution. But the extra work is only done
when doing conversion of version data representation of the ELF file on
disk is different from the native data representation in memory.

Cheers,

Mark

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