From nobody Thu Nov 24 17:26:43 2022 X-Original-To: dev-commits-src-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 4NJ4fq2wlkz4hhS2; Thu, 24 Nov 2022 17:26:43 +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 4NJ4fq29QCz3Q9k; Thu, 24 Nov 2022 17:26:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669310803; 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=fsFgK0u6qpHL15ILKpsMz1yGsA7w+eo/q+bAby57O7g=; b=Oz6GDZvN9PvbuINux5/9126yDwPcdb3u/DQMdPyjnViXQ4Wswqtz8EE9t7dpH1GVadSCa/ W5AwEaaZgnZRqXLvMcHy8hKjcnAuU6wJ2zu7G0xSMoiJ54x7egt5dnn/lmqeZ9yeITrhFF QBTHGUMQ8iqvrNFjJ/MsgegN4+rj+QtClnsiULkQGuYgKAkf+srtmobmdp1xkC60R5cOYR P5+UwVNuF3+rP4uEyvpkVDYpqV50sgm9WjSc3FPdWOienzfh1i8oDLtMNxW5VKzPrWUF5K 9pUsH4edIH0t8luXw4+qjrjQIFx7gHK0VvVPtyS5qTidC4BopwSTNkBLyf+6mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669310803; 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=fsFgK0u6qpHL15ILKpsMz1yGsA7w+eo/q+bAby57O7g=; b=b54ye6T5HgymEIMQsJufgZ4Mj/p+Z1Ig3RFLet+DvVhypmCvRPMiTtAvGKK+sCm1I6w1ol 7FqM6eTavIwWyfPinOD0kiRIdqtepYFJFDwMbXE1pToIvArXeufRN6mjZnsaJIVU5Y2x+p 9O38oPcpMQE8tjZDeFx1QQICISqySFfTNFG63qEXXGfbBufojEUm1Tek+ShGqEmMefbNZQ qP8/MSfataZMAgj7ga/+1eYb0ZeK2QfLxitNVF9kkPIfSkpP3uALpwdtTNGOk8LpDMpDxl rC4OV7VgTSQEsOVhE010wDtBP0/s0xRBDb4f7obTAV7V9KgpW7ssaRn+yCkDbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1669310803; a=rsa-sha256; cv=none; b=fOuOiUHRTFDP/cbgAeIecK1mIn4rNKu1tGghfDgCYrDGPrtw1geQFuG9sPXrDs9YUKlYy3 qH793/mTMDw26MzuFzfMDLNGvLAuiFVZtt24E8Tbv/g1wAAFSI+hsmFD0I5RwLaTcF2bTn FlaQUYg/o0EQhPiOcUgW9T0MU58W1QiiyH22lowYMC7oZ+cZhzqkMgO5TIPssJN33bJfU0 tkOXcUmVN3JCpTt0L+a9PLWRdOfMt2Uui5sf+IsVaicbppSExuXtSOQRLbLwNqtOxnpltb F8iXweP9oa7FuvmMXZYAfXStcQRXyINkILO1S+slOehQHUW6T8oYSkQ1ixjzdQ== 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 4NJ4fq196cz18pS; Thu, 24 Nov 2022 17:26:43 +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 2AOHQheC008917; Thu, 24 Nov 2022 17:26:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AOHQhdn008916; Thu, 24 Nov 2022 17:26:43 GMT (envelope-from git) Date: Thu, 24 Nov 2022 17:26:43 GMT Message-Id: <202211241726.2AOHQhdn008916@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 91db848212e3 - main - heimdal: Handle other types of garbage data List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-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: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 91db848212e3b95cc689a1e8133a1d550b524919 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=91db848212e3b95cc689a1e8133a1d550b524919 commit 91db848212e3b95cc689a1e8133a1d550b524919 Author: Cy Schubert AuthorDate: 2022-11-24 15:07:43 +0000 Commit: Cy Schubert CommitDate: 2022-11-24 17:23:23 +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 MFC after: 3 days --- 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: