[PATCH] libelf: Only set shdr state when there is at least one shdr

2021-12-19 Thread Mark Wielaard
The elf shdr state only needs to be set when scncnt is at least one. Otherwise e_shoff can be bogus. Also use unsigned arithmetic for checking e_shoff alignment. Signed-off-by: Mark Wielaard --- libelf/ChangeLog | 5 + libelf/elf_begin.c | 16 ++-- 2 files changed, 15 insertio

[PATCH] tests: integrate fuzz-dwfl-core into the test suite

2021-12-19 Thread Evgeny Vereshchagin via Elfutils-devel
[v2] 1) At https://sourceware.org/pipermail/elfutils-devel/2021q4/004541.html it was pointed out that build-fuzzers.sh is too tied to OSS-Fuzz and while it was kind of decoupled from it as much as possible in the sense that it was enough to install clang and run the script to build the fuzz target

[PATCH] libdwfl: Make sure that ph_buffer_size has room for at least one phdr

2021-12-19 Thread Mark Wielaard
dwfl_segment_report_module might otherwise try to handle half a phdr taking the other half from after the buffer. Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog| 5 + libdwfl/dwfl_segment_report_module.c | 7 ++- 2 files changed, 11 insertions(+), 1 deletion(-) d

[PATCH] libdwfl: Make sure dyn_filesz has a sane size

2021-12-19 Thread Mark Wielaard
In dwfl_segment_report_module dyn_filesz should be able to hold at least one Elf_Dyn element, and not be larger than possible. Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog| 6 ++ libdwfl/dwfl_segment_report_module.c | 3 +++ 2 files changed, 9 insertions(+) diff --

[PATCH] libdwfl: Rewrite GElf_Nhdr reading in dwfl_segment_report_module

2021-12-19 Thread Mark Wielaard
Make sure that the notes filesz is not too big. Rewrite reading of the notes to check for overflow at every step. Also limit the size of the buildid bytes. Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog| 5 ++ libdwfl/dwfl_segment_report_module.c | 79 ---

[Bug libdw/28715] New: There seems to be an infinite loop in dwfl_segment_report_module

2021-12-19 Thread evvers at ya dot ru via Elfutils-devel
https://sourceware.org/bugzilla/show_bug.cgi?id=28715 Bug ID: 28715 Summary: There seems to be an infinite loop in dwfl_segment_report_module Product: elfutils Version: unspecified Status: UNCONFIRMED Severity:

[Bug debuginfod/28708] run-debuginfod-webapi-concurrency.sh seems to be flaky

2021-12-19 Thread evvers at ya dot ru via Elfutils-devel
https://sourceware.org/bugzilla/show_bug.cgi?id=28708 --- Comment #7 from Evgeny Vereshchagin --- > Note that packit doesn't use real hardware for various architectures but > "container emulation" which causes various testcases to fail. > I think I ran into issues like that in https://github.co

[Bug debuginfod/28708] run-debuginfod-webapi-concurrency.sh seems to be flaky

2021-12-19 Thread fche at redhat dot com via Elfutils-devel
https://sourceware.org/bugzilla/show_bug.cgi?id=28708 --- Comment #8 from Frank Ch. Eigler --- This test creates up to 100+few threads in debuginfod, and also 100 concurrent curl processes to talk to debuginfod. -- You are receiving this mail because: You are on the CC list for the bug.

[PATCH] libdwfl: Handle unaligned Ehdr in dwfl_segment_report_module

2021-12-19 Thread Mark Wielaard
The xlate functions only handle correctly aligned buffers. But they do handle src == dest. So if the source buffer isn't aligned correctly just copy it first into the destination (which is already correctly aligned). Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog| 5

[PATCH] libdwfl: Handle unaligned Phdr in dwfl_segment_report_module

2021-12-19 Thread Mark Wielaard
The xlate functions only handle correctly aligned buffers. But they do handle src == dest. So if the source buffer isn't aligned correctly just copy it first into the destination (which is already correctly aligned). Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog| 6

[Bug libelf/28685] UBSan: member access within misaligned address 0x7ff316818032 for type 'struct Elf32_Phdr'

2021-12-19 Thread mark at klomp dot org via Elfutils-devel
https://sourceware.org/bugzilla/show_bug.cgi?id=28685 --- Comment #3 from Mark Wielaard --- (In reply to Evgeny Vereshchagin from comment #2) > If callers are > expected to pass correctly aligned buffers it seems > dwfl_segment_report_module should be fixed. But it seems that callers can > someti

[Bug libdw/28710] ERROR: AddressSanitizer: SEGV on unknown address (on i386)

2021-12-19 Thread mark at klomp dot org via Elfutils-devel
https://sourceware.org/bugzilla/show_bug.cgi?id=28710 Mark Wielaard changed: What|Removed |Added CC||mark at klomp dot org --- Comment #1

[PATCH] libdwfl: Handle unaligned Phdr in dwfl_segment_report_module

2021-12-19 Thread Mark Wielaard
The xlate functions only handle correctly aligned buffers. But they do handle src == dest. So if the source buffer isn't aligned correctly just copy it first into the destination (which is already correctly aligned). Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog| 5

[Bug libdw/28715] There seems to be an infinite loop in dwfl_segment_report_module

2021-12-19 Thread mark at klomp dot org via Elfutils-devel
https://sourceware.org/bugzilla/show_bug.cgi?id=28715 Mark Wielaard changed: What|Removed |Added Assignee|unassigned at sourceware dot org |mark at klomp dot org

[Bug libdw/28715] There seems to be an infinite loop in dwfl_segment_report_module

2021-12-19 Thread evvers at ya dot ru via Elfutils-devel
https://sourceware.org/bugzilla/show_bug.cgi?id=28715 --- Comment #2 from Evgeny Vereshchagin --- (In reply to Mark Wielaard from comment #1) > I couldn't replicate the infinite loop, which I assume has been fixed by: > https://sourceware.org/pipermail/elfutils-devel/2021q4/004557.html > > But I