Re: [PATCH] libdwfl: fix DEREF_OF_NULL.EX in dwfl_segment_report_module.c

2025-02-03 Thread Mark Wielaard
Hi Anton, On Sat, Feb 01, 2025 at 02:10:03AM +0300, Anton Moryakov wrote: > Report of the static analyzer: > After having been assigned to a NULL value at > dwfl_segment_report_module.c:187, pointer 'retval' is > dereferenced at dwfl_segment_report_module.c:195 by > calling function 'strcmp'. (CWE

Re: [PATCH 2/5] libdwfl/offline.c: Avoid closing invalid fd

2025-02-03 Thread Mark Wielaard
Hi Aaron, On Thu, Jan 30, 2025 at 09:35:51PM -0500, Aaron Merey wrote: > process_archive may be called with an fd argument of -1, which > libelf interprets as "no file opened". However when closing > the fd process_archive does not check whether the fd is valid > and may attempt to close an fd of

Re: [PATCH 5/5] tests: Avoid leaking file descriptors

2025-02-03 Thread Mark Wielaard
Hi Aaron, On Thu, Jan 30, 2025 at 09:35:54PM -0500, Aaron Merey wrote: > Add calls to close for all test programs that leak file descriptors > in order to prevent test failures when run under valgrind > --track-fds=yes. These all look correct to me. Could you commit this before enabling valgrind

Re: [PATCH] src: fix DEREF_AFTER_NULL.EX in elflint.c

2025-02-03 Thread Mark Wielaard
Hi Anton, On Sat, Feb 01, 2025 at 01:43:44AM +0300, Anton Moryakov wrote: > Report of the static analyzer: > After having been compared to a NULL value at > elflint.c:252, pointer 'suffix' is dereferenced at elflint.c:260 > by calling function 'stpcpy' > > Corrections explained: > When processing

[Bug debuginfod/32629] add setter functions to debuginfod_client object as alternative to getenv/setenv

2025-02-03 Thread mark at klomp dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=32629 --- Comment #3 from Mark Wielaard --- Aha, I see what you mean. I assumed this was just for DEBUGINFOD_URLS. But there are some others that don't have setter functions atm. DEBUGINFOD_CACHE_PATH, DEBUGINFOD_TIMEOUT, DEBUGINFOD_PROGRESS, DEBUG

Re: [PATCH 10/10 v5] Add tests/run-eu-search-die.sh

2025-02-03 Thread Mark Wielaard
On Fri, Jan 31, 2025 at 07:50:16PM -0500, Aaron Merey wrote: > * tests/.gitignore: Add eu_search_die. > * tests/Makefile.am: Add eu_search_die, run-eu-search-die.sh. > * tests/eu_search_die.c: New file. > * tests/run-eu-search-die.sh: New file. > > Signed-off-by: Heather S.

Re: [PATCH 07/10 v5] Add tests/run-eu-search-cfi.sh

2025-02-03 Thread Mark Wielaard
[Now added elfutils-devel@ to CC, which was the problem noted below.] Hi Aaron, For some reason I only received patches 07 to 10 in this series. And I don't see any of them on the mailinglist. Did something went wrong somewhere? The list is on CC. On Fri, Jan 31, 2025 at 07:50:13PM -0500, Aaron

Re: [PATCH 08/10 v5] Add tests/run-eu-search-macros.sh

2025-02-03 Thread Mark Wielaard
[Adding elfutils-devel@ to CC.] Hi Aaron, On Fri, Jan 31, 2025 at 07:50:14PM -0500, Aaron Merey wrote: > * tests/.gitignore: Add eu_search_macros.sh > * tests/Makefile.am: Add eu_search_macros, > run-eu-search-macros.sh. > * tests/eu_search_macros.c: New file. > * te

Re: [PATCH 4/5] tests/test-elf_cntl_gelf_getshdr.c: Close fd unconditionally

2025-02-03 Thread Mark Wielaard
Hi Aaron, On Thu, Jan 30, 2025 at 09:35:53PM -0500, Aaron Merey wrote: > test-elf_cntl_gelf_getshdr conditionally closes a file descriptor > depending on a command line argument. This causes an error when run > under valgrind --track-fds=yes. > > Fix this by unconditionally closing the fd. I thi

[Bug debuginfod/32629] add setter functions to debuginfod_client object as alternative to getenv/setenv

2025-02-03 Thread mark at klomp dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=32629 Mark Wielaard changed: What|Removed |Added CC||mark at klomp dot org --- Comment #1

Re: [PATCH] libelf: fix DEREF_OF_NULL.RET in objdump.c

2025-02-03 Thread Mark Wielaard
Hi Anton, On Sat, Feb 01, 2025 at 02:21:24AM +0300, Anton Moryakov wrote: > Report of the static analyzer: > Pointer, returned from function 'elf_getarhdr' at > objdump.c:314, may be NULL and is dereferenced at > objdump.c:317. (CWE476, CWE690) Nice catch. > Corrections explained: > When process

Re: [PATCH 09/10 v5] Add tests/run-eu-search-lines.sh

2025-02-03 Thread Mark Wielaard
Hi Aaron, Found the issue with the patches not showing up on the list. They were sent to elfutils-patches@ which doesn't exists... Add elfutils-devel to the CC now. On Fri, Jan 31, 2025 at 07:50:15PM -0500, Aaron Merey wrote: > * tests/.gitignore: Add eu_search-lines. > * tests/Makefi

Re: [PATCH 3/5] tests/backtrace-subr.sh: Avoid valgrind track-fds in check_native_core

2025-02-03 Thread Mark Wielaard
Hi Aaron, On Thu, Jan 30, 2025 at 09:35:52PM -0500, Aaron Merey wrote: > valgrind --track-fds=yes might incorrectly report an error due to the use > of inherited file descriptors in check_native_core. Note that this fixed upstream by commit 9f0e4107c140b47ea2a9c097afcac73a8454e17f https://bugs.kd

[Bug debuginfod/32629] add setter functions to debuginfod_client object as alternative to getenv/setenv

2025-02-03 Thread fche at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32629 --- Comment #2 from Frank Ch. Eigler --- The _begin function is already a constructor, :-) it just doesn't take such parameters. There are other env vars that we take as inputs too, and it would be odd to take just one as a function parameter

Re: [PATCH 1/5] tests/Makefile.am: Add --track-fds=yes to valgrind_cmd

2025-02-03 Thread Mark Wielaard
Hi Aaron, On Thu, Jan 30, 2025 at 09:35:50PM -0500, Aaron Merey wrote: > `valgrind --track-fds=yes` will report errors for file descriptor leaks > and attempts at closing invalid file descriptors. This looks good to me, but could we apply the patches in "reverse" order so we don't get test failur

Re: [PATCH] libdw: fix DEREF_AFTER_NULL.EX in dwarf_ranges.c

2025-02-03 Thread Mark Wielaard
Hi Anton, On Sat, Feb 01, 2025 at 01:56:34AM +0300, Anton Moryakov wrote: > Report of the static analyzer: > After having been compared to a NULL value at > dwarf_ranges.c:492, pointer 'd' is dereferenced at > dwarf_ranges.c:531. (CWE476) But there is a lot of code between those points. On line