From nobody Sun Nov 27 02:44:07 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 4NKXx42XWnz4hmWC; Sun, 27 Nov 2022 02:44:08 +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 4NKXx41bwpz3R0K; Sun, 27 Nov 2022 02:44:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669517048; 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=NclS6OwwnSflS9dpU37ZElp63y9NI3QZeQdIqnistWc=; b=tX2GwXFEul85ojprFIJ3i3UvXDDiNvMQ9jwWifnw7jViT0Ib+LErEDitk0s3ABViuY+SKa 9JshHnff02EXt0Mv6G8BQ31bsV21wK1ufUz2yx7dCRqX158khcVf3H41ArNCqpqi/nXGlq bpIUiLSCniaa18dCxZlLAR3+jEyfkU9k57QjQ1YAv3G6fASDZ05/+jmdf4flb1bPTIH9NC U5oTxbOfV5cjqxlVOU3QmClSryggiZSibRETE0DK9GDHinUj1IV6FjJ3OEar33MadeZHHQ A2bYXOn79P+Vkmnjv9KZgLN2g4+W+R/eNG+I8iGXOpTI+rb7dkQ83EGWUp9iDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669517048; 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=NclS6OwwnSflS9dpU37ZElp63y9NI3QZeQdIqnistWc=; b=XN4gY1jJ7SUjxWz4fTOdIo5DH/UDOpFokjX0KYMFOol8Mzo4cNZyERwbRBVsgGEVm2t65A vBhikFFd98nGU7bjgDsXl7f7t0xbQJxX3/sYSk27ibZQzsegr/+EIu/ZrQ3fBsJ3T91TBN JmmVE5sQlbQLygrqlzBwsutDkGulilAnYXKz62TE07K2vX1PQ7bTfcvcOb15cYYRM42Y9F a90PZugmoExQRNUF7RB6gy5QFI743XDojUuf8l/0x+EE1SjPqWN9TcNFrd4or6HA52ALSt iwYQX99/LWfcJZrOtvf/1iGWVksnq3zfELMYxZvJ6L4dS1wtoPXce9FC54a5TA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1669517048; a=rsa-sha256; cv=none; b=LYAqUiFw5cbdWiXtxDAWVtKqFzOAN6qhzuhYMgfWyES9arKQVVZ0lTkbzRcnbGroQLySFY myM+V7melGXPuGtnI1bD7Fh7y5cFpMf2bqk/3E9C1DyS77tP131X1qyN+tA1DSr+pqIIlJ 9AufmReZA6Rle4yqBTnLiDjF8LdjNs59xRTNzqJDFkIVqDr+3KckDOTsAbqITSE996hQ2x bqRV/lZVZcakxdSW79+EhRStIikfTugiuBfY4p3FdodZaD+BCe0VcuQn45iBWlI1fWv9uC iR9pVhNjXEY0IA727K4tMHe/HacVNcmpFVqdW1l2sUkPXFenMlgzKmQzoNTLeA== 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 4NKXx40dVLzjJl; Sun, 27 Nov 2022 02:44:08 +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 2AR2i7kM088353; Sun, 27 Nov 2022 02:44:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AR2i7FO088352; Sun, 27 Nov 2022 02:44:07 GMT (envelope-from git) Date: Sun, 27 Nov 2022 02:44:07 GMT Message-Id: <202211270244.2AR2i7FO088352@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: 671f55828d03 - main - heimdal: Check return code from _hdb_fetch_kvno() 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: 671f55828d038e17fb29fd115b88e7cdf53500c3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=671f55828d038e17fb29fd115b88e7cdf53500c3 commit 671f55828d038e17fb29fd115b88e7cdf53500c3 Author: Cy Schubert AuthorDate: 2022-11-26 20:18:03 +0000 Commit: Cy Schubert CommitDate: 2022-11-27 02:41:52 +0000 heimdal: Check return code from _hdb_fetch_kvno() A malformed principal will cause kadmind to segfault. The PR addresses only when chpass is requested but delete is also affected. Fix both. PR: 268002 Reported by: Robert Morris MFC after: 3 days --- crypto/heimdal/lib/kadm5/chpass_s.c | 2 +- crypto/heimdal/lib/kadm5/delete_s.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/heimdal/lib/kadm5/chpass_s.c b/crypto/heimdal/lib/kadm5/chpass_s.c index d5407d1549f4..624293e5c3a3 100644 --- a/crypto/heimdal/lib/kadm5/chpass_s.c +++ b/crypto/heimdal/lib/kadm5/chpass_s.c @@ -168,7 +168,7 @@ kadm5_s_chpass_principal_with_key(void *server_handle, return ret; ret = context->db->hdb_fetch_kvno(context->context, context->db, princ, 0, HDB_F_GET_ANY|HDB_F_ADMIN_DATA, &ent); - if(ret == HDB_ERR_NOENTRY) + if(ret) goto out; ret = _kadm5_set_keys2(context, &ent.entry, n_key_data, key_data); if(ret) diff --git a/crypto/heimdal/lib/kadm5/delete_s.c b/crypto/heimdal/lib/kadm5/delete_s.c index 7f8f537b06c0..fb5a52970ab9 100644 --- a/crypto/heimdal/lib/kadm5/delete_s.c +++ b/crypto/heimdal/lib/kadm5/delete_s.c @@ -50,7 +50,7 @@ kadm5_s_delete_principal(void *server_handle, krb5_principal princ) } ret = context->db->hdb_fetch_kvno(context->context, context->db, princ, HDB_F_DECRYPT|HDB_F_GET_ANY|HDB_F_ADMIN_DATA, 0, &ent); - if(ret == HDB_ERR_NOENTRY) + if (ret) goto out; if(ent.entry.flags.immutable) { ret = KADM5_PROTECT_PRINCIPAL;