]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
readelf: segfaults fuzzing multiple object files
authorAlan Modra <amodra@gmail.com>
Mon, 20 Apr 2020 00:24:46 +0000 (09:54 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 20 Apr 2020 01:39:43 +0000 (11:09 +0930)
commit8ff66993e0b57b20067d7a1b6c72a72f4cada2cf
tree5009a15d97f28daa49f1eabc21645167c7308531
parent58ee9a8a46b632ada94ae057acc23ba3928afa66
readelf: segfaults fuzzing multiple object files

This patch is aimed at fixing a number of oss-fuzz segfaults that
don't reproduce reliably with their current infrastructure, the
problem being that one invocation of readelf is effectively being run
on multiple object files.  I believe that these segfaults could be
reliably reproduced with just two fuzzed objects being presented to
readelf, but those inputs are currently not identified by oss-fuzz.
So there is some guesswork involved in this patch.  The idea here is
to clear stashed data such as symtab_shndx_list that is processed
using section header info, at the same time that header info is
cleared.

* readelf.c (process_section_headers): Free dynamic symbols etc.
earlier.
binutils/ChangeLog
binutils/readelf.c