From nobody Tue Feb 14 18:35:12 2023 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 4PGVJ10N83z3pq0h; Tue, 14 Feb 2023 18:35:13 +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 4PGVJ06yqNz3mbD; Tue, 14 Feb 2023 18:35:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676399713; 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=dhvau4MiBYQM7JP7Mwtd76z2uTaZ25a8lA4UzSh3TDU=; b=eQvrqwP4yFwhnZBjU/OgM4yiw45wjwSLXE/fQePsyx4XG2Xs0EOoGst6ur5V2samgkzUBE LgxO7ML25CyeH7GuXS+6u8UzkwX1J/fXyPBK1szn1UGAZ51R7W/7VQKzfaidC+AXARUvAY VQaAnfD+Z9+EjHFNcr3WDDXMAMaHFiQ/gJOxC+0TpML/Lhy1cjkCFamE3pyvIc+WI1JCI5 ueH9lp50U1gSuxnXIWAG4CQ5L0QaKymJslkwtKBPHSQO5LVWr2UNtWawd8dWM/Ekjncjnp yJrxQD5j+t5QU7p/3ybYSbCfXov2bB0o91wbn9GuxUq/H3ZX3byL0DarZUWOQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676399713; 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=dhvau4MiBYQM7JP7Mwtd76z2uTaZ25a8lA4UzSh3TDU=; b=m7vuYXr+/aUH+sYx1zre3I/V9QnEttSdFit3NgCRC2T7lnVoyAFMKYR4M7h+yaQsMtyfJw sbjWrOn9iuwkxCLOIxur4Y46eYx/g+FZvo5KYgxmTNkeGZyJFC5LtiwG5jYcJCnKCiV1D5 U9wJVqWM4IfjT/nrl/JbcKM/IyxWwtakprvCHywrVDuD3CrwdGban63NoyQ4aZ/aoX2Daw h1pcMmCF13Mi3HJeKhSv+z8EvSbJRBvbUnkus6iCZVGDCOdlzivpSXJZpd4q9Lj1+CWeHi GnoN9jN59Q+ymxu5Wj7lb5zKk1XSNNd76IpDzM5TUjTW8LV59DGX2FFyihzXrw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676399713; a=rsa-sha256; cv=none; b=S3B1Cudy3ksHNgYB9bBvPIi9H2fMA1KKrzIhMar1ab3oi5YPzU4sxxyIMgMvtDPd/xzHtV oQtX8EvQMMQ024ZS816y13ZB721mJme/flDcQ3gKi2GtQfgjmvQczErZK7S3YDn6qZ4j4b fYnAX2nn/CSlWL+6MT3tU6Rlld7NgfiglaSIFd13Phav7svYAqEXDJ9L5DpPj9txyzzRmz cGbS5SbiAt+Qvt8Z3wWxOPN5ujWe2l58lKnljXqIwoXBr5P10l/kYrG0uhlXHsUSO3kchf b73KAQWaQ9nkwazUnnOllAKqRSX8erLc9wp65Iv+TzUYVTqzVHou435OI+zR1g== 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 4PGVJ061Jmz18Ls; Tue, 14 Feb 2023 18:35:12 +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 31EIZCvp002200; Tue, 14 Feb 2023 18:35:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EIZC9T002199; Tue, 14 Feb 2023 18:35:12 GMT (envelope-from git) Date: Tue, 14 Feb 2023 18:35:12 GMT Message-Id: <202302141835.31EIZC9T002199@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: 8d5dfe721e0f - stable/12 - heimdal: Resolve hdb_free_entry() SIGSEGV/SIGILL 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/12 X-Git-Reftype: branch X-Git-Commit: 8d5dfe721e0f52a2c2379c08356706b05f862927 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=8d5dfe721e0f52a2c2379c08356706b05f862927 commit 8d5dfe721e0f52a2c2379c08356706b05f862927 Author: Cy Schubert AuthorDate: 2023-02-07 15:46:59 +0000 Commit: Cy Schubert CommitDate: 2023-02-14 18:34:27 +0000 heimdal: Resolve hdb_free_entry() SIGSEGV/SIGILL When the client sends kadmind a create principal (kadm_create) request kadm_s_create_principal() returns an error before zeroing out ent (an hdb entry structure wrapper -- hdb_entry_ex), resulting in a NULL reference. Fix obtained from upstream commit 35ea4955a. PR: 268059 Reported by: Robert Morris Obtained from: Heimdal commit 35ea4955a (cherry picked from commit 6a70e0b4cdc606931555cdc59dc6c8d4a3ab4e3e) --- crypto/heimdal/lib/kadm5/create_s.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/heimdal/lib/kadm5/create_s.c b/crypto/heimdal/lib/kadm5/create_s.c index 04312c024ed3..1033ca103239 100644 --- a/crypto/heimdal/lib/kadm5/create_s.c +++ b/crypto/heimdal/lib/kadm5/create_s.c @@ -65,6 +65,7 @@ create_principal(kadm5_server_context *context, kadm5_principal_ent_rec defrec, *defent; uint32_t def_mask; + memset(ent, 0, sizeof(*ent)); if((mask & required_mask) != required_mask) return KADM5_BAD_MASK; if((mask & forbidden_mask)) @@ -72,7 +73,6 @@ create_principal(kadm5_server_context *context, if((mask & KADM5_POLICY) && strcmp(princ->policy, "default")) /* XXX no real policies for now */ return KADM5_UNK_POLICY; - memset(ent, 0, sizeof(*ent)); ret = krb5_copy_principal(context->context, princ->principal, &ent->entry.principal); if(ret)