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] elflint: Add various low-level checks.


On Wed, Dec 31, 2014 at 01:02:37AM +0100, Mark Wielaard wrote:
> elflint could crash or hang because it didn't check some low level issues.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1170810
> 
> Reported-by: Alexander Cherepanov <cherepan@mccme.ru>
> Signed-off-by: Mark Wielaard <mjw@redhat.com>
> [...]
> @@ -2033,7 +2051,7 @@ section [%2d] '%s': hash table section is too small (is %ld, expected %ld)\n"),
>  
>    size_t maxidx = nchain;
>  
> -  if (symshdr != NULL)
> +  if (symshdr != NULL && shdr->sh_entsize != 0)
>      {
>        size_t symsize = symshdr->sh_size / symshdr->sh_entsize;
>  

After 2.5 days afl-fuzz found this typo. The check is against the wrong
shdr, should be symshdr.

Patch fixed on mjw/pending branch.

Cheers,

Mark

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