]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - binutils/readelf.c
PR22303, print_core_note out of bounds read
authorAlan Modra <amodra@gmail.com>
Wed, 18 Oct 2017 01:35:39 +0000 (12:05 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 18 Oct 2017 02:20:45 +0000 (12:50 +1030)
commit5396a86e439653fb5cd714b955708250777a32e5
tree9dea822354c79ab221d79573a7269553ffe8b4d2
parentb7213666d6035713c3a2786ee418085e07cb3cca
PR22303, print_core_note out of bounds read

The print_core_note change here fixes the PR, the rest is making
readelf a little more bombproof against maliciously crafted binaries.

PR 22303
* readelf.c (print_core_note): Ensure "count" sanity check
calculation doesn't overflow.
(process_notes_at): Perform note namesz and descsz checks
using unsigned comparisons against data remaining.  Catch
alignment overflow of namesz and descsz too.  Don't allocate a
temp for terminating "name" when there is space available
before descdata.
binutils/ChangeLog
binutils/readelf.c