mbox series

[5.10,0/4] Fix built-in testing dependency failures

Message ID 20230415101158.1648486-1-cuigaosheng1@huawei.com
Headers show
Series Fix built-in testing dependency failures | expand

Message

Gaosheng Cui April 15, 2023, 10:11 a.m. UTC
When complex algorithms that depend on other algorithms are built
into the kernel, the order of registration must be done such that
the underlying algorithms are ready before the ones on top are
registered. As otherwise they would fail during the self-test
which is required during registration.

We can enable fips=1 and ecdh, the calltrace like below:

alg: ecdh: test failed on vector 2, err=-14
Kernel panic - not syncing: alg: self-tests for ecdh-generic (ecdh)
failed in fips mode!
Call Trace:
 dump_stack+0x57/0x6e
 panic+0x109/0x2ca
 alg_test+0x414/0x420
 ? __switch_to_asm+0x3a/0x60
 ? __switch_to_asm+0x34/0x60
 ? __schedule+0x263/0x640
 ? crypto_acomp_scomp_free_ctx+0x30/0x30
 cryptomgr_test+0x22/0x40
 kthread+0xf9/0x130
 ? kthread_park+0x90/0x90
 ret_from_fork+0x22/0x30

adad556efcd ("crypto: api - Fix built-in testing dependency failures") will
fix the issue, and others fix its bugs.

So we can merge them into linux-5.10-y to fix it, thanks!

Herbert Xu (4):
  crypto: api - Fix built-in testing dependency failures
  crypto: api - Do not create test larvals if manager is disabled
  crypto: api - Export crypto_boot_test_finished
  crypto: api - Fix boot-up crash when crypto manager is disabled

 crypto/algapi.c   | 125 +++++++++++++++++++++++++++++++---------------
 crypto/api.c      |  50 +++++++++++++++++--
 crypto/internal.h |  10 ++++
 3 files changed, 141 insertions(+), 44 deletions(-)