Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package rpm for openSUSE:Factory checked in at 2026-07-06 12:27:32 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rpm (Old) and /work/SRC/openSUSE:Factory/.rpm.new.1982 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rpm" Mon Jul 6 12:27:32 2026 rev:327 rq:1363448 version:4.20.1 Changes: -------- +++ only whitespace diff in changes, re-diffing New Changes file: --- /dev/null 2026-07-02 11:55:04.412000000 +0200 +++ /work/SRC/openSUSE:Factory/.rpm.new.1982/rpm-plugin-imaevmsign.changes 2026-07-06 12:27:57.674290098 +0200 @@ -0,0 +1,5 @@ +------------------------------------------------------------------- +Wed Jul 1 15:01:10 CEST 2026 - Michael Schroeder <[email protected]> + +- split imaevmsign plugin into a multibuild flavor + --- /work/SRC/openSUSE:Factory/rpm/rpm.changes 2026-05-11 16:48:21.254548666 +0200 +++ /work/SRC/openSUSE:Factory/.rpm.new.1982/rpm.changes 2026-07-06 12:27:57.970300365 +0200 @@ -1,0 +2,33 @@ +Tue Jun 30 14:48:45 CEST 2026 - Michael Schroeder <[email protected]> + +- harden ndb code [bsc#1269584] [CVE-2026-44605] + * new patch: ndbharden.diff +- split all plugins into subpackages + * this allows for an easy way to get rid of a plugin, it's also + what other distributions do +- make the imaevmsign plugin build in a multibuild flavor + * updated patch: imaevmsignplugin.diff + +------------------------------------------------------------------- +Mon Jun 29 11:43:19 CEST 2026 - Michael Schroeder <[email protected]> + +- rpm2archive: use size 0 for hardlinked files as bnew versions of + gnu tar reject non-zero sizes [bsc#1269150] + * updated patch: rpm2archive.diff +- backport fix for add_sysuser macro [bsc#1269571] + * updated patch: macrosin.diff +- backport rpmuncompress security fix [bsc#1268747] [CVE-2026-44604] + * new patch: rpmuncompress.diff + +------------------------------------------------------------------- +Wed Jun 17 09:36:52 CEST 2026 - Michael Schroeder <[email protected]> + +- switch from rpmpgp_legacy to libpgpr + * multiple bug fixes, support for v5 and v6 signatures + * updated patch: pgpreleasemtime.diff +- turn on imaevm file signature support and move the imaevm code + that needs the libimaevm library into a plugin. Put this + plugin into a new "rpm-imaevmsign" subpackage. [jsc#PED-7246] + * new patch: imaevmsignplugin.diff + +------------------------------------------------------------------- Old: ---- rpmpgp_legacy-1.1.tar.gz New: ---- imaevmsignplugin.diff libpgpr-1.3.tar.gz ndbharden.diff rpm-plugin-imaevmsign.changes rpm-plugin-imaevmsign.spec rpmuncompress.diff ----------(New B)---------- New:/work/SRC/openSUSE:Factory/.rpm.new.1982/rpm.changes-- make the imaevmsign plugin build in a multibuild flavor /work/SRC/openSUSE:Factory/.rpm.new.1982/rpm.changes: * updated patch: imaevmsignplugin.diff /work/SRC/openSUSE:Factory/.rpm.new.1982/rpm.changes- New:/work/SRC/openSUSE:Factory/.rpm.new.1982/rpm.changes-- harden ndb code [bsc#1269584] [CVE-2026-44605] /work/SRC/openSUSE:Factory/.rpm.new.1982/rpm.changes: * new patch: ndbharden.diff /work/SRC/openSUSE:Factory/.rpm.new.1982/rpm.changes-- split all plugins into subpackages New:/work/SRC/openSUSE:Factory/.rpm.new.1982/rpm.changes-- backport rpmuncompress security fix [bsc#1268747] [CVE-2026-44604] /work/SRC/openSUSE:Factory/.rpm.new.1982/rpm.changes: * new patch: rpmuncompress.diff /work/SRC/openSUSE:Factory/.rpm.new.1982/rpm.changes- ----------(New E)---------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-rpm.spec ++++++ --- /var/tmp/diff_new_pack.9R8Cb1/_old 2026-07-06 12:28:00.110374589 +0200 +++ /var/tmp/diff_new_pack.9R8Cb1/_new 2026-07-06 12:28:00.114374728 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-rpm # -# Copyright (c) 2025 SUSE LLC and contributors +# Copyright (c) 2026 SUSE LLC # Copyright (c) 2017 Neal Gompa <[email protected]>. # # All modifications and additions to the file contributed by third parties @@ -31,6 +31,7 @@ BuildRequires: cmake BuildRequires: fdupes BuildRequires: file-devel +BuildRequires: ima-evm-utils-devel BuildRequires: libacl-devel BuildRequires: libarchive-devel BuildRequires: libbz2-devel ++++++ rpm-plugin-imaevmsign.spec ++++++ # # spec file for package rpm-plugin-imaevmsign # # Copyright (c) 2026 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # # Enable Python build sourced from rpm spec %global with_imaevm 1 Name: rpm-plugin-imaevmsign Version: 4.20.1 Release: 0 Summary: IMA EVM file signing plugin License: GPL-2.0-or-later Group: System/Packages URL: https://rpm.org/ #Git-Clone: https://github.com/rpm-software-management/rpm BuildRequires: cmake BuildRequires: fdupes BuildRequires: file-devel BuildRequires: ima-evm-utils-devel BuildRequires: libacl-devel BuildRequires: libarchive-devel BuildRequires: libbz2-devel BuildRequires: libcap-devel BuildRequires: libdw-devel BuildRequires: libelf-devel BuildRequires: libgcrypt-devel BuildRequires: libselinux-devel BuildRequires: libsemanage-devel BuildRequires: libtool BuildRequires: lua-devel BuildRequires: ncurses-devel BuildRequires: popt-devel BuildRequires: python-rpm-macros BuildRequires: xz-devel BuildRequires: zlib-devel BuildRequires: pkgconfig(libzstd) Requires: rpm = %{version} Provides: rpm-imaevmsign < 4.20.1 Obsoletes: rpm-imaevmsign < 4.20.1 %{expand:%(sed -n -e '/^Source:/,/^BuildRoot:/p' <%{_sourcedir}/rpm.spec)} Source99: rpm.spec %description Rpm plugin for IMA EVM file signing support. %prep %{expand:%(sed -n -e '/^%%prep/,/^%%install/p' <%{_sourcedir}/rpm.spec | sed -e '1d' -e '$d')} %install cd _build make DESTDIR=%{buildroot} -C sign install # we just need the plugin rm -rf %{buildroot}/%{_libdir}/lib* mkdir -p %{buildroot}/usr/lib/rpm/macros.d echo "%%__sign_imaevm %%{__plugindir}/imaevmsign.so" > %{buildroot}/usr/lib/rpm/macros.d/macros.imaevmsign %files %{_libdir}/rpm-plugins/imaevmsign.so /usr/lib/rpm/macros.d/macros.imaevmsign %changelog ++++++ rpm.spec ++++++ --- /var/tmp/diff_new_pack.9R8Cb1/_old 2026-07-06 12:28:00.178376947 +0200 +++ /var/tmp/diff_new_pack.9R8Cb1/_new 2026-07-06 12:28:00.178376947 +0200 @@ -1,7 +1,7 @@ # # spec file for package rpm # -# Copyright (c) 2025 SUSE LLC and contributors +# Copyright (c) 2026 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -64,8 +64,8 @@ URL: https://rpm.org/ #Git-Clone: https://github.com/rpm-software-management/rpm Source: https://ftp.osuosl.org/pub/rpm/releases/rpm-4.20.x/rpm-%{version}.tar.bz2 -#Git-Clone: https://github.com/rpm-software-management/rpmpgp_legacy -Source1: rpmpgp_legacy-1.1.tar.gz +#Url: https://github.com/rpm-software-management/libpgpr/archive/refs/tags/1.3.tar.gz +Source1: libpgpr-1.3.tar.gz Source5: rpmsort Source8: rpmconfigcheck Source9: sysconfig.services-rpm @@ -130,6 +130,9 @@ Patch159: emptypw.diff Patch160: buildsysprep.diff Patch161: pgpreleasemtime.diff +Patch162: imaevmsignplugin.diff +Patch163: rpmuncompress.diff +Patch164: ndbharden.diff Patch6464: auto-config-update-aarch64-ppc64le.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build # @@ -222,6 +225,44 @@ %description plugin-unshare Rpm plugin for Linux namespace isolation functionality. +%package plugin-ima +Summary: Rpm plugin for ima file signatures +Requires: rpm = %{version} +Provides: rpm:%{_libdir}/rpm-plugins/ima.so + +%description plugin-ima +Rpm plugin for ima file signatures. + +%package plugin-selinux +Summary: Rpm plugin for SELinux functionality +Requires: rpm = %{version} +Provides: rpm:%{_libdir}/rpm-plugins/selinux.so + +%description plugin-selinux +Rpm plugin for SELinux functionality. + +%package plugin-prioreset +Summary: Rpm plugin for resetting scriptlet priorities for SysV init +Requires: rpm = %{version} + +%description plugin-prioreset +Rpm plugin for resetting scriptlet priorities for SysV init. + +%package plugin-syslog +Summary: Rpm plugin for syslog functionality +Requires: rpm = %{version} +Provides: rpm:%{_libdir}/rpm-plugins/syslog.so + +%description plugin-syslog +Rpm plugin for syslog functionality. + +%package plugin-fapolicyd +Summary: Rpm plugin for fapolicyd support +Requires: rpm = %{version} + +%description plugin-fapolicyd +Rpm plugin for fapolicyd support. + %prep %setup -q -n rpm-%{version} %ifarch aarch64 ppc64le riscv64 loongarch64 @@ -229,7 +270,7 @@ %endif pushd rpmio tar xf %{SOURCE1} -ln -s rpmpgp_legacy-* rpmpgp_legacy +ln -s libpgpr-* rpmpgp_legacy popd rm -rf sqlite @@ -249,7 +290,7 @@ %patch -P 139 %patch -P 141 -P 142 %patch -P 150 -P 151 -P 154 -P 155 -P 156 -P 157 -P 158 -P 159 -%patch -P 160 -P 161 +%patch -P 160 -P 161 -P 162 -P 163 -P 164 %ifarch aarch64 ppc64le riscv64 loongarch64 %patch -P 6464 @@ -299,6 +340,7 @@ -DENABLE_SQLITE=OFF \ -DWITH_AUDIT=OFF \ -DWITH_DBUS=OFF \ + -DWITH_IMAEVM=%{?with_imaevm:ON}%{?!with_imaevm:OFF} \ -DENABLE_PYTHON=%{?with_python:ON}%{?!with_python:OFF} \ -DENABLE_TESTSUITE=OFF \ -D__FIND_DEBUGINFO=/usr/lib/rpm/find-debuginfo \ @@ -401,8 +443,8 @@ %license COPYING %doc %{_datadir}/doc/packages/rpm %exclude %{_datadir}/doc/packages/rpm/API -%exclude /usr/lib/rpm/macros.d/macros.transaction_unshare -%exclude %{_mandir}/man8/rpm-plugin-unshare* +%exclude /usr/lib/rpm/macros.d/macros.transaction_* +%exclude %{_mandir}/man8/rpm-plugin-* /etc/rpm %if 0%{?suse_version} < 1550 /bin/rpm @@ -493,3 +535,28 @@ /usr/lib/rpm/macros.d/macros.transaction_unshare %doc %{_mandir}/man8/rpm-plugin-unshare* +%files plugin-ima +%defattr(-,root,root) +/usr/lib/rpm/macros.d/macros.transaction_ima +%doc %{_mandir}/man8/rpm-plugin-ima* + +%files plugin-selinux +%defattr(-,root,root) +/usr/lib/rpm/macros.d/macros.transaction_selinux +%doc %{_mandir}/man8/rpm-plugin-selinux* + +%files plugin-prioreset +%defattr(-,root,root) +/usr/lib/rpm/macros.d/macros.transaction_prioreset +%doc %{_mandir}/man8/rpm-plugin-prioreset* + +%files plugin-syslog +%defattr(-,root,root) +/usr/lib/rpm/macros.d/macros.transaction_syslog +%doc %{_mandir}/man8/rpm-plugin-syslog* + +%files plugin-fapolicyd +%defattr(-,root,root) +/usr/lib/rpm/macros.d/macros.transaction_fapolicyd +%doc %{_mandir}/man8/rpm-plugin-fapolicyd* + ++++++ _multibuild ++++++ --- /var/tmp/diff_new_pack.9R8Cb1/_old 2026-07-06 12:28:00.254379583 +0200 +++ /var/tmp/diff_new_pack.9R8Cb1/_new 2026-07-06 12:28:00.262379861 +0200 @@ -1,4 +1,5 @@ <multibuild> <flavor>python-rpm</flavor> +<flavor>rpm-plugin-imaevmsign</flavor> </multibuild> ++++++ imaevmsignplugin.diff ++++++ --- CMakeLists.txt.orig 2026-07-01 12:52:31.090297156 +0000 +++ CMakeLists.txt 2026-07-01 12:52:32.994295629 +0000 @@ -446,6 +446,9 @@ include_directories(${CMAKE_SOURCE_DIR}/ # public headers include_directories(${CMAKE_SOURCE_DIR}/include) +set(RPM_PLUGINDIR ${CMAKE_INSTALL_FULL_LIBDIR}/rpm-plugins + CACHE PATH "rpm plugin directory") + add_subdirectory(docs) add_subdirectory(include/rpm) add_subdirectory(misc) @@ -463,9 +466,6 @@ if (ENABLE_PYTHON) add_subdirectory(python) endif() -set(RPM_PLUGINDIR ${CMAKE_INSTALL_FULL_LIBDIR}/rpm-plugins - CACHE PATH "rpm plugin directory") - if (ENABLE_PLUGINS) add_subdirectory(plugins) endif() --- docs/man/CMakeLists.txt.orig 2026-07-01 13:34:38.072271624 +0000 +++ docs/man/CMakeLists.txt 2026-07-01 13:34:57.528255927 +0000 @@ -27,6 +27,7 @@ set(manuals ${core}) if (ENABLE_PLUGINS) list(APPEND manuals rpm-plugins.8 rpm-plugin-prioreset.8 rpm-plugin-syslog.8) + list(APPEND manuals rpm-plugin-ima.8) if (WITH_AUDIT) list(APPEND manuals rpm-plugin-audit.8) endif() @@ -37,9 +38,6 @@ if (ENABLE_PLUGINS) if (WITH_FAPOLICYD) list(APPEND manuals rpm-plugin-fapolicyd.8) endif() - if (WITH_IMAEVM) - list(APPEND manuals rpm-plugin-ima.8) - endif() if (WITH_SELINUX) list(APPEND manuals rpm-plugin-selinux.8) endif() --- plugins/CMakeLists.txt.orig 2026-07-01 13:32:30.272374761 +0000 +++ plugins/CMakeLists.txt 2026-07-01 13:33:25.096330501 +0000 @@ -1,5 +1,6 @@ add_library(prioreset MODULE prioreset.c) add_library(syslog MODULE syslog.c) +add_library(ima MODULE ima.c) if(WITH_SELINUX) add_library(selinux MODULE selinux.c) @@ -19,10 +20,6 @@ if(WITH_DBUS) ) endif() -if(WITH_IMAEVM) - add_library(ima MODULE ima.c) -endif() - if(WITH_FAPOLICYD) add_library(fapolicyd MODULE fapolicyd.c) endif() --- sign/CMakeLists.txt.orig 2025-02-19 15:29:33.000000000 +0000 +++ sign/CMakeLists.txt 2026-07-01 12:59:38.985954394 +0000 @@ -19,8 +19,8 @@ target_include_directories(librpmsign target_link_libraries(librpmsign PUBLIC librpmio librpm) target_link_libraries(librpmsign PRIVATE PkgConfig::POPT ${Intl_LIBRARIES}) if (WITH_IMAEVM) - target_sources(librpmsign PRIVATE rpmsignfiles.c) - target_link_libraries(librpmsign PRIVATE IMA::IMA) + add_library(imaevmsign MODULE rpmsignfiles.c) + target_link_libraries(imaevmsign PRIVATE librpmio librpm IMA::IMA) endif() if (WITH_FSVERITY) target_sources(librpmsign PRIVATE rpmsignverity.c) @@ -35,3 +35,7 @@ set_source_files_properties(${cxx_source endif() install(TARGETS librpmsign EXPORT rpm-targets) +if (WITH_IMAEVM) +install(TARGETS imaevmsign DESTINATION ${RPM_PLUGINDIR}) +endif() + --- sign/rpmgensig.c.orig 2025-02-19 15:29:33.000000000 +0000 +++ sign/rpmgensig.c 2026-07-01 12:55:14.338166364 +0000 @@ -13,9 +13,8 @@ #include <libfsverity.h> #include "rpmsignverity.h" #endif -#ifdef WITH_IMAEVM +#include <dlfcn.h> #include "rpmsignfiles.h" -#endif #include <rpm/rpmlib.h> /* RPMSIGTAG & related */ #include <rpm/rpmmacro.h> @@ -474,9 +473,38 @@ static void unloadImmutableRegion(Header } } +static rpmRC CallRpmSignFiles(Header sig, Header hdr, char *key, char *keypass) +{ + rpmRC rc = RPMRC_FAIL; + void *handle = NULL; + void *func; + char *error; + char *path = rpmExpand("%{?__sign_imaevm}", NULL); + if (!path || !*path) { + rpmlog(RPMLOG_ERR, _("imaevm sign plugin is not configured\n")); + goto exit; + } + handle = dlopen(path, RTLD_LAZY); + if (!handle) { + rpmlog(RPMLOG_ERR, _("Failed to dlopen %s %s\n"), path, dlerror()); + goto exit; + } + func = dlsym(handle, "rpmSignFiles"); + if ((error = dlerror()) != NULL) { + rpmlog(RPMLOG_ERR, _("Failed to resolve symbol %s: %s\n"), + "rpmSignFiles", error); + goto exit; + } + rc = ((rpmRC (*)(Header, Header, char *, char *))func)(sig, hdr, key, keypass); +exit: + if (handle) + dlclose(handle); + _free(path); + return rc; +} + static rpmRC includeFileSignatures(Header *sigp, Header *hdrp) { -#ifdef WITH_IMAEVM rpmRC rc; char *key = rpmExpand("%{?_file_signing_key}", NULL); char *keypass = rpmExpand("%{?_file_signing_key_password}", NULL); @@ -486,15 +514,11 @@ static rpmRC includeFileSignatures(Heade keypass = NULL; } - rc = rpmSignFiles(*sigp, *hdrp, key, keypass); + rc = CallRpmSignFiles(*sigp, *hdrp, key, keypass); free(keypass); free(key); return rc; -#else - rpmlog(RPMLOG_ERR, _("file signing support not built in\n")); - return RPMRC_FAIL; -#endif } static rpmRC includeVeritySignatures(FD_t fd, Header *sigp, Header *hdrp) --- sign/rpmsignfiles.c.orig 2025-02-19 15:29:33.000000000 +0000 +++ sign/rpmsignfiles.c 2026-07-01 12:53:14.826262117 +0000 @@ -16,6 +16,17 @@ #include "rpmsignfiles.h" +#ifdef __cplusplus +extern "C" { +#endif + +/* This doesn't have c++ guards on its own */ +#include <imaevm.h> + +#ifdef __cplusplus +} +#endif + #define MAX_SIGNATURE_LENGTH 1024 static const char *hash_algo_name[] = { --- sign/rpmsignfiles.h.orig 2025-02-19 15:29:33.000000000 +0000 +++ sign/rpmsignfiles.h 2026-07-01 12:53:49.874234031 +0000 @@ -4,17 +4,6 @@ #include <rpm/rpmtypes.h> #include <rpm/rpmutil.h> -#ifdef __cplusplus -extern "C" { -#endif - -/* This doesn't have c++ guards on its own */ -#include <imaevm.h> - -#ifdef __cplusplus -} -#endif - /** * Sign file digests in header into signature header * @param sigh package signature header @@ -23,7 +12,6 @@ extern "C" { * @param keypass signing key password * @return RPMRC_OK on success */ -RPM_GNUC_INTERNAL rpmRC rpmSignFiles(Header sigh, Header h, const char *key, char *keypass); #endif /* H_RPMSIGNFILES */ --- tools/rpmsign.c.orig 2026-07-01 13:29:05.232540198 +0000 +++ tools/rpmsign.c 2026-07-01 13:30:10.364487638 +0000 @@ -19,6 +19,10 @@ enum modes { static int mode = MODE_NONE; +#ifndef WITH_IMAEVM +#define WITH_IMAEVM +#endif + #if defined(WITH_IMAEVM) || defined(WITH_FSVERITY) static int fskpass = 0; static char * fileSigningKey = NULL; ++++++ macrosin.diff ++++++ --- /var/tmp/diff_new_pack.9R8Cb1/_old 2026-07-06 12:28:00.406384855 +0200 +++ /var/tmp/diff_new_pack.9R8Cb1/_new 2026-07-06 12:28:00.410384994 +0200 @@ -1,5 +1,5 @@ ---- macros.in.orig 2025-02-12 13:23:21.868124201 +0000 -+++ macros.in 2025-02-12 13:23:58.436059109 +0000 +--- macros.in.orig 2026-06-29 10:15:52.957436592 +0000 ++++ macros.in 2026-06-29 10:16:22.529408262 +0000 @@ -163,6 +163,7 @@ %{?_unique_debug_names:--unique-debug-suffix "-%{VERSION}-%{RELEASE}.%{_arch}"} \\\ %{?_unique_debug_srcs:--unique-debug-src-base "%{name}-%{VERSION}-%{RELEASE}.%{_arch}"} \\\ @@ -8,7 +8,7 @@ %{?_find_debuginfo_opts} \\\ %{?_debugsource_packages:-S debugsourcefiles.list} \\\ "%{builddir}/%{?buildsubdir}"\ -@@ -216,7 +217,8 @@ Supplements: (%{name} = %{version}-%{r +@@ -217,7 +218,8 @@ Supplements: (%{name} = %{version}-%{r %files langpack-%{1}\ %{nil} @@ -18,7 +18,7 @@ %_defaultlicensedir %{_datadir}/licenses # Following macros for filtering auto deps must not be used in spec files. -@@ -275,7 +277,8 @@ Supplements: (%{name} = %{version}-%{r +@@ -276,7 +278,8 @@ Supplements: (%{name} = %{version}-%{r %_tmppath %{_var}/tmp # Path to top of build area. @@ -28,7 +28,7 @@ #============================================================================== # ---- Optional rpmrc macros. -@@ -366,7 +369,7 @@ Supplements: (%{name} = %{version}-%{r +@@ -367,7 +370,7 @@ Supplements: (%{name} = %{version}-%{r # "w.ufdio" uncompressed # #%_source_payload w9.gzdio @@ -37,7 +37,7 @@ # Algorithm to use for generating file checksum digests on build. # If not specified or 0, MD5 is used. -@@ -476,6 +479,19 @@ Supplements: (%{name} = %{version}-%{r +@@ -477,6 +480,19 @@ Supplements: (%{name} = %{version}-%{r # #%_include_minidebuginfo 1 @@ -57,7 +57,7 @@ # # Include a .gdb_index section in the .debug files. # Requires _enable_debug_packages and gdb-add-index installed. -@@ -508,39 +524,39 @@ Supplements: (%{name} = %{version}-%{r +@@ -509,39 +525,39 @@ Supplements: (%{name} = %{version}-%{r # Same as for "separate" but if the __debug_package global is set then # the -debuginfo package will have a compatibility link for the main # ELF /usr/lib/debug/.build-id/xx/yyy -> /usr/lib/.build-id/xx/yyy @@ -104,7 +104,7 @@ # # Use internal dependency generator rather than external helpers? -@@ -559,6 +575,7 @@ Supplements: (%{name} = %{version}-%{r +@@ -560,6 +576,7 @@ Supplements: (%{name} = %{version}-%{r %__find_requires %{_rpmconfigdir}/find-requires #%__find_conflicts ??? #%__find_obsoletes ??? @@ -112,7 +112,7 @@ # # Path to file attribute classifications for automatic dependency -@@ -980,7 +997,7 @@ Supplements: (%{name} = %{version}-%{r +@@ -981,7 +998,7 @@ Supplements: (%{name} = %{version}-%{r %_build_vendor %{_host_vendor} %_build_os %{_host_os} %_host @host@ @@ -121,7 +121,7 @@ %_host_cpu @host_cpu@ %_host_vendor @host_vendor@ %_host_os @host_os@ -@@ -1105,11 +1122,13 @@ Supplements: (%{name} = %{version}-%{r +@@ -1106,11 +1123,13 @@ Supplements: (%{name} = %{version}-%{r #------------------------------------------------------------------------------ # arch macro for all supported 32-bit ARM processors @@ -136,4 +136,13 @@ #------------------------------------------------------------------------------ # arch macro for all supported 64-bit ARM processors +@@ -1356,7 +1375,7 @@ end + if type == 'groupmember' then + print(string.format('%s%s(%s/%s) = %s\\n', prefix, type, name, arg[3], enc)) + if (prefix ~= '') then +- prefix2 = rpm.expand('%[%{?_use_weak_usergroup_deps} > 0 : "Recommends" : "Requires"]') ++ prefix2 = rpm.expand('%[%{?_use_weak_usergroup_deps} > 0 ? "Recommends" : "Requires"]') + print(string.format('%s: user(%s)\\n', prefix2, name)) + print(string.format('%s: group(%s)\\n', prefix2, arg[3])) + end ++++++ ndbharden.diff ++++++ --- lib/backend/ndb/rpmidx.c.orig 2025-02-19 15:29:33.000000000 +0000 +++ lib/backend/ndb/rpmidx.c 2026-07-02 09:25:12.474104651 +0000 @@ -64,7 +64,7 @@ */ -typedef struct rpmidxdb_s { +struct rpmidxdb_s { rpmpkgdb pkgdb; /* main database */ int flags; @@ -95,8 +95,9 @@ typedef struct rpmidxdb_s { unsigned int xmask; unsigned int pagesize; -} * rpmidxdb; +}; +#if 0 static inline unsigned int le2h(unsigned char *p) { return p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24; @@ -109,6 +110,7 @@ static inline void h2le(unsigned int x, p[2] = x >> 16; p[3] = x >> 24; } +#endif /* aligned versions */ static inline unsigned int le2ha(unsigned char *p) @@ -215,6 +217,14 @@ static int rpmidxReadHeader(rpmidxdb idx idxdb->keyend = le2ha(idxdb->head_mapped + IDXDB_OFFSET_KEYEND); idxdb->keyexcess = le2ha(idxdb->head_mapped + IDXDB_OFFSET_KEYEXCESS); + /* make sure data is sane */ + if (idxdb->nslots < 256 || (idxdb->nslots & (idxdb->nslots - 1)) != 0 || + idxdb->usedslots > idxdb->nslots || idxdb->dummyslots > idxdb->nslots || + idxdb->nslots >= (0xffffffffU - IDXDB_SLOT_OFFSET) / 12) { + rpmidxUnmap(idxdb); /* too small, somthing is wrong */ + return RPMRC_FAIL; + } + idxdb->hmask = idxdb->nslots - 1; /* now that we know nslots we can split between slots and keys */ @@ -368,6 +378,8 @@ static inline int equalkey(rpmidxdb idxd static int addkeypage(rpmidxdb idxdb) { unsigned int addsize = idxdb->pagesize > IDXDB_KEY_CHUNKSIZE ? idxdb->pagesize : IDXDB_KEY_CHUNKSIZE; + if (addsize > 0xffffffffU - idxdb->file_size) + return RPMRC_FAIL; if (rpmxdbResizeBlob(idxdb->xdb, idxdb->xdbid, idxdb->file_size + addsize)) return RPMRC_FAIL; return RPMRC_OK; @@ -498,6 +510,8 @@ static int rpmidxRebuildInternal(rpmidxd while (nslots & (nslots - 1)) nslots = nslots & (nslots - 1); nslots *= 4; + if (nslots < 256 || nslots >= (0xffffffffU - IDXDB_SLOT_OFFSET) / 12) + return RPMRC_FAIL; nidxdb->nslots = nslots; nidxdb->hmask = nslots - 1; @@ -506,11 +520,16 @@ static int rpmidxRebuildInternal(rpmidxd key_size = idxdb->keyend; if (key_size < IDXDB_KEY_CHUNKSIZE) key_size = IDXDB_KEY_CHUNKSIZE; + if (key_size >= 0xffffffffU - (IDXDB_SLOT_OFFSET + nslots * 12)) + return RPMRC_FAIL; + file_size = IDXDB_SLOT_OFFSET + nslots * 12 + key_size; /* round file size to multiple of the page size */ if (file_size & (nidxdb->pagesize - 1)) { unsigned int add = nidxdb->pagesize - (file_size & (nidxdb->pagesize - 1)); + if (add > 0xffffffffU - file_size) + return RPMRC_FAIL; file_size += add; key_size += add; } @@ -584,7 +603,7 @@ static int rpmidxRebuildInternal(rpmidxd */ static int rpmidxCheck(rpmidxdb idxdb) { - if (idxdb->usedslots * 2 > idxdb->nslots || + if (idxdb->usedslots > idxdb->nslots / 2 || (idxdb->keyexcess > 4096 && idxdb->keyexcess * 4 > idxdb->keyend) || idxdb->keyend >= ~idxdb->xmask) { if (rpmidxRebuildInternal(idxdb)) @@ -606,6 +625,8 @@ static int rpmidxPutInternal(rpmidxdb id if (datidx >= 0x80000000) return RPMRC_FAIL; + if (keyl >= 0x80000000) + return RPMRC_FAIL; if (rpmidxCheck(idxdb)) return RPMRC_FAIL; data = encodedata(idxdb, pkgidx, datidx, &ovldata); @@ -677,6 +698,8 @@ static int rpmidxDelInternal(rpmidxdb id if (datidx >= 0x80000000) return RPMRC_FAIL; + if (keyl >= 0x80000000) + return RPMRC_FAIL; if (rpmidxCheck(idxdb)) return RPMRC_FAIL; data = encodedata(idxdb, pkgidx, datidx, &ovldata); --- lib/backend/ndb/rpmpkg.c.orig 2026-07-02 09:24:54.914122076 +0000 +++ lib/backend/ndb/rpmpkg.c 2026-07-02 09:25:41.458075889 +0000 @@ -24,7 +24,7 @@ typedef struct pkgslot_s { unsigned int slotno; } pkgslot; -typedef struct rpmpkgdb_s { +struct rpmpkgdb_s { int fd; /* our file descriptor */ int rdonly; @@ -49,7 +49,7 @@ typedef struct rpmpkgdb_s { char *filename; unsigned int fileblks; /* file size in blks */ int dofsync; -} * rpmpkgdb; +}; static inline unsigned int le2h(unsigned char *p) @@ -88,6 +88,12 @@ static unsigned int update_adler32(unsig return ((s2 % 65521) << 16) + (s1 % 65521); } +/*** Size definitions ***/ + +#define SLOT_SIZE 16 +#define BLK_SIZE 16 +#define PAGE_SIZE 4096 + /*** Header management ***/ #define PKGDB_MAGIC ('R' | 'p' << 8 | 'm' << 16 | 'P' << 24) @@ -102,6 +108,9 @@ static unsigned int update_adler32(unsig #define PKGDB_OFFSET_SLOTNPAGES 12 #define PKGDB_OFFSET_NEXTPKGIDX 16 +/* the slot index and the block index must fit into a 32bit integer */ +#define PKGDB_MAX_SLOTNPAGES (0xffffffffU / (PAGE_SIZE / (SLOT_SIZE > BLK_SIZE ? BLK_SIZE : SLOT_SIZE))) + static int rpmpkgReadHeader(rpmpkgdb pkgdb) { unsigned int generation, slotnpages, nextpkgidx, version; @@ -125,6 +134,8 @@ static int rpmpkgReadHeader(rpmpkgdb pkg generation = le2h(header + PKGDB_OFFSET_GENERATION); slotnpages = le2h(header + PKGDB_OFFSET_SLOTNPAGES); nextpkgidx = le2h(header + PKGDB_OFFSET_NEXTPKGIDX); + if (slotnpages > PKGDB_MAX_SLOTNPAGES) + return RPMRC_FAIL; /* free slots if our internal data no longer matches */ if (pkgdb->slots && (pkgdb->generation != generation || pkgdb->slotnpages != slotnpages)) { free(pkgdb->slots); @@ -167,10 +178,6 @@ static int rpmpkgWriteHeader(rpmpkgdb pk #define SLOT_MAGIC ('S' | 'l' << 8 | 'o' << 16 | 't' << 24) -#define SLOT_SIZE 16 -#define BLK_SIZE 16 -#define PAGE_SIZE 4096 - /* the first slots (i.e. 32 bytes) are used for the header */ #define SLOT_START (PKGDB_HEADER_SIZE / SLOT_SIZE) @@ -235,10 +242,12 @@ static int rpmpkgReadSlots(rpmpkgdb pkgd return RPMRC_FAIL; if (stb.st_size % BLK_SIZE) return RPMRC_FAIL; /* hmm */ + if (stb.st_size / BLK_SIZE >= 0xffffffffU) + return RPMRC_FAIL; /* hmm */ fileblks = stb.st_size / BLK_SIZE; /* read (and somewhat verify) all slots */ - pkgdb->slots = xcalloc(slotnpages * (PAGE_SIZE / SLOT_SIZE), sizeof(*pkgdb->slots)); + pkgdb->slots = xcalloc(slotnpages, sizeof(*pkgdb->slots) * (PAGE_SIZE / SLOT_SIZE)); i = 0; slot = pkgdb->slots; minblkoff = slotnpages * (PAGE_SIZE / BLK_SIZE); @@ -261,6 +270,8 @@ static int rpmpkgReadSlots(rpmpkgdb pkgd } pkgidx = le2h(pp + 4); blkcnt = le2h(pp + 12); + if (blkoff >= 0xffffffffU - blkcnt) + return RPMRC_FAIL; /* oversized entry */ slot->pkgidx = pkgidx; slot->blkoff = blkoff; slot->blkcnt = blkcnt; @@ -352,6 +363,8 @@ static int rpmpkgFindEmptyOffset(rpmpkgd if (!bestblkoff) { bestblkoff = lastblkend; /* append to end */ } + if (bestblkoff >= 0xffffffffU - blkcnt) + return RPMRC_FAIL; /* oversized */ *oldslotp = oldslot; *blkoffp = bestblkoff; return RPMRC_OK; @@ -513,6 +526,8 @@ static int rpmpkgValidateZero(rpmpkgdb p #define BLOBHEAD_SIZE (4 + 4 + 4 + 4) #define BLOBTAIL_SIZE (4 + 4 + 4) +#define PKGDB_MAX_BLOBSIZE (0xffffffffU - (BLOBHEAD_SIZE + BLOBTAIL_SIZE + BLK_SIZE - 1)) + static int rpmpkgReadBlob(rpmpkgdb pkgdb, unsigned int pkgidx, unsigned int blkoff, unsigned int blkcnt, unsigned char *blob, unsigned int *bloblp, unsigned int *generationp) { unsigned char buf[BLOBHEAD_SIZE > BLOBTAIL_SIZE ? BLOBHEAD_SIZE : BLOBTAIL_SIZE]; @@ -534,6 +549,8 @@ static int rpmpkgReadBlob(rpmpkgdb pkgdb return RPMRC_FAIL; /* bad blob */ generation = le2h(buf + 8); bloblen = le2h(buf + 12); + if (bloblen > PKGDB_MAX_BLOBSIZE) + return RPMRC_FAIL; /* bad blob */ if (blkcnt != (BLOBHEAD_SIZE + bloblen + BLOBTAIL_SIZE + BLK_SIZE - 1) / BLK_SIZE) return RPMRC_FAIL; /* bad blob */ adl = ADLER32_INIT; @@ -596,8 +613,8 @@ static int rpmpkgWriteBlob(rpmpkgdb pkgd off_t fileoff; /* sanity */ - if (blkcnt < (BLOBHEAD_SIZE + BLOBTAIL_SIZE + BLK_SIZE - 1) / BLK_SIZE) - return RPMRC_FAIL; /* blkcnt too small */ + if (blobl >= PKGDB_MAX_BLOBSIZE) + return RPMRC_FAIL; /* oversized blob */ if (blkcnt != (BLOBHEAD_SIZE + blobl + BLOBTAIL_SIZE + BLK_SIZE - 1) / BLK_SIZE) return RPMRC_FAIL; /* blkcnt mismatch */ fileoff = (off_t)blkoff * BLK_SIZE; @@ -687,6 +704,8 @@ static int rpmpkgMoveBlob(rpmpkgdb pkgdb static int rpmpkgAddSlotPage(rpmpkgdb pkgdb) { unsigned int cutoff; + if (pkgdb->slotnpages >= PKGDB_MAX_SLOTNPAGES) + return RPMRC_FAIL; if (!pkgdb->ordered) rpmpkgOrderSlots(pkgdb); cutoff = (pkgdb->slotnpages + 1) * (PAGE_SIZE / BLK_SIZE); @@ -961,7 +980,7 @@ int rpmpkgSalvage(rpmpkgdb *pkgdbp, cons rpmpkgClose(pkgdb); return RPMRC_FAIL; } - pkgdb->fileblks = stb.st_size / BLK_SIZE; + pkgdb->fileblks = stb.st_size / BLK_SIZE >= 0xffffffffU ? 0xffffffffU : stb.st_size / BLK_SIZE; blkskip = 1; nfound = 0; salvaged = xmalloc(64 * (4 * sizeof(unsigned int))); @@ -1088,6 +1107,8 @@ static int rpmpkgPutInternal(rpmpkgdb pk if (rpmpkgReadSlots(pkgdb)) { return RPMRC_FAIL; } + if (blobl >= 0xffffffffU - (BLOBHEAD_SIZE + BLOBTAIL_SIZE + BLK_SIZE - 1)) + return RPMRC_FAIL; blkcnt = (BLOBHEAD_SIZE + blobl + BLOBTAIL_SIZE + BLK_SIZE - 1) / BLK_SIZE; /* find a nice place for the blob */ if (rpmpkgFindEmptyOffset(pkgdb, pkgidx, blkcnt, &blkoff, &oldslot, 0)) { --- lib/backend/ndb/rpmxdb.c.orig 2025-02-19 15:29:33.000000000 +0000 +++ lib/backend/ndb/rpmxdb.c 2026-07-02 09:25:12.474104651 +0000 @@ -25,7 +25,7 @@ #include "rpmxdb.h" -typedef struct rpmxdb_s { +struct rpmxdb_s { rpmpkgdb pkgdb; /* main database */ char *filename; int fd; @@ -60,7 +60,7 @@ typedef struct rpmxdb_s { unsigned int systempagesize; int dofsync; unsigned int locked_excl; -} *rpmxdb; +}; static inline void h2le(unsigned int x, unsigned char *p) @@ -102,6 +102,11 @@ static inline void h2lea(unsigned int x, #define SLOT_SIZE 16 #define SLOT_START (XDB_HEADER_SIZE / SLOT_SIZE) +/* limits */ +#define XDB_MAX_SLOTNPAGES 0x10000 +#define XDB_MIN_PAGESIZE 0x100 +#define XDB_MAX_PAGESIZE 0x10000 + /* low level map/remap a file into memory */ static void *mapmem(void *oldaddr, size_t oldsize, size_t newsize, int prot, int fd, off_t offset) @@ -249,6 +254,10 @@ static int rpmxdbReadHeaderRaw(rpmxdb xd *usergenerationp = le2ha((unsigned char *)header + XDB_OFFSET_USERGENERATION); if (!*slotnpagesp || !*pagesizep) return RPMRC_FAIL; + if ((*pagesizep & (*pagesizep - 1)) != 0 || *pagesizep < XDB_MIN_PAGESIZE || *pagesizep > XDB_MAX_PAGESIZE) + return RPMRC_FAIL; + if (*slotnpagesp >= XDB_MAX_SLOTNPAGES) + return RPMRC_FAIL; return RPMRC_OK; } @@ -471,6 +480,10 @@ static int rpmxdbInitInternal(rpmxdb xdb xdb->slotnpages = 1; xdb->generation++; xdb->pagesize = sysconf(_SC_PAGE_SIZE); + if (xdb->pagesize > XDB_MAX_PAGESIZE) + xdb->pagesize = XDB_MAX_PAGESIZE; + if ((xdb->pagesize & (xdb->pagesize - 1)) != 0 || xdb->pagesize < XDB_MIN_PAGESIZE) + return RPMRC_FAIL; if (rpmxdbWriteEmptySlotpage(xdb, 0)) { return RPMRC_FAIL; } @@ -779,6 +792,9 @@ static int addslotpage(rpmxdb xdb) if (xdb->firstfree) return RPMRC_FAIL; + if (xdb->slotnpages >= XDB_MAX_SLOTNPAGES - 1) + return RPMRC_FAIL; + /* move first blob if needed */ nslots = xdb->nslots; for (i = xdb->slots[0].next; i != nslots; i = slot->next) { ++++++ pgpreleasemtime.diff ++++++ --- /var/tmp/diff_new_pack.9R8Cb1/_old 2026-07-06 12:28:00.462386798 +0200 +++ /var/tmp/diff_new_pack.9R8Cb1/_new 2026-07-06 12:28:00.466386937 +0200 @@ -26,14 +26,4 @@ rasprintf(&pd->timestr, "%x", pd->time); rasprintf(&pd->verid, "%d:%s-%s", pgpDigParamsVersion(pubp), pd->signid, pd->timestr); ---- rpmio/rpmpgp_legacy-1.1/rpmpgp_internal.h.orig 2025-06-02 13:27:51.345567394 +0000 -+++ rpmio/rpmpgp_legacy-1.1/rpmpgp_internal.h 2025-06-02 13:28:59.425482575 +0000 -@@ -163,7 +163,4 @@ rpmpgpRC pgpMergeKeys(const uint8_t *pkt - RPM_GNUC_INTERNAL - uint32_t pgpCurrentTime(void); - --RPM_GNUC_INTERNAL --uint32_t pgpDigParamsModificationTime(pgpDigParams digp); -- - #endif /* _RPMPGP_INTERNAL_H */ ++++++ rpm2archive.diff ++++++ --- /var/tmp/diff_new_pack.9R8Cb1/_old 2026-07-06 12:28:00.530389156 +0200 +++ /var/tmp/diff_new_pack.9R8Cb1/_new 2026-07-06 12:28:00.534389295 +0200 @@ -336,7 +336,7 @@ + return r; + } + } -+ if (tartype == '0' || tartype == '1') ++ if (tartype == '0') + size = rpmfiFSize(fi); + else if (tartype == 'x') + size = (rpm_loff_t)strlen(buf); ++++++ rpmuncompress.diff ++++++ --- tools/rpmuncompress.c.orig 2026-06-29 10:27:29.920768592 +0000 +++ tools/rpmuncompress.c 2026-06-29 10:44:12.095805763 +0000 @@ -100,6 +100,8 @@ static char * singleRoot(const char *pat struct archive *a; struct archive_entry *entry; int r, ret = -1, rootLen; + const char *p = NULL; + const char *sep = NULL; char *rootName = NULL; a = archive_read_new(); @@ -112,24 +114,32 @@ static char * singleRoot(const char *pat if (archive_read_next_header(a, &entry) != ARCHIVE_OK) { goto afree; } - rootName = xstrdup(archive_entry_pathname(entry)); - char *sep = strchr(rootName, '/'); - if (sep == NULL) { + + /* Extract the lead directory from the first entry */ + p = archive_entry_pathname(entry); + sep = strchr(p, '/'); + if (sep) { + rootName = xstrdup(p); + rootLen = sep - p + 1; + } else if (archive_entry_filetype(entry) == AE_IFDIR) { + rootName = rstrscat(NULL, p, "/", NULL); + rootLen = strlen(rootName); + } else { /* No directories in the pathname */ ret = 0; goto afree; } /* Do all entries in the archive start with the same lead directory? */ - rootLen = sep - rootName + 1; while (archive_read_next_header(a, &entry) == ARCHIVE_OK) { - const char *p = archive_entry_pathname(entry); + p = archive_entry_pathname(entry); if (strncmp(rootName, p, rootLen)) { ret = 0; goto afree; } } - *sep = '\0'; + + rootName[rootLen - 1] = '\0'; ret = 1; afree: @@ -177,8 +187,8 @@ static char *doUntar(const char *fn) rasprintf( &moveup, " && " - "(shopt -s dotglob; mv \"$tmp\"/'%s'/* '%s') && " - "rmdir \"$tmp\"/'%s' \"$tmp\" ", sr, dstpath, sr); + "(shopt -s dotglob; mv \"$tmp\"/*/* '%s') && " + "rmdir \"$tmp\"/* \"$tmp\" ", dstpath); rasprintf(&stripcd, "%s\"$tmp\" %s", at->dest, moveup); free(moveup); } else {
