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: Make gelf_getphdr more robust?


On Fri, 2014-02-07 at 14:28 +0100, Mark Wielaard wrote:
> Could you test against current git with the attached patch? Or could you
> give me access to your crafted ELF file?

Florian sent me the ELF file off-list to check the patch resolves the
issue of printing corrupted interpreter strings. It does. I am pushing
this patch to master.

Thanks,

Mark

Check phdr->p_filesz and make sure interpreter string is zero terminated
before calling printf.

Reported-by: Florian Weimer <fweimer@redhat.com>
Signed-off-by: Mark Wielaard <mjw@redhat.com>

+2014-02-07  Mark Wielaard  <mjw@redhat.com>
+
+       * readelf.c (print_phdr): Check phdr->p_filesz and make sure
+       interpreter string is zero terminated before calling printf.


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