From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8403620ED; Thu, 13 Jun 2024 12:45:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718282740; cv=none; b=It19c1kS2Rn8CoGoDBos5DSj+JL9OphNhUl0tap9/7Awt2Lw/q29OVrLoIaTTWP9JeosnI191o1SVxv650YCpLMib/609SYm4r0Ez52/QBTijjJ/eHnWdHaqEMxSItiZ43GWl93BgDtiv5m+KHfMvlhBuo7a/C/A2e89SADUIik= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718282740; c=relaxed/simple; bh=MyaCdDpDDfsEw+AM6ktWCRww5s+EjmqK951C0cE4mok=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qEWe+Uexv3VOgZAfh7oOCkA531F4MqZ/S9eNdcF7OKGVqhZtyiEpbQGJ57IoH3i+V7Rie7HRwvbZ2vMlECXGDyNDIcSl31rD9TDo3zdobL/72fbr7+j94C4D/XjUo0dIliAhU5Zl7bq4utzkzD3VZj4cFG5i+svWEkt9JOn/HO8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=DGS1WS+H; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="DGS1WS+H" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0884BC2BBFC; Thu, 13 Jun 2024 12:45:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718282740; bh=MyaCdDpDDfsEw+AM6ktWCRww5s+EjmqK951C0cE4mok=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DGS1WS+HzvCiE9B84yub3ukoCV971YXQLkx1J7pTUE9T9NPshxHADEfGqeZ83N7CZ KOjcMcAU2meAEbaECQVF0qgSYWZolyp1DvkPwDGSisASGVEmCizHcZ4rgM6hEQGR3A +Q6vcZZjX+7h3Ccgm5nTbiKYrDrv+SDiGIsPQxGw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Stefan Berger , Vitaly Chikunov , Herbert Xu Subject: [PATCH 5.15 378/402] crypto: ecdsa - Fix module auto-load on add-key Date: Thu, 13 Jun 2024 13:35:35 +0200 Message-ID: <20240613113316.889054388@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240613113302.116811394@linuxfoundation.org> References: <20240613113302.116811394@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Stefan Berger commit 48e4fd6d54f54d0ceab5a952d73e47a9454a6ccb upstream. Add module alias with the algorithm cra_name similar to what we have for RSA-related and other algorithms. The kernel attempts to modprobe asymmetric algorithms using the names "crypto-$cra_name" and "crypto-$cra_name-all." However, since these aliases are currently missing, the modules are not loaded. For instance, when using the `add_key` function, the hash algorithm is typically loaded automatically, but the asymmetric algorithm is not. Steps to test: 1. Create certificate openssl req -x509 -sha256 -newkey ec \ -pkeyopt "ec_paramgen_curve:secp384r1" -keyout key.pem -days 365 \ -subj '/CN=test' -nodes -outform der -out nist-p384.der 2. Optionally, trace module requests with: trace-cmd stream -e module & 3. Trigger add_key call for the cert: # keyctl padd asymmetric "" @u < nist-p384.der 641069229 # lsmod | head -2 Module Size Used by ecdsa_generic 16384 0 Fixes: c12d448ba939 ("crypto: ecdsa - Register NIST P384 and extend test suite") Cc: stable@vger.kernel.org Signed-off-by: Stefan Berger Reviewed-by: Vitaly Chikunov Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- crypto/ecdsa.c | 3 +++ 1 file changed, 3 insertions(+) --- a/crypto/ecdsa.c +++ b/crypto/ecdsa.c @@ -373,4 +373,7 @@ module_exit(ecdsa_exit); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Stefan Berger "); MODULE_DESCRIPTION("ECDSA generic algorithm"); +MODULE_ALIAS_CRYPTO("ecdsa-nist-p192"); +MODULE_ALIAS_CRYPTO("ecdsa-nist-p256"); +MODULE_ALIAS_CRYPTO("ecdsa-nist-p384"); MODULE_ALIAS_CRYPTO("ecdsa-generic");