]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
crypto: api - Fix boot-up self-test race
authorHerbert Xu <herbert@gondor.apana.org.au>
Fri, 15 Nov 2024 01:29:02 +0000 (09:29 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 10 Dec 2024 05:44:20 +0000 (13:44 +0800)
commit8dd458cbc5be9ce4427ffce7a9dcdbff4dfc4ac9
treefc673d1590a7415263918d13a0a6e8d582a20712
parent15589bda46830695a3261518bb7627afac61f519
crypto: api - Fix boot-up self-test race

During the boot process self-tests are postponed so that all
algorithms are registered when the test starts.  In the event
that algorithms are still being registered during these tests,
which can occur either because the algorithm is registered at
late_initcall, or because a self-test itself triggers the creation
of an instance, some self-tests may never start at all.

Fix this by setting the flag at the start of crypto_start_tests.

Note that this race is theoretical and has never been observed
in practice.

Fixes: adad556efcdd ("crypto: api - Fix built-in testing dependency failures")
Signed-off-by: Herbert Xu <herbert.xu@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/algapi.c