]> git.ipfire.org Git - thirdparty/elfutils.git/commit
libelf: Add n_namesz offset overflow check to gelf_get_note.
authorMark Wielaard <mark@klomp.org>
Wed, 1 May 2019 13:52:24 +0000 (15:52 +0200)
committerMark Wielaard <mark@klomp.org>
Sat, 4 May 2019 19:31:08 +0000 (21:31 +0200)
commit4628b0ea03a0d029cccbcda1cbfc450b4c5ad1bf
tree4572cae7f6625262b4c01d5f7811657b3c8cb3cc
parent1d8f5d30a92285fd4e7895a1d00587ac487412e3
libelf: Add n_namesz offset overflow check to gelf_get_note.

During fuzzing of the new xlate_notes testcase I noticed that
gelf_get_note didn't check whether the n_namesz of a note was
too big. This could lead to offset wrapping around. Causing an
infinite loop going over all ELF notes. Fix by adding an overflow
check before updating offset.

Signed-off-by: Mark Wielaard <mark@klomp.org>
libelf/ChangeLog
libelf/gelf_getnote.c