Received: by 10.223.185.116 with SMTP id b49csp364703wrg; Thu, 15 Feb 2018 23:46:23 -0800 (PST) X-Google-Smtp-Source: AH8x225smYKtJB5CFK+QDrSiaGZ1ZypmpZTBDiMT1eX58JY1TQT7BdQVPvyg/YatoS2w9wyWAGhl X-Received: by 2002:a17:902:6a08:: with SMTP id m8-v6mr5038254plk.379.1518767183021; Thu, 15 Feb 2018 23:46:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518767182; cv=none; d=google.com; s=arc-20160816; b=nbGnsOsfsjwrx5N9ZefbzEdU10unZ/eNHNvvDqgmt6zv3GlzHa6rQ7Y+aSgszeDbSY 324eBqfYzWbPsLhNbC/QEAQhg7C25OoRXy0rAcF1sHrdqOyCHqVJM0TLLRK/JNP2zTSH vdtNA/09tOv315d8SmLtZLKcYOul5FK70WSuplKKgvVsImhTWHC2MDMx6yNDEkzE2IGs 5lc9Uw8dnpLzP8KzLKV/2Lku9ZE/ED94ID8J0vbRQxAvCw/iocWXm9Ouo3vn5BiBr42E /Em1F27eKdumkY/Vc21fQ15V/qOGe6vMz+m9jrFMtWOjMrt2MqwDlbuFL7T936hJ387y XJrg== 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=9XJLmUCZ9XRa0xJPIsEvqSAZptnBJozEU/MYdNzwPQU=; b=YK86/tGD5XFJDFqGZ1ojSKEMY9OSqojn16ylTxhe8RagSQee0W6JvCBqOcceeted4V gpJnNqq8ZjI5VR2RNw+QWnMkVuCXnXPNE6+evogNrVJYP4MNMtiKtMIuY/7tZnpxMUrS AblPBXphGSuDcZDZbIte5fyWENjLElGDzAZ65zPPAbXvbSEJUnkWjxAHz6RAJG2q9DUl OclKcvLUrRc994gCzQnooowGzI4IzDcoW4FDIKXV+p8HjJ+iYPkazxd9kdmhqLg8aHTV qK66wawd+Uvu28yJVTWMehgafaxnfLEqiqSpALV1st71qKimmHcszzyk3FLgsiXVXYNx y9aQ== 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 b5si331780pfc.337.2018.02.15.23.46.08; Thu, 15 Feb 2018 23:46:22 -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 S1165577AbeBOQUD (ORCPT + 99 others); Thu, 15 Feb 2018 11:20:03 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:34034 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1165300AbeBOPni (ORCPT ); Thu, 15 Feb 2018 10:43:38 -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 29675117F; Thu, 15 Feb 2018 15:43:37 +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 110/202] crypto: mcryptd - pass through absence of ->setkey() Date: Thu, 15 Feb 2018 16:16:50 +0100 Message-Id: <20180215151718.992101828@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 fa59b92d299f2787e6bae1ff078ee0982e80211f upstream. When the mcryptd template is used to wrap an unkeyed hash algorithm, don't install a ->setkey() method to the mcryptd instance. This change is necessary for mcryptd 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/mcryptd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/crypto/mcryptd.c +++ b/crypto/mcryptd.c @@ -535,7 +535,8 @@ static int mcryptd_create_hash(struct cr inst->alg.finup = mcryptd_hash_finup_enqueue; inst->alg.export = mcryptd_hash_export; inst->alg.import = mcryptd_hash_import; - inst->alg.setkey = mcryptd_hash_setkey; + if (crypto_hash_alg_has_setkey(halg)) + inst->alg.setkey = mcryptd_hash_setkey; inst->alg.digest = mcryptd_hash_digest_enqueue; err = ahash_register_instance(tmpl, inst);