From nobody Thu Mar 16 17:45:36 2023 X-Original-To: dev-commits-src-all@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 4Pcvmw6zlVz3yNjD; Thu, 16 Mar 2023 17:45:36 +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 4Pcvmw6V4lz3wHF; Thu, 16 Mar 2023 17:45:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678988736; 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=Np3PuO9GLChkUd1uAd/owebFSK+1hk0HfoIvx7a2xQs=; b=ytzkKLuRg6b4rtKh+m/ZAe95o1JLPJ8TcBBRxzO7dZqjX4cwo0D/WB3Q9ecnOoTOmKRq1d 5NqKmoj8/zD3igPklzEg0oJ3kZ/g7VpTP5coafI1VSnNOFYDu4QnC3Yw1Hu+fr8q1zCEQz 9a4+NErzx+E/wgn/heSkt8qTTOOW00k3XB8zWz8cPN5fEZmDQHgS8kcMwedG/vOuMsYiiL h2/Pf/dGFfdtite1V6MSB/3JG626bZAYwUdu0es41apYF/TQGfXZEx6K7iSp++p+j8CR6M 49fFdJARi5WpQEm+whT/bBFOaH63cBoSOCOFXZcqG/xg2DoY9/BrWu6ag7ksPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678988736; 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=Np3PuO9GLChkUd1uAd/owebFSK+1hk0HfoIvx7a2xQs=; b=R0yfir7b9Y7oQRxInG5ZNIUzGoFpP0NGUnCYe4Vuid9Ck6725k9OSb7swaT2sMm6OHKAoV a1PEYNfK37RvoanShJaxjsHeWtNrDiRwb5pjr4YUcdqNOIEEgZhC273F19LRwTuezT1K6X 3lA7H8A3ZX3qC09Q2Sxf9yBCOd589G70r8yK3bDxmSwM61hLA5sKvzB6kePqrL2fVrvey/ TbMfN1Qi1eR7zFiDRfA19S1sb9dYFjZe942LeF+yLQv4R0+Z1ffNSsC5LcNZWe6+IATcX5 u6awbuT10+MY8ZbeT6lMXj6RYBHrNq1e9BPHFHbBDVaWPbwREzMBQMDTlxWaWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678988736; a=rsa-sha256; cv=none; b=yBuUH0JLvm1cXotZig1AMz3XfS/g7Xogcv9C2rV/r64tlq8af1XporqnKO5aXuUPRmSHc0 PvlqlOMP5PUfvyNX4zFGTxvFl3EIrZ80pcLOwnsTOnukqROvgjkjKbYGPaOXVGuxTwzZXM UT22I5XB9a2AGmnBCsW69qizKBpmZ5I/2XdXInVEeK/vlgB7LslQstf1b00Se0RNp1NwPd gImEokWWuXO3TGhusGjn6GCOHbuyks6SNWGTn/rla/L86+iVDIo6PfqBt2h7s9ni9VL3TK RslrwFEkPU9qfKaolQ5uxv+D5c/ss1VIduVfDsVI9wHh+EPiEEbf0IyM9o+T1Q== 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 4Pcvmw5bhYzsrp; Thu, 16 Mar 2023 17:45:36 +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 32GHja5w020629; Thu, 16 Mar 2023 17:45:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GHjaFm020628; Thu, 16 Mar 2023 17:45:36 GMT (envelope-from git) Date: Thu, 16 Mar 2023 17:45:36 GMT Message-Id: <202303161745.32GHjaFm020628@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 0c0c89736597 - releng/13.2 - heimdal: Resolve hdb_free_entry() SIGSEGV/SIGILL List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 0c0c89736597709fec9cffd5b3b2703470995674 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0c0c89736597709fec9cffd5b3b2703470995674 commit 0c0c89736597709fec9cffd5b3b2703470995674 Author: Cy Schubert AuthorDate: 2023-02-07 15:46:59 +0000 Commit: Ed Maste CommitDate: 2023-03-16 17:44:57 +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 Approved by: re (cperciva) (cherry picked from commit 6a70e0b4cdc606931555cdc59dc6c8d4a3ab4e3e) (cherry picked from commit 75b5693ed73e4abb6dbb90affbf3ba56c4cdfdc4) --- 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)