Return-Path: Received: from mail-bn3nam01on0133.outbound.protection.outlook.com ([104.47.33.133]:58170 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753986AbeARVA1 (ORCPT ); Thu, 18 Jan 2018 16:00:27 -0500 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: "Wang, Rui Y" , Herbert Xu , Sasha Levin Subject: [added to the 4.1 stable tree] crypto: mcryptd - Fix load failure Date: Thu, 18 Jan 2018 20:59:51 +0000 Message-ID: <20180118205908.3220-52-alexander.levin@microsoft.com> References: <20180118205908.3220-1-alexander.levin@microsoft.com> In-Reply-To: <20180118205908.3220-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: "Wang, Rui Y" This patch has been added to the stable tree. If you have any objections, please let us know. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [ Upstream commit ddef482420b1ba8ec45e6123a7e8d3f67b21e5e3 ] mcryptd_create_hash() fails by returning -EINVAL, causing any driver using mcryptd to fail to load. It is because it needs to set its statesize properly. Signed-off-by: Rui Wang Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- crypto/mcryptd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/crypto/mcryptd.c b/crypto/mcryptd.c index fe5b495a434d..cfb68a889ef6 100644 --- a/crypto/mcryptd.c +++ b/crypto/mcryptd.c @@ -526,6 +526,7 @@ static int mcryptd_create_hash(struct crypto_template *= tmpl, struct rtattr **tb, inst->alg.halg.base.cra_flags =3D type; =20 inst->alg.halg.digestsize =3D salg->digestsize; + inst->alg.halg.statesize =3D salg->statesize; inst->alg.halg.base.cra_ctxsize =3D sizeof(struct mcryptd_hash_ctx); =20 inst->alg.halg.base.cra_init =3D mcryptd_hash_init_tfm; --=20 2.11.0