From nobody Thu Nov 24 17:27:07 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NJ4gH6bQ5z4hhST; Thu, 24 Nov 2022 17:27:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NJ4gH68Mqz3hJC; Thu, 24 Nov 2022 17:27:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669310827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SoQ0KuCdUcXT32V7ID0vyYlhWAQ0qD38Ij+0RdekyAg=; b=u4nMXP6jFroEh+op02N29GrsRyhlRmdXyJce0SjWZEbUURh30BfAkd/5TRPtbmJxoAMSxs CVvCHnGK7iXNYIqLGBnxxZFfd/VeRqxD7T1muxuBuWaGs5KtEVzSAVbJCNt6ekHm3yEcp0 IzIAd/5pAKYt3BXoAWjCUE2Am3vFL6/0N120dprq5fLA/ZoHnrRgy7/GqsQRgv/xPGKIzN 1luJp61Vmc94YwTi2K8JVvOvndYkLIvatQFK9r4c2XCsVgFa1SeqZaGq7tjqCCQHpAAa70 O0by/Oov08gzzmsbF0tnlvXqLtgu9F7jBHE5pkxrmgNCWZk6bx/wn5YIrxUtyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669310827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SoQ0KuCdUcXT32V7ID0vyYlhWAQ0qD38Ij+0RdekyAg=; b=fljYJaiWLXl3BkT7KbXl+ambCR+OsGJBPMJjOA5SnhiJcR7yagQ0SwHp6wkc4zOVzvfSwp nWjY1zdhxSRFrslj5Z2Mlzb0DDQ1liTKFMvwOJ2INdMO4a27TEewdXYPu0U3Ij1sbujuE/ 0Y/DX6pcVU2WS6qeLGh2hXtBJzvOABuLUwci97w7ISCOEdyLIRKkSY6DkKipCdQ7p4YAy/ kKFEP7w7ANDTfaRHJ0UNDPfimj2g8agJmZdpDsUlI6JhwfYrtn9f20v22aJMx6jVF7Or3M m2zmExlNT5S6jRscQ8xrxwkvTUJcozug9SRJRgYxyeIlENZA/MJ4sP4T/9zSjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1669310827; a=rsa-sha256; cv=none; b=JIheFu+toLRslYO6JNPf/k4bUuWF+xyPIFt3xuCVT6qKsucBFyWAmoNLTnhS60B8Qsz+jm mb2u7lwbF279p+so/vbeGL3718wYom5J3t3LGESQYDROqnCPo5qKV4uY64JFo8f40pGJYs qPs8Vww+NgdnT0Rld7QYRFM73T6H1PijSLnqGAy99OrETgfQfV2y9JFiq7JvdJUkNYbos9 QGZ1k36t5nZYoA+BG7PHtJVMHIdB6LGAqHplO3jpWLinNUa9WHOAa9XgtFKf6o7juxTZNd iJWgZeW6Cv+bfPjwHuoQqLPpXZWd3ZNVHIAMwT3CGbGmzc/eSQ5E+cLqd2dMpA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NJ4gH50v8z18Yr; Thu, 24 Nov 2022 17:27:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2AOHR7hj009244; Thu, 24 Nov 2022 17:27:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AOHR7hv009243; Thu, 24 Nov 2022 17:27:07 GMT (envelope-from git) Date: Thu, 24 Nov 2022 17:27:07 GMT Message-Id: <202211241727.2AOHR7hv009243@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Cy Schubert Subject: git: 678bdaf21b9a - main - security/heimdal*: Fix NULL dereference when mangled realm message List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 678bdaf21b9a05d99e0aceecd414782926e57ae4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/ports/commit/?id=678bdaf21b9a05d99e0aceecd414782926e57ae4 commit 678bdaf21b9a05d99e0aceecd414782926e57ae4 Author: Cy Schubert AuthorDate: 2022-11-24 16:37:45 +0000 Commit: Cy Schubert CommitDate: 2022-11-24 17:22:01 +0000 security/heimdal*: Fix NULL dereference when mangled realm message Fix a NULL dereference in _kadm5_s_init_context() when the client sends a mangled realm message. PR: 267912 Reported by: Robert Morris MFH: 2022Q4 --- security/heimdal-devel/Makefile | 2 +- security/heimdal-devel/files/patch-lib_kadm5_marshall.c | 16 ++++++++++++++++ security/heimdal/Makefile | 2 +- security/heimdal/files/patch-kadmin_server.c | 13 +++++++++++++ security/heimdal/files/patch-lib_kadm5_marshall.c | 16 ++++++++++++++++ 5 files changed, 47 insertions(+), 2 deletions(-) diff --git a/security/heimdal-devel/Makefile b/security/heimdal-devel/Makefile index 5d03e274c83c..bdd92c199ab5 100644 --- a/security/heimdal-devel/Makefile +++ b/security/heimdal-devel/Makefile @@ -1,6 +1,6 @@ PORTNAME= heimdal PORTVERSION= ${HEIMDAL_COMMIT_DATE} -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= security PKGNAMESUFFIX= -devel HASH= 8f9c2d115 diff --git a/security/heimdal-devel/files/patch-lib_kadm5_marshall.c b/security/heimdal-devel/files/patch-lib_kadm5_marshall.c new file mode 100644 index 000000000000..8cc79bafcc8c --- /dev/null +++ b/security/heimdal-devel/files/patch-lib_kadm5_marshall.c @@ -0,0 +1,16 @@ +--- lib/kadm5/marshall.c.orig 2022-11-17 16:55:32.000000000 -0800 ++++ lib/kadm5/marshall.c 2022-11-24 08:17:04.255672000 -0800 +@@ -465,8 +465,12 @@ + goto out; + params->mask = mask; + +- if(params->mask & KADM5_CONFIG_REALM) ++ if (params->mask & KADM5_CONFIG_REALM) { + ret = krb5_ret_string(sp, ¶ms->realm); ++ if (params->realm == NULL) { ++ ret = EINVAL; ++ } ++ } + out: + krb5_storage_free(sp); + diff --git a/security/heimdal/Makefile b/security/heimdal/Makefile index 3d92a0c2fd3b..93995fde6703 100644 --- a/security/heimdal/Makefile +++ b/security/heimdal/Makefile @@ -1,6 +1,6 @@ PORTNAME= heimdal PORTVERSION= 7.8.0 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= security MASTER_SITES= https://github.com/heimdal/heimdal/releases/download/${DISTNAME}/ diff --git a/security/heimdal/files/patch-kadmin_server.c b/security/heimdal/files/patch-kadmin_server.c new file mode 100644 index 000000000000..d4a2439f3bdb --- /dev/null +++ b/security/heimdal/files/patch-kadmin_server.c @@ -0,0 +1,13 @@ +--- kadmin/server.c.orig 2022-09-15 16:54:19.000000000 -0700 ++++ kadmin/server.c 2022-11-24 08:26:55.919761000 -0800 +@@ -787,7 +787,9 @@ + ret = krb5_read_priv_message(contextp, ac, &fd, ¶ms); + if(ret) + krb5_err(contextp, 1, ret, "krb5_read_priv_message"); +- _kadm5_unmarshal_params(contextp, ¶ms, &realm_params); ++ ret = _kadm5_unmarshal_params(contextp, ¶ms, &realm_params); ++ if(ret) ++ krb5_err(contextp, 1, ret, "_kadm5_unmarshal_params"); + } + + initial = ticket->ticket.flags.initial; diff --git a/security/heimdal/files/patch-lib_kadm5_marshall.c b/security/heimdal/files/patch-lib_kadm5_marshall.c new file mode 100644 index 000000000000..d02a364d7011 --- /dev/null +++ b/security/heimdal/files/patch-lib_kadm5_marshall.c @@ -0,0 +1,16 @@ +--- lib/kadm5/marshall.c.orig 2022-09-15 16:54:19.000000000 -0700 ++++ lib/kadm5/marshall.c 2022-11-24 08:26:55.920305000 -0800 +@@ -409,8 +409,12 @@ + goto out; + params->mask = mask; + +- if(params->mask & KADM5_CONFIG_REALM) ++ if (params->mask & KADM5_CONFIG_REALM) { + ret = krb5_ret_string(sp, ¶ms->realm); ++ if (params->realm == NULL) { ++ ret = EINVAL; ++ } ++ } + out: + krb5_storage_free(sp); +