diff --git a/elfutils-0.192-fix-configure-conditional.patch b/elfutils-0.192-fix-configure-conditional.patch new file mode 100644 index 0000000000000000000000000000000000000000..dda720e1fa90a0972d675b82712ecfc855ff3729 --- /dev/null +++ b/elfutils-0.192-fix-configure-conditional.patch @@ -0,0 +1,26 @@ +From fb4753feb0ed7e3387f52b54bb02c6c74aac6a3e Mon Sep 17 00:00:00 2001 +From: Aaron Merey +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 + diff --git a/elfutils-0.192-libelf-static.patch b/elfutils-0.192-libelf-static.patch new file mode 100644 index 0000000000000000000000000000000000000000..799cfb4a14de1168c44ce6a8b95d55a9f6555517 --- /dev/null +++ b/elfutils-0.192-libelf-static.patch @@ -0,0 +1,36 @@ +From 0a65a54593ae489d40cb993caa74095d45bc47fd Mon Sep 17 00:00:00 2001 +From: Mark Wielaard +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 +--- + 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 + diff --git a/elfutils-0.192-skip-ima-test.patch b/elfutils-0.192-skip-ima-test.patch new file mode 100644 index 0000000000000000000000000000000000000000..a887e621b2973cb4cf533a12f60c76be1367bd90 --- /dev/null +++ b/elfutils-0.192-skip-ima-test.patch @@ -0,0 +1,48 @@ +From 36bd0ffe72f63a187902679823dfd50510bf7300 Mon Sep 17 00:00:00 2001 +From: Aaron Merey +Date: Fri, 13 Dec 2024 11:14:39 -0500 +Subject: [PATCH] run-debuginfod-ima-verification.sh: Skip test 4 + +Test 4 requires `rpmsign --delfilesign` to remove IMA signatures. +RHEL 9 rpmsign does not currently support delfilesign, so skip this +test for now. +--- + tests/run-debuginfod-ima-verification.sh | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +diff --git a/tests/run-debuginfod-ima-verification.sh b/tests/run-debuginfod-ima-verification.sh +index d582af5f..a5e6eeb2 100755 +--- a/tests/run-debuginfod-ima-verification.sh ++++ b/tests/run-debuginfod-ima-verification.sh +@@ -127,17 +127,17 @@ RC=0 + testrun ${abs_top_builddir}/debuginfod/debuginfod-find executable $RPM_BUILDID || RC=1 + test $RC -ne 0 + +-echo Test 4: A rpm without a signature will fail +-cp signed.rpm R/signed.rpm +-rpmsign --delfilesign R/signed.rpm +-rm -rf $DEBUGINFOD_CACHE_PATH # clean it from previous tests +-kill -USR1 $PID1 +-wait_ready $PORT1 'thread_work_total{role="traverse"}' 4 +-wait_ready $PORT1 'thread_work_pending{role="scan"}' 0 +-wait_ready $PORT1 'thread_busy{role="scan"}' 0 +-RC=0 +-testrun ${abs_top_builddir}/debuginfod/debuginfod-find executable $RPM_BUILDID || RC=1 +-test $RC -ne 0 ++#echo Test 4: A rpm without a signature will fail ++#cp signed.rpm R/signed.rpm ++#rpmsign --delfilesign R/signed.rpm ++#rm -rf $DEBUGINFOD_CACHE_PATH # clean it from previous tests ++#kill -USR1 $PID1 ++#wait_ready $PORT1 'thread_work_total{role="traverse"}' 4 ++#wait_ready $PORT1 'thread_work_pending{role="scan"}' 0 ++#wait_ready $PORT1 'thread_busy{role="scan"}' 0 ++#RC=0 ++#testrun ${abs_top_builddir}/debuginfod/debuginfod-find executable $RPM_BUILDID || RC=1 ++#test $RC -ne 0 + + echo Test 5: Only tests 1,2 will result in extracted signature + [[ $(curl -s http://127.0.0.1:$PORT1/metrics | grep 'http_responses_total{extra="ima-sigs-extracted"}' | awk '{print $NF}') -eq 2 ]] +-- +2.47.1 + diff --git a/elfutils-0.192-stacktrace-lto.patch b/elfutils-0.192-stacktrace-lto.patch new file mode 100644 index 0000000000000000000000000000000000000000..9f110f873f1b5bf49b7d7a7d5117cd932d513257 --- /dev/null +++ b/elfutils-0.192-stacktrace-lto.patch @@ -0,0 +1,35 @@ +commit 43829fb8780ecbe9d17aaed22d3dfcb806cb5f45 +Author: Mark Wielaard +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 + +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) + { diff --git a/elfutils-0.190.tar.bz2 b/elfutils-0.192.tar.bz2 similarity index 49% rename from elfutils-0.190.tar.bz2 rename to elfutils-0.192.tar.bz2 index 83192c7351421f36fbf355700ebcf8de856ff3f3..711c66d009ddaf8816d73ecfb374be1c3302fa0f 100644 Binary files a/elfutils-0.190.tar.bz2 and b/elfutils-0.192.tar.bz2 differ diff --git a/elfutils.spec b/elfutils.spec index 01a68bd5dbfd89c5a5a4c1bee1e26311169d6d63..accca295cdc80f73f5bdbacec9fb585e02216cc1 100644 --- a/elfutils.spec +++ b/elfutils.spec @@ -1,4 +1,4 @@ -%define anolis_release 2 +%define anolis_release 1 %global source_url ftp://sourceware.org/pub/elfutils/%{version}/ %global _gnu %{nil} %define __brp_remove_la_files %{nil} @@ -7,7 +7,7 @@ Name: elfutils -Version: 0.190 +Version: 0.192 Release: %{anolis_release}%{?dist} Summary: A collection of utilities and DSOs to handle ELF files and DWARF data URL: http://elfutils.org/ @@ -16,6 +16,10 @@ Source0: https://sourceware.org/elfutils/ftp/%{version}/%{name}-%{version} Source1: elfutils-debuginfod.sysusers Patch0: add-sw_64-support.patch +Patch1: elfutils-0.192-skip-ima-test.patch +Patch2: elfutils-0.192-fix-configure-conditional.patch +Patch3: elfutils-0.192-stacktrace-lto.patch +Patch4: elfutils-0.192-libelf-static.patch Requires: elfutils-libelf = %{version}-%{release} Requires: elfutils-libs = %{version}-%{release} @@ -357,6 +361,13 @@ exit 0 %systemd_postun_with_restart debuginfod.service %changelog +* Wed Jun 25 2025 wenyuzifang - 0.192-1 +- Updated to version 0.192 to fix xxxxxxxxx +- Avoid test failure on RHEL 9 by skipping unsupported IMA signature removal test. +- Fix incorrect IMA verification condition to ensure proper enablement during configuration. +- Fix compiler warning, ensure safe builds with LTO, avoid false uninitialized usage errors. +- Ensure static linking works by including libeu objects in libelf.a. + * Mon Mar 31 2025 xunian - 0.190-2 - add sw_64 support @@ -382,4 +393,4 @@ exit 0 - Add static package for devel and libelf-devel * Tue Mar 08 2022 pangqing - 0.186-1 -- Init for anolisOS 23 +- Init for anolisOS 23 \ No newline at end of file