This is the mail archive of the
mailing list for the elfutils project.
Re: [PATCH] readelf: Always print INVALID SECTION if destshdr is NULL for relocation
- From: Mark Wielaard <mjw at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Thu, 04 Dec 2014 14:44:29 +0100
- Subject: Re: [PATCH] readelf: Always print INVALID SECTION if destshdr is NULL for relocation
On Sat, 2014-11-29 at 15:03 +0100, Mark Wielaard wrote:
> On Fri, Nov 28, 2014 at 10:24:46PM +0100, Mark Wielaard wrote:
> > We already checked this in all other cases except for the special case
> > of relocs in statically_linked executables. Found with afl.
> Sorry, this patch is bogus. It works around the actual cause.
> The destshdr should not be NULL to begin with. We actually check that
> before processing the relocations. But when we see a STT_SECTION symbol
> relocation we reuse destshdr to lookup that section. The correct fix is
> to not trash destshdr in that case. Which the attached patch does.
> +2014-11-28 Mark Wielaard <firstname.lastname@example.org>
> + * readelf.c (handle_relocs_rel): Don't reuse destshdr to store
> + section header of a relocation against a STT_SECTION symbol. Use
> + a new local variable secshdr.
> + (handle_relocs_rela): Likewise.
I pushed this fixed version of the fix to master now.