Received: by 10.223.185.116 with SMTP id b49csp2224002wrg; Thu, 15 Feb 2018 08:21:10 -0800 (PST) X-Google-Smtp-Source: AH8x224THcWM3nf4rJFvi9U4Y6+XJkuHSjnPMFGY8HB0NKwswoeiDHv9wHx4YiSd/mUek5CIvzN8 X-Received: by 10.99.149.8 with SMTP id p8mr2562943pgd.186.1518711670349; Thu, 15 Feb 2018 08:21:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518711670; cv=none; d=google.com; s=arc-20160816; b=onluqtQKce+WIX0zIZQhps4HyxYsQcQag1677u6EDRXGJoeaid03xTGXzStfRnany9 LYk6bAWUm2Y17u+rl2Acd/T8ZR35V29yF6+eQzlfru8wYe5CkCtyKzsONCrF7XfqR9GD A+fwbKRRgaqSt9m9Kdv0DXBSq0RcXjxqmxFrkzmUl9dWRgMr6AzBW1FFBWiApnlQvWBs L2mJfk8LtLt2quPmMWqdAX40SRnjQXYi1KhzD0iRwvGRV9B/iDLd6wHsF2oudrSJykuO vVqaMljOpWwOSRzpzIMlO2S4hJ3A6oTZiHxhux1o7sMur097XYjxWI+Sm7Zvz7h+DBro zsjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=q4U3iAVRzUWbyTlHP//YQeTznXP7HqCdRsHhuGEVlvQ=; b=YLOjaVYX7R+GP+xr47CB1mgvgqbmGyVvvZP+XlBewAQPbbaf+0YrtNhXOFAgIcDdKO e8OUAL62Ex7CkpxEy7NHrQZlTfjZLxBpbDahcgVw3yTu62vbkwdWI3/sDkL/bB6/KHAq W64+hBozC6MhZKjVPYDJfQyPOIEc/ksryqbmDbaPMZ4TFonnp2iC+KJeNo9xkUzgWKW9 Ft3bTW+thaZVcFGFW/fCjffgR+3gOgQaob+kO4+rchcb2RQlDmF6CnUBA8FCCG3xlHSD DeUhHiH81pcA3woOAOxfxB6ua3fVzDrQIX/Eomm2ZARl2Do6XU9Mgx1JUTjDJS/5nPxF u0QQ== ARC-Authentication-Results: i=1; mx.google.com; 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 s14si2567910pgf.748.2018.02.15.08.20.55; Thu, 15 Feb 2018 08:21:10 -0800 (PST) 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; 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 S1165309AbeBOPnj (ORCPT + 99 others); Thu, 15 Feb 2018 10:43:39 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:34018 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1165086AbeBOPnf (ORCPT ); Thu, 15 Feb 2018 10:43:35 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 72557117F; Thu, 15 Feb 2018 15:43:34 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Biggers , Herbert Xu Subject: [PATCH 4.15 109/202] crypto: cryptd - pass through absence of ->setkey() Date: Thu, 15 Feb 2018 16:16:49 +0100 Message-Id: <20180215151718.937873847@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151712.768794354@linuxfoundation.org> References: <20180215151712.768794354@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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eric Biggers commit 841a3ff329713f796a63356fef6e2f72e4a3f6a3 upstream. 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. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- crypto/cryptd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/crypto/cryptd.c +++ b/crypto/cryptd.c @@ -911,7 +911,8 @@ static int cryptd_create_hash(struct cry inst->alg.finup = cryptd_hash_finup_enqueue; inst->alg.export = cryptd_hash_export; inst->alg.import = cryptd_hash_import; - inst->alg.setkey = cryptd_hash_setkey; + if (crypto_shash_alg_has_setkey(salg)) + inst->alg.setkey = cryptd_hash_setkey; inst->alg.digest = cryptd_hash_digest_enqueue; err = ahash_register_instance(tmpl, inst);