git: 8854e0201abe - main - security/krb5-12?: Fix reachable assert when importing krb5 names
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 08 Jun 2026 14:57:50 UTC
The branch main has been updated by cy:
URL: https://cgit.FreeBSD.org/ports/commit/?id=8854e0201abe6c8292d0360c23a8be7201240016
commit 8854e0201abe6c8292d0360c23a8be7201240016
Author: Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2026-06-08 14:55:03 +0000
Commit: Cy Schubert <cy@FreeBSD.org>
CommitDate: 2026-06-08 14:57:37 +0000
security/krb5-12?: Fix reachable assert when importing krb5 names
If a name token contains trailing garbage, error out from
krb5_gss_import_name() instead of crashing the process with an
assertion failure.
Commit message details obtained from upstream commit.
Obtained from: upstream commit 07818f1fd
Reported by: Aisle Research (Ze Sheng, Dmitrijs Trizna,
Luigino Camastra, Guido Vranken) to krb5-bugs
MFH: 2026Q2
---
security/krb5-121/Makefile | 2 +-
security/krb5-121/files/patch-lib_gssapi_krb5_import__name.c | 12 ++++++++++++
security/krb5-122/Makefile | 2 +-
security/krb5-122/files/patch-lib_gssapi_krb5_import__name.c | 12 ++++++++++++
4 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/security/krb5-121/Makefile b/security/krb5-121/Makefile
index 5de464022eaa..572b0531d90f 100644
--- a/security/krb5-121/Makefile
+++ b/security/krb5-121/Makefile
@@ -1,6 +1,6 @@
PORTNAME= krb5
PORTVERSION= 1.21.3
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= security
MASTER_SITES= http://web.mit.edu/kerberos/dist/${PORTNAME}/${PORTVERSION:C/^[0-9]*\.[0-9]*/&X/:C/X\.[0-9]*$//:C/X//}/
.if !defined(MASTERDIR)
diff --git a/security/krb5-121/files/patch-lib_gssapi_krb5_import__name.c b/security/krb5-121/files/patch-lib_gssapi_krb5_import__name.c
new file mode 100644
index 000000000000..fc99a2ad893f
--- /dev/null
+++ b/security/krb5-121/files/patch-lib_gssapi_krb5_import__name.c
@@ -0,0 +1,12 @@
+--- lib/gssapi/krb5/import_name.c.orig 2026-06-08 07:48:11.489573000 -0700
++++ lib/gssapi/krb5/import_name.c 2026-06-08 07:49:18.639094000 -0700
+@@ -302,7 +302,8 @@
+ goto fail_name;
+ cp += length;
+ }
+- assert(cp == end);
++ if (cp != end)
++ goto fail_name;
+ } else {
+ status = GSS_S_BAD_NAMETYPE;
+ goto cleanup;
diff --git a/security/krb5-122/Makefile b/security/krb5-122/Makefile
index ba1c1c249666..ea9d71fa098a 100644
--- a/security/krb5-122/Makefile
+++ b/security/krb5-122/Makefile
@@ -1,6 +1,6 @@
PORTNAME= krb5
PORTVERSION= 1.22.2
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= security
MASTER_SITES= http://web.mit.edu/kerberos/dist/${PORTNAME}/${PORTVERSION:C/^[0-9]*\.[0-9]*/&X/:C/X\.[0-9]*$//:C/X//}/
.if !defined(MASTERDIR)
diff --git a/security/krb5-122/files/patch-lib_gssapi_krb5_import__name.c b/security/krb5-122/files/patch-lib_gssapi_krb5_import__name.c
new file mode 100644
index 000000000000..fc99a2ad893f
--- /dev/null
+++ b/security/krb5-122/files/patch-lib_gssapi_krb5_import__name.c
@@ -0,0 +1,12 @@
+--- lib/gssapi/krb5/import_name.c.orig 2026-06-08 07:48:11.489573000 -0700
++++ lib/gssapi/krb5/import_name.c 2026-06-08 07:49:18.639094000 -0700
+@@ -302,7 +302,8 @@
+ goto fail_name;
+ cp += length;
+ }
+- assert(cp == end);
++ if (cp != end)
++ goto fail_name;
+ } else {
+ status = GSS_S_BAD_NAMETYPE;
+ goto cleanup;