Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934849AbdCXSDk (ORCPT ); Fri, 24 Mar 2017 14:03:40 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:35454 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754579AbdCXSCq (ORCPT ); Fri, 24 Mar 2017 14:02:46 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rui Wang , Herbert Xu , Sumit Semwal Subject: [PATCH 4.4 04/30] crypto: cryptd - Assign statesize properly Date: Fri, 24 Mar 2017 18:58:43 +0100 Message-Id: <20170324151221.050044862@linuxfoundation.org> X-Mailer: git-send-email 2.12.1 In-Reply-To: <20170324151220.759111698@linuxfoundation.org> References: <20170324151220.759111698@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1085 Lines: 34 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Wang, Rui Y commit 1a07834024dfca5c4bed5de8f8714306e0a11836 upstream. cryptd_create_hash() fails by returning -EINVAL. It is because after 8996eafdc ("crypto: ahash - ensure statesize is non-zero") all ahash drivers must have a non-zero statesize. This patch fixes the problem by properly assigning the statesize. Signed-off-by: Rui Wang Signed-off-by: Herbert Xu Cc: Sumit Semwal Signed-off-by: Greg Kroah-Hartman --- crypto/cryptd.c | 1 + 1 file changed, 1 insertion(+) --- a/crypto/cryptd.c +++ b/crypto/cryptd.c @@ -642,6 +642,7 @@ static int cryptd_create_hash(struct cry inst->alg.halg.base.cra_flags = type; inst->alg.halg.digestsize = salg->digestsize; + inst->alg.halg.statesize = salg->statesize; inst->alg.halg.base.cra_ctxsize = sizeof(struct cryptd_hash_ctx); inst->alg.halg.base.cra_init = cryptd_hash_init_tfm;