[PATCH] elflint: Add various low-level checks.
Mark Wielaard
mjw at redhat.com
Fri Jan 2 23:37:11 UTC 2015
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 at mccme.ru>
> Signed-off-by: Mark Wielaard <mjw at 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
More information about the elfutils-devel
mailing list