]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
crypto: simd - Do not call crypto_alloc_tfm during registration
authorHerbert Xu <herbert@gondor.apana.org.au>
Sat, 17 Aug 2024 06:58:35 +0000 (14:58 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Oct 2024 10:00:19 +0000 (12:00 +0200)
commit0f5b3a38318accd7a1651ca40d33af338ea41d6a
treeed8a261ad007980c8a12f22a237a42b71960374d
parent7ab21518d1d23a0e55cf8d622e769955c4772441
crypto: simd - Do not call crypto_alloc_tfm during registration

[ Upstream commit 3c44d31cb34ce4eb8311a2e73634d57702948230 ]

Algorithm registration is usually carried out during module init,
where as little work as possible should be carried out.  The SIMD
code violated this rule by allocating a tfm, this then triggers a
full test of the algorithm which may dead-lock in certain cases.

SIMD is only allocating the tfm to get at the alg object, which is
in fact already available as it is what we are registering.  Use
that directly and remove the crypto_alloc_tfm call.

Also remove some obsolete and unused SIMD API.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm/crypto/aes-ce-glue.c
arch/arm/crypto/aes-neonbs-glue.c
crypto/simd.c
include/crypto/internal/simd.h