- Upgrade to upstream elfutils 0.193
- Drop upstreamed patches
  elfutils-0.192-fix-configure-conditional.patch
  elfutils-0.192-fix-free.patch
  elfutils-0.192-libelf-static.patch
  elfutils-0.192-stacktrace-lto.patch

Resolves: RHEL-86966
This commit is contained in:
Aaron Merey 2025-04-30 09:20:08 -04:00
parent 1ae8bf6dae
commit 36da921ea6
7 changed files with 13 additions and 150 deletions

1
.gitignore vendored
View File

@ -33,3 +33,4 @@
/elfutils-0.190.tar.bz2 /elfutils-0.190.tar.bz2
/elfutils-0.191.tar.bz2 /elfutils-0.191.tar.bz2
/elfutils-0.192.tar.bz2 /elfutils-0.192.tar.bz2
/elfutils-0.193.tar.bz2

View File

@ -1,26 +0,0 @@
From fb4753feb0ed7e3387f52b54bb02c6c74aac6a3e Mon Sep 17 00:00:00 2001
From: Aaron Merey <amerey@redhat.com>
Date: Tue, 29 Oct 2024 14:54:10 -0400
Subject: [PATCH] Fix ENABLE_DEBUGINFOD_IMA_VERIFICATION always
evaluating to false
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index f191488..3d2d3ee 100644
--- a/configure.ac
+++ b/configure.ac
@@ -892,7 +892,7 @@ AS_IF([test "x$enable_debuginfod" != "xno"],AC_DEFINE([ENABLE_DEBUGINFOD],[1],[B
AM_CONDITIONAL([DEBUGINFOD],[test "x$enable_debuginfod" = "xyes"])
AS_IF([test "x$enable_debuginfod_ima_verification" = "xyes"],AC_DEFINE([ENABLE_IMA_VERIFICATION],[1],[Build IMA verification]))
AS_IF([test "x$have_libarchive" = "xyes"],AC_DEFINE([HAVE_LIBARCHIVE],[1],[Define to 1 if libarchive is available]))
-AM_CONDITIONAL([ENABLE_IMA_VERIFICATION],[test "$enable_debuginfod_ima_verification" = "xyes"])
+AM_CONDITIONAL([ENABLE_IMA_VERIFICATION],[test "x$enable_debuginfod_ima_verification" = "xyes"])
AM_CONDITIONAL([OLD_LIBMICROHTTPD],[test "x$old_libmicrohttpd" = "xyes"])
dnl for /etc/profile.d/elfutils.{csh,sh}
--
2.47.0

View File

@ -1,38 +0,0 @@
From 1be0787d6654ed71bf659e8bfd34895fea7589eb Mon Sep 17 00:00:00 2001
From: Aaron Merey <amerey@redhat.com>
Date: Fri, 24 Jan 2025 19:43:19 -0500
Subject: [PATCH] debuginfod-client.c: Avoid freeing uninitialized value
debuginfod_validate_imasig might call free on an uninitialized sig_buf
due to a goto that can occur before sig_buf is set to NULL.
Fix this by setting sig_buf to NULL before the goto.
Signed-off-by: Aaron Merey <amerey@redhat.com>
---
debuginfod/debuginfod-client.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c
index deff19ff..d89beae9 100644
--- a/debuginfod/debuginfod-client.c
+++ b/debuginfod/debuginfod-client.c
@@ -1587,6 +1587,7 @@ debuginfod_validate_imasig (debuginfod_client *c, int fd)
{
int rc = ENOSYS;
+ char* sig_buf = NULL;
EVP_MD_CTX *ctx = NULL;
if (!c || !c->winning_headers)
{
@@ -1594,7 +1595,6 @@ debuginfod_validate_imasig (debuginfod_client *c, int fd)
goto exit_validate;
}
// Extract the HEX IMA-signature from the header
- char* sig_buf = NULL;
char* hdr_ima_sig = strcasestr(c->winning_headers, "x-debuginfod-imasignature");
if (!hdr_ima_sig || 1 != sscanf(hdr_ima_sig + strlen("x-debuginfod-imasignature:"), "%ms", &sig_buf))
{
--
2.48.1

View File

@ -1,36 +0,0 @@
From 0a65a54593ae489d40cb993caa74095d45bc47fd Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Tue, 22 Oct 2024 15:03:42 +0200
Subject: [PATCH] libelf: Add libeu objects to libelf.a static archive
libelf might use some symbols from libeu.a, specifically the eu-search
wrappers. But we don't ship libeu.a separately. So include the libeu
objects in the libelf.a archive to facilitate static linking.
* libelf/Makefile.am (libeu_objects): New variable.
(libelf_a_LIBADD): New, add libeu_objects.
https://sourceware.org/bugzilla/show_bug.cgi?id=32293
Signed-off-by: Mark Wielaard <mark@klomp.org>
---
libelf/Makefile.am | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libelf/Makefile.am b/libelf/Makefile.am
index 3402863e..2d3dbdf2 100644
--- a/libelf/Makefile.am
+++ b/libelf/Makefile.am
@@ -122,6 +122,9 @@ libelf.so: $(srcdir)/libelf.map $(libelf_so_LIBS) $(libelf_so_DEPS)
@$(textrel_check)
$(AM_V_at)ln -fs $@ $@.$(VERSION)
+libeu_objects = $(shell $(AR) t ../lib/libeu.a)
+libelf_a_LIBADD = $(addprefix ../lib/,$(libeu_objects))
+
install: install-am libelf.so
$(mkinstalldirs) $(DESTDIR)$(libdir)
$(INSTALL_PROGRAM) libelf.so $(DESTDIR)$(libdir)/libelf-$(PACKAGE_VERSION).so
--
2.47.0

View File

@ -1,35 +0,0 @@
commit 43829fb8780ecbe9d17aaed22d3dfcb806cb5f45
Author: Mark Wielaard <mark@klomp.org>
Date: Thu Oct 24 10:44:25 2024 +0200
stacktrace: Init elf_fd in sysprof_init_dwfl
When building with LTO gcc believes elf_fd can be used uninitialized:
In function sysprof_init_dwfl,
inlined from sysprof_unwind_cb at stacktrace.c:1235:16:
stacktrace.c:1087:7: error: elf_fd may be used uninitialized [-Werror=maybe-uninitialized]
1087 | close (elf_fd);
| ^
This code won't be reached because if find_procfile doesn't initialize
elf_fd, it will return an error. But help the compiler by initializing
elf_fd to -1.
* src/stacktrace.c (sysprof_init_dwfl): Init elf_fd to -1.
Signed-off-by: Mark Wielaard <mark@klomp.org>
diff --git a/src/stacktrace.c b/src/stacktrace.c
index 438cb1dd0d38..b912ca5de502 100644
--- a/src/stacktrace.c
+++ b/src/stacktrace.c
@@ -1033,7 +1033,7 @@ sysprof_init_dwfl (struct sysprof_unwind_info *sui,
}
Elf *elf = NULL;
- int elf_fd;
+ int elf_fd = -1;
err = find_procfile (dwfl, &pid, &elf, &elf_fd);
if (err < 0)
{

View File

@ -3,8 +3,8 @@
%bcond_with static %bcond_with static
Name: elfutils Name: elfutils
Version: 0.192 Version: 0.193
%global baserelease 6 %global baserelease 1
Release: %{baserelease}%{?dist} Release: %{baserelease}%{?dist}
URL: http://elfutils.org/ URL: http://elfutils.org/
%global source_url ftp://sourceware.org/pub/elfutils/%{version}/ %global source_url ftp://sourceware.org/pub/elfutils/%{version}/
@ -96,18 +96,6 @@ BuildRequires: gettext-devel
# For s390x... FDO package notes are bogus. # For s390x... FDO package notes are bogus.
Patch1: elfutils-0.186-fdo-swap.patch Patch1: elfutils-0.186-fdo-swap.patch
# Include libeu.a objects in libelf.a for static linking.
Patch2: elfutils-0.192-libelf-static.patch
# Fix eu-stacktrace LTO build error.
Patch3: elfutils-0.192-stacktrace-lto.patch
# Fix configure.ac setting ENABLE_DEBUGINFOD_IMA_VERIFICATION.
Patch4: elfutils-0.192-fix-configure-conditional.patch
# Avoid freeing uninitialized variable.
Patch5: elfutils-0.192-fix-free.patch
%description %description
Elfutils is a collection of utilities, including stack (to show Elfutils is a collection of utilities, including stack (to show
backtraces), nm (for listing symbols from object files), size backtraces), nm (for listing symbols from object files), size
@ -441,6 +429,7 @@ fi
%{_includedir}/elfutils/libasm.h %{_includedir}/elfutils/libasm.h
%{_includedir}/elfutils/libdw.h %{_includedir}/elfutils/libdw.h
%{_includedir}/elfutils/libdwfl.h %{_includedir}/elfutils/libdwfl.h
%{_includedir}/elfutils/libdwfl_stacktrace.h
%{_includedir}/elfutils/libdwelf.h %{_includedir}/elfutils/libdwelf.h
%{_includedir}/elfutils/version.h %{_includedir}/elfutils/version.h
%{_libdir}/libasm.so %{_libdir}/libasm.so
@ -529,6 +518,14 @@ exit 0
%systemd_postun_with_restart debuginfod.service %systemd_postun_with_restart debuginfod.service
%changelog %changelog
* Wed Apr 30 2025 Aaron Merey <amerey@redhat.com> - 0.193-1
- Upgrade to upstream elfutils 0.193
- Drop upstreamed patches
elfutils-0.192-fix-configure-conditional.patch
elfutils-0.192-fix-free.patch
elfutils-0.192-libelf-static.patch
elfutils-0.192-stacktrace-lto.patch
* Fri Mar 14 2025 Aaron Merey <amerey@redhat.com> - 0.192-6 * Fri Mar 14 2025 Aaron Merey <amerey@redhat.com> - 0.192-6
- Add elfutils-0.192-fix-free.patch - Add elfutils-0.192-fix-free.patch

View File

@ -1 +1 @@
SHA512 (elfutils-0.192.tar.bz2) = 543188f5f2cfe5bc7955a878416c5f252edff9926754e5de0c6c57b132f21d9285c9b29e41281e93baad11d4ae7efbbf93580c114579c182103565fe99bd3909 SHA512 (elfutils-0.193.tar.bz2) = 557e328e3de0d2a69d09c15a9333f705f3233584e2c6a7d3ce855d06a12dc129e69168d6be64082803630397bd64e1660a8b5324d4f162d17922e10ddb367d76