This is the mail archive of the 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:
> 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 <>
> Signed-off-by: Mark Wielaard <>
> --- a/libelf/ChangeLog
> +++ b/libelf/ChangeLog
> @@ -1,3 +1,8 @@
> +2015-01-03  Mark Wielaard  <>
> +
> +	* 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.



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