Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jun 2026 13:12:11 +0000
From:      Cy Schubert <cy@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 27691b8b9303 - stable/15 - krb5: Fix reachable assert when importing krb5 names
Message-ID:  <6a2ffa2b.30ee0.1444e6af@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch stable/15 has been updated by cy:

URL: https://cgit.FreeBSD.org/src/commit/?id=27691b8b9303c6fec89a6dcb9c56f8c8f0f5e69c

commit 27691b8b9303c6fec89a6dcb9c56f8c8f0f5e69c
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2026-06-02 18:09:43 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2026-06-15 13:11:49 +0000

    krb5: 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
    MFC after:      3 days
    
    (cherry picked from commit fce16f60de9718be6b789f00e86141a84cd920d3)
---
 crypto/krb5/src/lib/gssapi/krb5/import_name.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/crypto/krb5/src/lib/gssapi/krb5/import_name.c b/crypto/krb5/src/lib/gssapi/krb5/import_name.c
index a067d0742331..b4c29b442511 100644
--- a/crypto/krb5/src/lib/gssapi/krb5/import_name.c
+++ b/crypto/krb5/src/lib/gssapi/krb5/import_name.c
@@ -297,7 +297,8 @@ import_name(OM_uint32 *minor_status, gss_buffer_t input_name_buffer,
                     goto fail_name;
                 cp += length;
             }
-            assert(cp == end);
+            if (cp != end)
+		goto fail_name;
         } else {
             status = GSS_S_BAD_NAMETYPE;
             goto cleanup;


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a2ffa2b.30ee0.1444e6af>