[PATCH 1/2] libdwfl: specify optional sysroot to search for shared libraries and binaries

2024-07-01 Thread Michal Sekletar
From: Luke Diamand When searching the list of modules in a core file, if the core was generated on a different system to the current one, we need to look in a sysroot for the various shared objects. For example, we might be looking at a core file from an ARM system using elfutils running on an x

[PATCH 2/2] eu-stack: add support for sysroot option

2024-07-01 Thread Michal Sekletar
From: Luke Diamand Use the dwfl_set_sysroot() function to set the sysroot to be used when analysing a core: e.g. $ eu-stack --core core --sysroot /path/to/sysroot -e crashing_prog Signed-off-by: Luke Diamand Signed-off-by: Michal Sekletar --- src/stack.c | 9 + 1 file changed, 9 i

Re: [PATCH 1/2] libdwfl: specify optional sysroot to search for shared libraries and binaries

2024-07-01 Thread Frank Ch. Eigler
Hi - > [...] For example, we might be looking at a core file from an ARM > system using elfutils running on an x86 host. [...] Makes sense. By the way, to what extent would debuginfod (serving files from that sysroot) work for this same use case? - FChE

[PATCH] Fix deref-of-null in handle_file_note()

2024-07-01 Thread Maks Mishin
After having been assigned to a NULL value at dwfl_segment_report_module.c:200, pointer 'retval' is dereferenced at dwfl_segment_report_module.c:208 by calling function 'strcmp'. Found by RASU JSC. Signed-off-by: Maks Mishin --- libdwfl/dwfl_segment_report_module.c | 3 ++- 1 file changed, 2 i

[PATCH] size: Fix deref-of-null in handle_ar() function

2024-07-01 Thread Maks Mishin
Pointer, returned from function 'elf_getarhdr' at size.c:362, may be NULL and is dereferenced at size.c:367. Signed-off-by: Maks Mishin --- src/size.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/src/size.c b/src/size.c index ff8ca075..d6bce203 100644 --- a/src/size.c +++ b/sr

[PATCH] unstrip: Fix deref-of-null in copy_elided_sections()

2024-07-01 Thread Maks Mishin
Pointer `symstrdata` is dereferenced at unstrip.c:1977 without checking for NULL. Signed-off-by: Maks Mishin --- src/unstrip.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/unstrip.c b/src/unstrip.c index d70053de..87bd12de 100644 --- a/src/unstrip.c +++ b/src/unst

Re: [PATCH] size: Fix deref-of-null in handle_ar() function

2024-07-01 Thread Sam James
Maks Mishin writes: > Pointer, returned from function 'elf_getarhdr' at size.c:362, > may be NULL and is dereferenced at size.c:367. > Your other patch has "Found by RASU JSC." but the rest don't. Are they all found by it? If so, please say that. (Also, consider sending the fixes as a series if

[PATCH] readelf: Fix memory leak in print_hash_info()

2024-07-01 Thread Maks Mishin
Signed-off-by: Maks Mishin --- src/readelf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/readelf.c b/src/readelf.c index c945b371..48035264 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -3597,6 +3597,7 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr, size_t shstrndx,

[PATCH] sparc_attrs: Fix string overflow

2024-07-01 Thread Maks Mishin
A string is copied into the buffer 's' of size 577 without checking its length first at sparc_attrs.c:95. Found by RASU JSC. Signed-off-by: Maks Mishin --- backends/sparc_attrs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backends/sparc_attrs.c b/backends/sparc_attrs.c index 974e8fb