From nobody Tue Feb 14 18:33:44 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 4PGVGK1nLmz3ppbh; Tue, 14 Feb 2023 18:33:45 +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 4PGVGK16tYz3l8Z; Tue, 14 Feb 2023 18:33:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676399625; 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=G3yoPsD4UNvCwLZowvVRrBoBIOoCpuDka3cNfSS836w=; b=xpRMU5pxpjw0zoctHrBW6AvZrJN54h+wVKOU9honqzIwl1w+EJjN+GXrqXc/Y6crQkNW8j ZK6WR9lCzNY8opFm/S0/fT/SfS+iXtyTq4MJkTO9p4decYZFsSV3wG/n5dfB/H8iZ1j8vN h4tqaUbnyRUylNpkKKpUXeIA5GuVK2r02OV3CDC6OO1SMQT+KPz2JVxehqnuMWRhk2knVE o53WvxQHmz0Ud4+UcCff9UcjpOXDutcA3xPXF9D0iycShxEEY9cspk96fzL5Wiknd10SsG /+YVbqkURzcLv8i5bLkRRLSP1Z91M/pTryIvUhFih0P5Wk7GKe+soDW0tXuMrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676399625; 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=G3yoPsD4UNvCwLZowvVRrBoBIOoCpuDka3cNfSS836w=; b=DfNFDlAzpjRPjsgLgD+KV0iW6y84nCwZOVQ25wISx2k8qSwLSP7o34FkAEPlZKjjMfUe+I l5SZDHxuz1dJwUjPOQ8pEkXsMybgkIs0w2ccGI2GtJByYzZga20QsYPyfUfN08Qjv/d/WS I3btwvzmF0FhWTmqa+CIGT6uPTJ4FT4KsC32h9kC78uoLiyoQ+aQMtSjrKxM1sspUhFNWW ZOmJlfogRxzdidC29oyWZyaw8WH0BgJjXCyxch0P8GBy8jUAlgQMDtBwmoxUD0Pfg3+R2F Uz4RxxYLhBDYC/ptDJfmAv0ir2cYxvUB0ptpP93kGiZtlgEiemzkHetyNuo5iA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676399625; a=rsa-sha256; cv=none; b=aeQ3ePUejNxsExklR7RnT/CTEe0fG6euTnEpL78am8bCDgeViiGRF1GgY+MnYT04mI63jq oW787qltuab62u1nJHPMKr5vXnxMgrJehQIkchkBLmUMP5UgLcczcMyIZ/WxTyIGv+9t1m V9k2XOgmO01o/6MYeGqflz9StVSLfkk9TdgcpaLlGgzIV71uAUGgBzqYyveRLeAaZ4VdOm zECBzDNC9SnwO0jS6EN1dKnwaJTSAoHLN3d46NKkrba+VtUbZtxPUCGdZYIAX0R4R2uUy6 LHnVW2tOCdj85mSEMBB/bRctDbMgYd3GMo4Gl7cz6QEUenCO1899PqYWWWu/Sg== 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 4PGVGK088Sz18Rg; Tue, 14 Feb 2023 18:33:45 +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 31EIXiRI001806; Tue, 14 Feb 2023 18:33:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31EIXi3d001805; Tue, 14 Feb 2023 18:33:44 GMT (envelope-from git) Date: Tue, 14 Feb 2023 18:33:44 GMT Message-Id: <202302141833.31EIXi3d001805@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: 75b5693ed73e - stable/13 - 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: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 75b5693ed73e4abb6dbb90affbf3ba56c4cdfdc4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=75b5693ed73e4abb6dbb90affbf3ba56c4cdfdc4 commit 75b5693ed73e4abb6dbb90affbf3ba56c4cdfdc4 Author: Cy Schubert AuthorDate: 2023-02-07 15:46:59 +0000 Commit: Cy Schubert CommitDate: 2023-02-14 18:32:26 +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)