From nobody Thu Dec 01 14:24:34 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 4NNJHR2Lkyz4jLGp; Thu, 1 Dec 2022 14:24:35 +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 4NNJHR1LMNz3rCd; Thu, 1 Dec 2022 14:24:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669904675; 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=EL1Mnhy4xBkSHn/1lAA3CzAJReN3dEHZJz7+cyOfh3o=; b=AEGAomtb5p0aD2ivDV2sIxcYCdlD5sb3bHazcwadH9eSQeBQP0HwmNzo6UlIkWZ1wlIe/p FusG4mbt6JHRhYs4qVG9IO+Fy/p/htnc5t1UVCN/9rXAmGGblG+BK5bg9/isGTb0vp9LPX hyQ41F5IGl1duBPhdEUWxtAujWoRekBhGfim3tNDBFpuvIthU4JP6umGF+V79cVTe1JUrH q1J0RPJk6gfSGUxp+/folVnDLuZ8D7775kJpT/fuy9HinTQobbmMhcmYF7hfX+k+sNttEq GffrRe5xqY7iMTtnZ2hK8I9xoECRbBC5Dn1cgYu0BnCuOpPKMCiW8GNpJeIc7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669904675; 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=EL1Mnhy4xBkSHn/1lAA3CzAJReN3dEHZJz7+cyOfh3o=; b=M/7hesml9mSdXy7cGVFCWtZB08gGdc65FA+I0PmlqMef9Igb/D7UfAsg9bG2eeJYWmaLGa dSmDjuLc/z2Obvk1WDrenki/15YlR3/OWDdVIQX6+IUI+iv2UPsNCqbu4uyRSGlhVa1Ykx UZpHc8OmAo/7nRNE5MuDEpbkMV0QibayJPnigdsppFojH7CnVlGZWyjCsQirwKBoJUN9Vg UAM3PnKIeJ/Or9kzSgCRoKLHNTR6orcHdYzRBuFrPyabvFrb2oXWCI91xC4+PBsYJ9FUYA RClES+L6Ju+iya1oHFtu0elbc3VmCRixJ7nYC4srlowE587ETZwOXJvBEejPdQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1669904675; a=rsa-sha256; cv=none; b=B7KaDDqWU5lXQYR6Pwx5agidGRd8Miz8Bv11zQDm2nmHP1sc4mBDaqNkyw9HXQZXGeO7t3 OxLhlJQ9gjxRsgy8f8mP21ddBlRkDp71NUKITnkfINw6V5KcG4b52OCmeV1Zc5f0UNAO4u Cnoo8guKxoodbrL8kj08F/QF114tjeh/D1UeRKrBa0PPRq8rll6b3c+PYrCVgjkSGTMxvn Jj+nvVPxot+zKSWEIhDWhxhEKzu9FL0qyfF8/1kEy721cNqiuovPX8ymhVXG/S7aG205eM geE47oiaH64iLhpU9dZv6W0H9X/owxAa1oidYoZfY0Mv1vq7fslFPf2v9LrPYw== 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 4NNJHR0S8nzg8p; Thu, 1 Dec 2022 14:24:35 +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 2B1EOYI8078799; Thu, 1 Dec 2022 14:24:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2B1EOY26078798; Thu, 1 Dec 2022 14:24:34 GMT (envelope-from git) Date: Thu, 1 Dec 2022 14:24:34 GMT Message-Id: <202212011424.2B1EOY26078798@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: 6742ff42ab3b - main - heimdal: Fix bus fault when zero-length request received 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: 6742ff42ab3b6e65239f975314060b1393e22d62 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=6742ff42ab3b6e65239f975314060b1393e22d62 commit 6742ff42ab3b6e65239f975314060b1393e22d62 Author: Cy Schubert AuthorDate: 2022-12-01 00:11:18 +0000 Commit: Cy Schubert CommitDate: 2022-12-01 14:24:12 +0000 heimdal: Fix bus fault when zero-length request received Zero length client requests result in a bus fault when attempting to free malloc()ed pointers within the requests softc. Return an error when the request is zero length. PR: 268062 Reported by: Robert Morris MFC after: 3 days --- crypto/heimdal/lib/krb5/read_message.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crypto/heimdal/lib/krb5/read_message.c b/crypto/heimdal/lib/krb5/read_message.c index 4e9bd012dd67..e994b0f09133 100644 --- a/crypto/heimdal/lib/krb5/read_message.c +++ b/crypto/heimdal/lib/krb5/read_message.c @@ -55,6 +55,11 @@ krb5_read_message (krb5_context context, return HEIM_ERR_EOF; } len = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]; + if (len == 0) { + krb5_clear_error_message(context); + return HEIM_ERR_EOF; + } + ret = krb5_data_alloc (data, len); if (ret) { krb5_clear_error_message(context);