Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp296999yba; Mon, 20 May 2019 08:53:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqxfrQj0zNnq/eLluEuUA/Zui5dxU9/CdA3aCnpu3olsX5AyFKV2L5xsG/6VDTM3QbfXIANg X-Received: by 2002:a63:1c4:: with SMTP id 187mr49143027pgb.317.1558367636508; Mon, 20 May 2019 08:53:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558367636; cv=none; d=google.com; s=arc-20160816; b=AvLJwRbsoLFPo12XV+3OEg9okTEVNMQHs+rQADt1BMeTEgHk5Hdl0xr2yXaiyarddh CMDeykgk3j4EmwDLyiXeFLu8mGWcbKPkGVuW+yc/dQKK1/XTT/6VdQ9W7DK55BNCVnfw m5XYxgdgAITVtSLFe5fM7SspPB1ZnE5rgjscy1qVd47Z6yIDTL0qTV+nF6SQZn9/BbJD 7b3dQ9e7T9e5lbnAd5IHF7nB4KF5NJxW5fEWy+cMOUT9H/juEjc2C0tCETeT0qTAb1DX VZ1hUqY6kMTf+7lOUlJeLZwlSXIz554X2wuDbLjeQnYaXRnOQt1M0kZXuz77hbSGjKPx lgdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=sTHS2xKH2fSHAupQfBYjZdjTk9GNWxx6IVU50GDW+TY=; b=aohiskD2zW04OCXzlNig0KDvbdaYMgRn5Oz3V5WLHuqPaeJdGAx7Zo9XbW+h82uNAD QY7pPYzT6ACDNOtq8dhU7WfP2qsTmiRb8TtqTUeWnW/bIjFkiUPw5X/WDx2jRvvFJWAt 6GzpPdlCx36HbKQmI9iz/4Hud5MYDMOKH87Soe5TXO2nttsEgM+OuRA3NEai44okt0bG tKY7TQ9lBjgufBVx3AvFWlHhrMH2HlOro0YjdNBrE0licseHVdY6e9Bui8l5LjgO05+d lFrWgdyIkIGzw6uxUCcmu7e+H9AG0/MChYCJKEk+a8OsIl1tj8pswNlS6HnZ6PGcfZw8 k8Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="TZfd1/SD"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h10si17658129pll.2.2019.05.20.08.53.41; Mon, 20 May 2019 08:53:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="TZfd1/SD"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388840AbfETMY2 (ORCPT + 99 others); Mon, 20 May 2019 08:24:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:39268 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388839AbfETMY0 (ORCPT ); Mon, 20 May 2019 08:24:26 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id ADA6E20645; Mon, 20 May 2019 12:24:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558355066; bh=MX77u6kdfwvVUV47sbTkHYwPbZuLAvAi0T8q94a6MjY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TZfd1/SD1Jg0Rq+alTlaPGdNt/OFwhBkQBGju/SdfAeIDHt4knzDeAeM0a9uREhWg ugkoEcJNQZlEjNwSZ8vvLAkyGvwr6kX/tXniA94uhtq0cKNges1wj1lEuNsZYzRTRa cMH/J1T92Xml4XFnT7vxdBtpGFmwBHAOLpy0yOWc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Gilad Ben-Yossef , Herbert Xu Subject: [PATCH 4.19 047/105] crypto: ccree - use correct internal state sizes for export Date: Mon, 20 May 2019 14:13:53 +0200 Message-Id: <20190520115250.270977831@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190520115247.060821231@linuxfoundation.org> References: <20190520115247.060821231@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Gilad Ben-Yossef commit f3df82b468f00cca241d96ee3697c9a5e7fb6bd0 upstream. We were computing the size of the import buffer based on the digest size but the 318 and 224 byte variants use 512 and 256 bytes internal state sizes respectfully, thus causing the import buffer to overrun. Fix it by using the right sizes. Signed-off-by: Gilad Ben-Yossef Cc: stable@vger.kernel.org # v4.19+ Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/ccree/cc_hash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/crypto/ccree/cc_hash.c +++ b/drivers/crypto/ccree/cc_hash.c @@ -1616,7 +1616,7 @@ static struct cc_hash_template driver_ha .setkey = cc_hash_setkey, .halg = { .digestsize = SHA224_DIGEST_SIZE, - .statesize = CC_STATE_SIZE(SHA224_DIGEST_SIZE), + .statesize = CC_STATE_SIZE(SHA256_DIGEST_SIZE), }, }, .hash_mode = DRV_HASH_SHA224, @@ -1641,7 +1641,7 @@ static struct cc_hash_template driver_ha .setkey = cc_hash_setkey, .halg = { .digestsize = SHA384_DIGEST_SIZE, - .statesize = CC_STATE_SIZE(SHA384_DIGEST_SIZE), + .statesize = CC_STATE_SIZE(SHA512_DIGEST_SIZE), }, }, .hash_mode = DRV_HASH_SHA384,