[PATCH] Recognize and parse GNU Property notes.

2018-10-19 Thread Mark Wielaard
GNU Property notes are different from normal notes because they use variable alignment/padding of their fields. They are 8 byte aligned, but use 4 byte fields. The name is aligned at 4 bytes and padded so that, the desc is aligned at 8 bytes. The whole note is padded to 8 bytes again. For normal no

[PATCH] Check sh_entsize is not zero.

2018-10-19 Thread Mark Wielaard
There were some recent bug reports where we trusted the ELF section header to be sane and divided the sh_size by the sh_entsize to get the number of objects in the section. This would cause a divide by zero if the file was corrupt and the sh_entsize was zero. Add checks for any such code. Signed-o

Re: [PATCH] strip, unstrip: Handle SHT_GROUP correctly.

2018-10-19 Thread Mark Wielaard
After a bit more testing found one other issue. It can happen that the section indexes in the group need to be renumbered when eu-unstrip puts the stripped and debug file together again. So we need to explicitly do that.commit eee4269e53154daaf0251371aacd91ec5db3eb30 Author: Mark Wielaard Date:

Re: [PATCH] readelf: Handle multiple .debug_macro sections and decode header flag.

2018-10-19 Thread Mark Wielaard
On Sat, 2018-10-13 at 15:17 +0200, Mark Wielaard wrote: > In object files there could be multiple .debug_macro sections. > These are COMDAT sections used as imports. Note that the output for > DW_MACRO_import isn't ideal since the offset is printed against the > start of the .debug_macro section, b

Re: [PATCH] libdwfl: Sanity check partial core file data reads.

2018-10-19 Thread Mark Wielaard
On Sun, 2018-10-14 at 16:48 +0200, Mark Wielaard wrote: > There were two issues when reading note data from a core file. > We didn't check if the data we already had in a buffer was big > enough. And if we did get the data, we should check if we got > everything, or just a part of the data. Pushed

[Bug libdw/23752] Invalid Address Read problem in dwfl_segment_report_module.c when executing ./eu-stack --core=$POC

2018-10-19 Thread mark at klomp dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=23752 Mark Wielaard changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|---

Re: [PATCH] findtextrel: Check that sh_entsize isn't zero.

2018-10-19 Thread Mark Wielaard
On Sun, 2018-10-14 at 16:59 +0200, Mark Wielaard wrote: > A bogus ELF file could have sh_entsize as zero. Don't divide by zero, > but just assume there are no entries in the section. Pushed to master.

Re: [PATCH] ar: Assume epoch if ar_date is bogus.

2018-10-19 Thread Mark Wielaard
On Sun, 2018-10-14 at 17:31 +0200, Mark Wielaard wrote: > If the ar header contains a bogus ar_date then in verbose mode we > would > get a NULL pointer from localtime. Just assume the entry was created > during the epoch. Pushed to master.

[Bug tools/23755] Multiple floating point exception in findtextrel.c in eu-findtextrel biniary of elfutils-v.0174.

2018-10-19 Thread mark at klomp dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=23755 Mark Wielaard changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|---

[Bug tools/23754] NULL-Pointer dereference problem in function do_oper_extract in the eu-ar binaries

2018-10-19 Thread mark at klomp dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=23754 Mark Wielaard changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|---

Re: [PATCH] readelf: Make sure readp is smaller than cieend in print_debug_frame_section.

2018-10-19 Thread Mark Wielaard
On Tue, 2018-10-16 at 14:22 +0200, Mark Wielaard wrote: > We could end up with a negative length in a call to memchr. Pushed to master.

[Bug libdw/23782] Negative-size-param in call to in memchr from readelf print_debug_frame_section

2018-10-19 Thread mark at klomp dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=23782 Mark Wielaard changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|---

Re: [PATCH] arlib: Check that sh_entsize isn't zero.

2018-10-19 Thread Mark Wielaard
On Thu, 2018-10-18 at 19:02 +0200, Mark Wielaard wrote: > A bogus ELF file could have sh_entsize as zero. Don't divide by zero, > but just assume there are no symbols in the section. Pushed to master.

[Bug general/23786] Divide-by-zero Problem in function arlib_add_symbols() in arlib.c in elfutils-0.174

2018-10-19 Thread mark at klomp dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=23786 Mark Wielaard changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|---

[Bug libelf/23787] eu-size: Bad handling of ar files inside are files

2018-10-19 Thread mark at klomp dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=23787 Mark Wielaard changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|---

Re: [PATCH] size: Handle recursive ELF ar files.

2018-10-19 Thread Mark Wielaard
On Fri, 2018-10-19 at 01:02 +0200, Mark Wielaard wrote: > eu-size didn't handle an ELF ar file that contained an ar file itself > correctly. handle_ar would recursively call itself but close the ELF > file before returning. Only close the ELF file at the top-level. Pushed to master.

Re: [PATCH] Check sh_entsize is not zero.

2018-10-19 Thread Mark Wielaard
On Fri, 2018-10-19 at 15:03 +0200, Mark Wielaard wrote: > There were some recent bug reports where we trusted the ELF section > header > to be sane and divided the sh_size by the sh_entsize to get the > number of > objects in the section. This would cause a divide by zero if the file > was > corrup