From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sn1nam02on0130.outbound.protection.outlook.com ([104.47.36.130]:10592 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032259AbeCAPen (ORCPT ); Thu, 1 Mar 2018 10:34:43 -0500 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: Eric Biggers , Herbert Xu , Sasha Levin Subject: [added to the 4.1 stable tree] crypto: cryptd - pass through absence of ->setkey() Date: Thu, 1 Mar 2018 15:26:07 +0000 Message-ID: <20180301152116.1486-334-alexander.levin@microsoft.com> References: <20180301152116.1486-1-alexander.levin@microsoft.com> In-Reply-To: <20180301152116.1486-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: Eric Biggers This patch has been added to the 4.1 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 841a3ff329713f796a63356fef6e2f72e4a3f6a3 ] When the cryptd template is used to wrap an unkeyed hash algorithm, don't install a ->setkey() method to the cryptd instance. This change is necessary for cryptd to keep working with unkeyed hash algorithms once we start enforcing that ->setkey() is called when present. Cc: stable@vger.kernel.org Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- crypto/cryptd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto/cryptd.c b/crypto/cryptd.c index 66c9e8262572..4e76f1db3e68 100644 --- a/crypto/cryptd.c +++ b/crypto/cryptd.c @@ -645,7 +645,8 @@ static int cryptd_create_hash(struct crypto_template *t= mpl, struct rtattr **tb, inst->alg.finup =3D cryptd_hash_finup_enqueue; inst->alg.export =3D cryptd_hash_export; inst->alg.import =3D cryptd_hash_import; - inst->alg.setkey =3D cryptd_hash_setkey; + if (crypto_shash_alg_has_setkey(salg)) + inst->alg.setkey =3D cryptd_hash_setkey; inst->alg.digest =3D cryptd_hash_digest_enqueue; =20 err =3D ahash_register_instance(tmpl, inst); --=20 2.14.1