All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Linux Crypto Mailing List <linux-crypto@vger.kernel.org>,
	Vladis Dronov <vdronov@redhat.com>,
	Simo Sorce <ssorce@redhat.com>,
	Eric Biggers <ebiggers@kernel.org>
Subject: Re: [v2 PATCH] crypto: api - Fix built-in testing dependency failures
Date: Tue, 26 Oct 2021 09:33:19 -0700	[thread overview]
Message-ID: <20211026163319.GA2785420@roeck-us.net> (raw)
In-Reply-To: <20210917002619.GA6407@gondor.apana.org.au>

Hi,

On Fri, Sep 17, 2021 at 08:26:19AM +0800, Herbert Xu wrote:
> 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.
> 
> In the past we have used subsystem initialisation ordering to
> guarantee this.  The number of such precedence levels are limited
> and they may cause ripple effects in other subsystems.
> 
> This patch solves this problem by delaying all self-tests during
> boot-up for built-in algorithms.  They will be tested either when
> something else in the kernel requests for them, or when we have
> finished registering all built-in algorithms, whichever comes
> earlier.
> 
> Reported-by: Vladis Dronov <vdronov@redhat.com>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
> 

I can not explain it, but this patch causes a crash with one of my boot
tests (riscv32 with riscv32 virt machine and e1000 network adapter):

[    9.948557] e1000 0000:00:01.0: enabling device (0000 -> 0003)
[    9.968578] Unable to handle kernel paging request at virtual address 9e000000
[    9.969207] Oops [#1]
[    9.969325] Modules linked in:
[    9.969619] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.15.0-rc6-next-20211025 #1
[    9.969983] Hardware name: riscv-virtio,qemu (DT)
[    9.970262] epc : e1000_io_write+0x10/0x1c
[    9.970487]  ra : e1000_reset_hw+0xfa/0x312
[    9.970639] epc : c07b3a44 ra : c07b5e4a sp : c258dcf0
[    9.970792]  gp : c1d6cfa0 tp : c25b0040 t0 : c1f05b3c
[    9.970941]  t1 : 04d6d7d4 t2 : 00001fff s0 : c258dd00
[    9.971091]  s1 : c36a9990 a0 : c36a9990 a1 : 9e000000
[    9.971240]  a2 : 00000000 a3 : 04000000 a4 : 00000002
[    9.971389]  a5 : 9e000000 a6 : 00000000 a7 : 00006000
[    9.971539]  s2 : c101b3ec s3 : c23aceb0 s4 : 04140240
[    9.971692]  s5 : 00000000 s6 : c14a3550 s7 : c1d72000
[    9.971872]  s8 : 00000000 s9 : c36a9000 s10: 00000000
[    9.972037]  s11: 00000000 t3 : cb75ee6c t4 : 0000000c
[    9.972200]  t5 : 000021cb t6 : c1f017a0
[    9.972336] status: 00000120 badaddr: 9e000000 cause: 0000000f
[    9.972570] [<c07b3a44>] e1000_io_write+0x10/0x1c
[    9.973382] ---[ end trace 49388ec34793549e ]---
[    9.973873] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b

Bisect log is attached. Reverting this patch fixes the problem. The problem
is always seen with this patch applied, and is never seen with this patch
reverted.

Any idea what might be going on, and how to debug the problem ?

Thanks,
Guenter

---
# bad: [2376e5fe91bcad74b997d2cc0535abff79ec73c5] Add linux-next specific files for 20211026
# good: [3906fe9bb7f1a2c8667ae54e967dc8690824f4ea] Linux 5.15-rc7
git bisect start 'HEAD' 'v5.15-rc7'
# bad: [18298270669947b661fe47bf7ec755a6d254c464] Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
git bisect bad 18298270669947b661fe47bf7ec755a6d254c464
# good: [7294cee5cd18f89b0070ac8b0cd872cc663896de] Merge branch 'i3c/next' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux.git
git bisect good 7294cee5cd18f89b0070ac8b0cd872cc663896de
# good: [a7021af707a3637c963ce41802b650db6793eb8a] usb: smsc: use eth_hw_addr_set()
git bisect good a7021af707a3637c963ce41802b650db6793eb8a
# good: [5c511d28b9596fda6c550b0f0c3b163f6dac7e54] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git
git bisect good 5c511d28b9596fda6c550b0f0c3b163f6dac7e54
# good: [0969becb5f7661fb0db1a5d6b60f3d7f046ff6a7] s390/qeth: improve trace entries for MAC address (un)registration
git bisect good 0969becb5f7661fb0db1a5d6b60f3d7f046ff6a7
# good: [57edc4d2baac9210564ffe8ea333aabacdce650c] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git
git bisect good 57edc4d2baac9210564ffe8ea333aabacdce650c
# good: [a84f7cc76f5d33450e9fc6e681df1e1bf716773e] Merge branch 'nand/next' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git
git bisect good a84f7cc76f5d33450e9fc6e681df1e1bf716773e
# bad: [38aa192a05f22f9778f9420e630f0322525ef12e] crypto: ecc - fix CRYPTO_DEFAULT_RNG dependency
git bisect bad 38aa192a05f22f9778f9420e630f0322525ef12e
# good: [ba79a32acfde1ffdaefc05b02420c4124b60dbd3] crypto: qat - replace deprecated MSI API
git bisect good ba79a32acfde1ffdaefc05b02420c4124b60dbd3
# good: [81f53028dfbc79844f727a7c13d337ba827a471c] crypto: drbg - Fix unused value warning in drbg_healthcheck_sanity()
git bisect good 81f53028dfbc79844f727a7c13d337ba827a471c
# good: [ca605f97dae4bf070b7c584aec23c1c922e4d823] crypto: qat - power up 4xxx device
git bisect good ca605f97dae4bf070b7c584aec23c1c922e4d823
# bad: [adad556efcdd42a1d9e060cbe5f6161cccf1fa28] crypto: api - Fix built-in testing dependency failures
git bisect bad adad556efcdd42a1d9e060cbe5f6161cccf1fa28
# good: [7c5329697ed4e0e1bf9a4e4fc9f0053f2f58935d] crypto: marvell/cesa - drop unneeded MODULE_ALIAS
git bisect good 7c5329697ed4e0e1bf9a4e4fc9f0053f2f58935d
# first bad commit: [adad556efcdd42a1d9e060cbe5f6161cccf1fa28] crypto: api - Fix built-in testing dependency failures

  parent reply	other threads:[~2021-10-26 16:33 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13  7:12 [PATCH] crypto: api - Fix built-in testing dependency failures Herbert Xu
2021-09-13 18:16 ` Eric Biggers
2021-09-14  3:28   ` Herbert Xu
2021-09-17  0:26 ` [v2 PATCH] " Herbert Xu
2021-09-28 18:32   ` Nathan Chancellor
2021-10-01  5:50     ` Herbert Xu
2021-10-01 10:58       ` Naresh Kamboju
2021-10-01 10:58         ` Naresh Kamboju
2021-10-01 18:01       ` Nathan Chancellor
2021-10-03  0:28         ` Herbert Xu
2021-10-06  2:33           ` Nathan Chancellor
2021-10-19 13:28             ` [PATCH] crypto: api - Do not create test larvals if manager is disabled Herbert Xu
2021-11-02 15:41               ` Geert Uytterhoeven
2021-11-04  7:28                 ` Damien Le Moal
2021-11-04  7:58                   ` Geert Uytterhoeven
2021-11-04  8:05                     ` Damien Le Moal
2021-11-04 12:16                     ` Herbert Xu
2021-11-04 13:11                       ` Geert Uytterhoeven
2021-11-04 13:30                         ` Herbert Xu
2021-11-04 15:18                           ` Ido Schimmel
2021-11-05  7:26                             ` crypto: api - Fix boot-up crash when crypto " Herbert Xu
2021-11-05 14:33                               ` Ido Schimmel
2021-11-05 18:00                               ` Geert Uytterhoeven
2021-10-26 16:33   ` Guenter Roeck [this message]
2021-10-27  2:59     ` [v2 PATCH] crypto: api - Fix built-in testing dependency failures Herbert Xu
2021-10-27  3:48       ` Guenter Roeck
2021-11-06  3:47     ` Herbert Xu
2021-11-06 14:55       ` Guenter Roeck
2021-12-22 10:22         ` Uwe Kleine-König
2021-12-22 10:37           ` Uwe Kleine-König
2021-12-29  2:05           ` Herbert Xu
2021-12-29 11:05             ` Uwe Kleine-König
2022-03-16  1:10               ` Herbert Xu
2022-03-16 16:37                 ` Uwe Kleine-König
2022-03-16 21:44                   ` Uwe Kleine-König
2022-03-16 22:38                     ` Herbert Xu
2022-03-16 22:55                   ` [PATCH] crypto: arm/aes-neonbs-cbc - Select generic cbc and aes Herbert Xu
2022-03-17  7:11                     ` Uwe Kleine-König
2022-03-17  9:16                     ` Philipp Zabel
2022-03-17 22:15                       ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211026163319.GA2785420@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=ebiggers@kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=ssorce@redhat.com \
    --cc=vdronov@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.