From nobody Thu Dec 01 14:25:28 2022 X-Original-To: dev-commits-src-branches@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 4NNJJS2cYQz4jLDV; Thu, 1 Dec 2022 14:25:28 +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 4NNJJS1p2dz3s6H; Thu, 1 Dec 2022 14:25:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669904728; 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=zIQT2WBiJv+aRA4S5tvmgOYLTnIS8KPMmWgXzNEMPxU=; b=XEyzeaGY44fKIpA59RCgT05CLiPlHpquM0rXikIU/s1y38ZswPOGXZhzaPmJ6HTYtwWInS 9w3476J4Nuq/ogyabvxdMyCxZSMcIu3yQ3XDGdGaJhxxG1STruRPHjX0qJDz5lw8d+w28T aMpp4xrmsDeDi/VxtuIytHqwpNFb8OhqQUOX+e1e6+T+II3RZ5PmWQfZmXXzu2yFqaJmif 1dNq/p5kTW04KK1tkPy8lZgms56GbiVT4E1BSgWvIDA/tTivm20m8gOoN+yLm8vxx2Uway 7+qI25U0O2XLyDfQ1PIfoxsWrkfVQl1f9jDq47GfKqr332kMaLoVUvikO1XjsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669904728; 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=zIQT2WBiJv+aRA4S5tvmgOYLTnIS8KPMmWgXzNEMPxU=; b=tcNAcy9cFo3IVnnX9rCxd7KZ5FrQgLFCduc+fKV5pm8Xry5HpY1gaPwaIiv2+trb4SJpeX oB/qCakQ61jILhKUOgEIq1EPDIOb/B13DOkbj4jIr5hq5D11U7DS41QIziYXPaR7YJIq6u AtAMGKBIZINx2zEbtwiN1igfCn7+gfZmRqNQj4KPp3ym3Ze21tnZWUl2sfL/qejKlG8+Un vUWbj2MsgR0hYD5bPg6dxYV3fbfGrf9YG2X6sKuUa8r2AguGWuHYA2JiJ2bG55Dfm91Ny3 s27a+OKtFEf/RkhKHJLq3MQu8oIZXeRsZKQ6ws4MS+TGApe6UJ1bnDrAtVpZSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1669904728; a=rsa-sha256; cv=none; b=bQyzKqn1Y1Fxjq5LiEqYWVsTT3BGzw73LG6npWXlcpHSdYGWK6DE/vYx8VJY4X6I3E8bBv OH7VDqC9dF6Tf+CwW49TKP7RL72tDmwE9eSm2afliBf979y4BnitN7RKcjm+CwALav2qxc RPt6LaimxwpEiDa+qgD98S1aGt5IpLOfNEB72J0gMhWzl/oTrLHcaWkcf6tsNXeUwgXKmA ur02+xH1PeahrQiyEmHefiAwbxYlIDiDdKkj0z+b1/oR1VmC77WjdU7/aqB3fZzwAwCnTA VQ0C53UJS1PIrcv8um/CPu2zUsJr8E5Oo643MEOgdXI2j/y3KH4PN3N4RU0ueQ== 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 4NNJJS0h99zfxT; Thu, 1 Dec 2022 14:25:28 +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 2B1EPSb2079110; Thu, 1 Dec 2022 14:25:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2B1EPS85079109; Thu, 1 Dec 2022 14:25:28 GMT (envelope-from git) Date: Thu, 1 Dec 2022 14:25:28 GMT Message-Id: <202212011425.2B1EPS85079109@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 53c5d72d287a - stable/13 - heimdal: Handle other types of garbage data List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 53c5d72d287ae04a5adafe2a50f11a176c26ffe8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=53c5d72d287ae04a5adafe2a50f11a176c26ffe8 commit 53c5d72d287ae04a5adafe2a50f11a176c26ffe8 Author: Cy Schubert AuthorDate: 2022-11-24 15:07:43 +0000 Commit: Cy Schubert CommitDate: 2022-12-01 14:25:10 +0000 heimdal: Handle other types of garbage data In addition to garbage realm data, also handle garbage dbname, acl_file, stash_file, and invalid bitmask garbage data. PR: 267912 Reported by: Robert Morris (cherry picked from commit 91db848212e3b95cc689a1e8133a1d550b524919) --- crypto/heimdal/lib/kadm5/marshall.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/crypto/heimdal/lib/kadm5/marshall.c b/crypto/heimdal/lib/kadm5/marshall.c index 38b9855021b2..fa7388b692fe 100644 --- a/crypto/heimdal/lib/kadm5/marshall.c +++ b/crypto/heimdal/lib/kadm5/marshall.c @@ -333,12 +333,38 @@ _kadm5_unmarshal_params(krb5_context context, ret = krb5_ret_int32(sp, &mask); if (ret) goto out; + if (mask & KADM5_CONFIG_REALM & KADM5_CONFIG_DBNAME + & KADM5_CONFIG_ACL_FILE & KADM5_CONFIG_STASH_FILE) { + ret = EINVAL; + goto out; + } params->mask = mask; if (params->mask & KADM5_CONFIG_REALM) { ret = krb5_ret_string(sp, ¶ms->realm); if (params->realm == NULL) { ret = EINVAL; + goto out; + } + } + if (params->mask & KADM5_CONFIG_DBNAME) { + ret = krb5_ret_string(sp, ¶ms->dbname); + if (params->dbname == NULL) { + ret = EINVAL; + goto out; + } + } + if (params->mask & KADM5_CONFIG_ACL_FILE) { + ret = krb5_ret_string(sp, ¶ms->acl_file); + if (params->acl_file == NULL) { + ret = EINVAL; + goto out; + } + } + if (params->mask & KADM5_CONFIG_STASH_FILE) { + ret = krb5_ret_string(sp, ¶ms->stash_file); + if (params->stash_file == NULL) { + ret = EINVAL; } } out: