[packages/heimdal] Rel 6. Fix inverted arcfour checksum checks; link against used libs

arekm arekm at pld-linux.org
Thu Oct 29 08:36:25 CET 2026


commit eaff444d13d4eb1d84d8fc0c912119b42387ce2e
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Oct 29 00:33:37 2026 +0100

    Rel 6. Fix inverted arcfour checksum checks; link against used libs
    
    Fixes CVE-2022-45142.

 heimdal-CVE-2022-45142.patch | 38 ++++++++++++++++++++++++++++
 heimdal-underlinking.patch   | 60 ++++++++++++++++++++++++++++++++++++++++++++
 heimdal.spec                 |  7 +++++-
 3 files changed, 104 insertions(+), 1 deletion(-)
---
diff --git a/heimdal.spec b/heimdal.spec
index 192d2f6..6bffcfe 100644
--- a/heimdal.spec
+++ b/heimdal.spec
@@ -11,7 +11,7 @@ Summary:	Heimdal implementation of Kerberos V5 system
 Summary(pl.UTF-8):	Implementacja Heimdal systemu Kerberos V5
 Name:		heimdal
 Version:	7.8.0
-Release:	5
+Release:	6
 License:	BSD
 Group:		Networking
 #Source0Download: https://github.com/heimdal/heimdal/releases
@@ -40,6 +40,9 @@ Patch11:	%{name}-krb5config-nosysdirs.patch
 Patch12:	%{name}-tinfo.patch
 Patch13:	%{name}-missing-exports.patch
 Patch14:	find-func.patch
+# https://sources.debian.org/src/heimdal/7.8.git20221117.28daf24%2Bdfsg-9%2Bdeb13u1/debian/patches/CVE-2022-45142-gsskrb5-fix-accidental-logic-inversio.patch
+Patch15:	%{name}-CVE-2022-45142.patch
+Patch16:	%{name}-underlinking.patch
 URL:		http://www.h5l.org/
 BuildRequires:	autoconf >= 2.62
 BuildRequires:	automake >= 1:1.11
@@ -251,6 +254,8 @@ Kerberosa.
 %patch -P12 -p1
 %patch -P13 -p1
 %patch -P14 -p1
+%patch -P15 -p1
+%patch -P16 -p1
 
 %build
 install -d our-ld
diff --git a/heimdal-CVE-2022-45142.patch b/heimdal-CVE-2022-45142.patch
new file mode 100644
index 0000000..95d35da
--- /dev/null
+++ b/heimdal-CVE-2022-45142.patch
@@ -0,0 +1,38 @@
+From: Helmut Grohne <helmut at subdivi.de>
+Date: Sun, 5 Feb 2023 14:23:48 +0100
+Subject: [PATCH] CVE-2022-45142: gsskrb5: fix accidental logic inversions
+
+The referenced commit attempted to fix miscompilations with gcc-9 and
+gcc-10 by changing `memcmp(...)` to `memcmp(...) != 0`. Unfortunately,
+it also inverted the result of the comparison in two occasions. This
+inversion happened during backporting the patch to 7.7.1 and 7.8.0.
+
+Fixes: f6edaafcfefd ("gsskrb5: CVE-2022-3437 Use constant-time memcmp()
+ for arcfour unwrap")
+Signed-off-by: Helmut Grohne <helmut at subdivi.de>
+---
+ lib/gssapi/krb5/arcfour.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/gssapi/krb5/arcfour.c b/lib/gssapi/krb5/arcfour.c
+index aa03cbe..c6c15eb 100644
+--- a/lib/gssapi/krb5/arcfour.c
++++ b/lib/gssapi/krb5/arcfour.c
+@@ -365,7 +365,7 @@ _gssapi_verify_mic_arcfour(OM_uint32 * minor_status,
+ 	return GSS_S_FAILURE;
+     }
+ 
+-    cmp = (ct_memcmp(cksum_data, p + 8, 8) == 0);
++    cmp = (ct_memcmp(cksum_data, p + 8, 8) != 0);
+     if (cmp) {
+ 	*minor_status = 0;
+ 	return GSS_S_BAD_MIC;
+@@ -730,7 +730,7 @@ OM_uint32 _gssapi_unwrap_arcfour(OM_uint32 *minor_status,
+ 	return GSS_S_FAILURE;
+     }
+ 
+-    cmp = (ct_memcmp(cksum_data, p0 + 16, 8) == 0); /* SGN_CKSUM */
++    cmp = (ct_memcmp(cksum_data, p0 + 16, 8) != 0); /* SGN_CKSUM */
+     if (cmp) {
+ 	_gsskrb5_release_buffer(minor_status, output_message_buffer);
+ 	*minor_status = 0;
diff --git a/heimdal-underlinking.patch b/heimdal-underlinking.patch
new file mode 100644
index 0000000..bdeb88d
--- /dev/null
+++ b/heimdal-underlinking.patch
@@ -0,0 +1,60 @@
+libtool >= 2.6 no longer adds dependency_libs of .la files to the link line,
+so libraries must list every library whose symbols they use directly.
+
+diff -urNp -x '*.orig' heimdal-7.8.0.org/kdc/Makefile.am heimdal-7.8.0/kdc/Makefile.am
+--- heimdal-7.8.0.org/kdc/Makefile.am	2022-09-16 01:54:19.000000000 +0200
++++ heimdal-7.8.0/kdc/Makefile.am	2026-10-29 00:17:34.194133308 +0100
+@@ -111,6 +111,7 @@ libkdc_la_LIBADD = \
+ 	$(LIB_hcrypto) \
+ 	$(LIB_openssl_crypto) \
+ 	$(top_builddir)/lib/asn1/libasn1.la \
++	$(top_builddir)/lib/base/libheimbase.la \
+ 	$(LIB_roken) \
+ 	$(DB3LIB) $(DB1LIB) $(LMDBLIB) $(NDBMLIB)
+ 
+diff -urNp -x '*.orig' heimdal-7.8.0.org/lib/gssapi/Makefile.am heimdal-7.8.0/lib/gssapi/Makefile.am
+--- heimdal-7.8.0.org/lib/gssapi/Makefile.am	2022-09-16 01:54:19.000000000 +0200
++++ heimdal-7.8.0/lib/gssapi/Makefile.am	2026-10-29 00:03:08.848151251 +0100
+@@ -223,6 +223,7 @@ libgssapi_la_LIBADD = \
+ 	$(top_builddir)/lib/ntlm/libheimntlm.la \
+ 	$(top_builddir)/lib/krb5/libkrb5.la \
+ 	$(top_builddir)/lib/asn1/libasn1.la \
++	$(top_builddir)/lib/base/libheimbase.la \
+ 	$(LIB_com_err) \
+ 	$(LIB_hcrypto) \
+ 	$(LIBADD_roken)
+diff -urNp -x '*.orig' heimdal-7.8.0.org/lib/hdb/Makefile.am heimdal-7.8.0/lib/hdb/Makefile.am
+--- heimdal-7.8.0.org/lib/hdb/Makefile.am	2022-09-16 01:54:19.000000000 +0200
++++ heimdal-7.8.0/lib/hdb/Makefile.am	2026-10-29 00:03:08.852181455 +0100
+@@ -106,6 +106,7 @@ libhdb_la_LIBADD = \
+ 	$(LIB_com_err) \
+ 	../krb5/libkrb5.la \
+ 	../asn1/libasn1.la \
++	../base/libheimbase.la \
+ 	$(LIB_sqlite3) \
+ 	$(LIBADD_roken) \
+ 	$(ldap_lib) \
+diff -urNp -x '*.orig' heimdal-7.8.0.org/lib/kadm5/Makefile.am heimdal-7.8.0/lib/kadm5/Makefile.am
+--- heimdal-7.8.0.org/lib/kadm5/Makefile.am	2022-11-15 18:06:45.000000000 +0100
++++ heimdal-7.8.0/lib/kadm5/Makefile.am	2026-10-29 00:03:08.856115628 +0100
+@@ -25,7 +25,7 @@ sample_passwd_check_la_LDFLAGS = -module
+ 
+ libkadm5srv_la_LIBADD = \
+ 	$(LIB_com_err) ../krb5/libkrb5.la \
+-	../hdb/libhdb.la $(LIBADD_roken)
++	../hdb/libhdb.la ../base/libheimbase.la $(LIBADD_roken)
+ libkadm5clnt_la_LIBADD = \
+ 	$(LIB_com_err) ../krb5/libkrb5.la $(LIBADD_roken)
+ 
+diff -urNp -x '*.orig' heimdal-7.8.0.org/lib/kafs/Makefile.am heimdal-7.8.0/lib/kafs/Makefile.am
+--- heimdal-7.8.0.org/lib/kafs/Makefile.am	2022-09-16 01:54:19.000000000 +0200
++++ heimdal-7.8.0/lib/kafs/Makefile.am	2026-10-29 00:03:08.863758089 +0100
+@@ -5,7 +5,7 @@ include $(top_srcdir)/Makefile.am.common
+ AM_CPPFLAGS += $(AFS_EXTRA_DEFS) $(ROKEN_RENAME)
+ 
+ if KRB5
+-DEPLIB_krb5 = ../krb5/libkrb5.la $(LIB_hcrypto)
++DEPLIB_krb5 = ../krb5/libkrb5.la ../asn1/libasn1.la $(LIB_hcrypto)
+ krb5_am_workaround = -I$(top_srcdir)/lib/krb5
+ else
+ DEPLIB_krb5  =
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/heimdal.git/commitdiff/eaff444d13d4eb1d84d8fc0c912119b42387ce2e



More information about the pld-cvs-commit mailing list