Bug#1066883: alg: ecdh-nist-p256: test failed on vector 2, err=-14
Control: tags -1 + moreinfo
Hi,
On Thu, Mar 14, 2024 at 09:41:18PM +0000, Tj wrote:
> Source: linux
> Severity: important
>
> Same as: Bug #1061262
>
> I've been seeing this with builds since 6.7 cycle started. It seems to
> show up mostly for hosts with bluetooth hardware since the bluetooth
> module depends on ecdh. The trace indicates ecdh_generic is still
> loading when the test is attempted.
>
> journalctl --grep 'alg: self-tests for ecdh-nist-p256' |
> grep -- '-- Boot' |
> while read -r a b hash d; do
> journalctl --boot $hash | head -n 1 |
> grep -oE 'version [^ ]+'
> done |
> sort -u
>
> version 6.7.0-rc5+debian+tj
> version 6.7.1+debian+tj
> version 6.7.4+debian+tj
> version 6.8.0+debian+tj
>
> crypto algo self-tests 'alg: ecdh-nist-p256: test failed on vector 2, err=-14
>
> -14 is "EFAULT 14 / Bad address */
>
> and the log shows
>
> Modules linked in: ecdh_generic(+) ...
>
> where the "(+)" means module loading.
>
> This only seems to occur on hosts with Bluetooth hardware and "bluetooth" module (requires ECDH) when those modules are in the initrd.img.
>
> It feels like the self-tests are running before the module is fully loaded - in fact the tcrypt module (CONFIG_CRYPTO_TEST) isn't loaded according to "Modules linked in:" report and it isn't contained in the initrd.img so these tests seem to be occuring without it.
>
> root@t300chi:/tmp/initrd# unmkinitramfs /boot/initrd.img-6.8.0+debian+tj .
> root@t300chi:/tmp/initrd# ls
> early main
> root@t300chi:/tmp/initrd# ls main/usr/lib/modules/6.8.0+debian+tj/kernel/crypto/
> af_alg.ko algif_skcipher.ko async_tx crc32c_generic.ko crct10dif_common.ko crct10dif_generic.ko ecc.ko ecdh_generic.ko xor.ko xts.ko
> root@t300chi:/tmp/initrd# ls main/usr/lib/modules/6.8.0+debian+tj/kernel/drivers/bluetooth/
> btbcm.ko btintel.ko btmtk.ko btrtl.ko btusb.ko
> root@t300chi:/tmp/initrd# ls main/usr/lib/modules/6.8.0+debian+tj/kernel/net/bluetooth/
> bluetooth.ko
> root@t300chi:/tmp/initrd# find . /usr/lib/modules/6.8.0+debian+tj/kernel -type f -name '*tcrypt*'
> /usr/lib/modules/6.8.0+debian+tj/kernel/crypto/tcrypt.ko.xz
>
>
> Mar 14 06:30:29 t300chi kernel: alg: ecdh-nist-p256: test failed on vector 2, err=-14
> Mar 14 06:30:29 t300chi kernel: alg: self-tests for ecdh-nist-p256 using ecdh-nist-p256-generic failed (rc=-14)
> Mar 14 06:30:29 t300chi kernel: ------------[ cut here ]------------
> Mar 14 06:30:29 t300chi kernel: alg: self-tests for ecdh-nist-p256 using ecdh-nist-p256-generic failed (rc=-14)
> Mar 14 06:30:29 t300chi kernel: WARNING: CPU: 0 PID: 197 at crypto/testmgr.c:5888 alg_test+0x42b/0x580
> Mar 14 06:30:29 t300chi kernel: Modules linked in: ecdh_generic(+) ecc crc16 sd_mod t10_pi crc64_rocksoft crc64 crc_t10dif crct10dif_generic crct10dif_commo>
> Mar 14 06:30:29 t300chi kernel: CPU: 0 PID: 197 Comm: cryptomgr_test Not tainted 6.8.0+debian+tj #158
> Mar 14 06:30:29 t300chi kernel: Hardware name: ASUSTeK COMPUTER INC. T300CHI/T300CHI, BIOS T300CHI.209 04/18/2019
> Mar 14 06:30:29 t300chi kernel: RIP: 0010:alg_test+0x42b/0x580
> Mar 14 06:30:29 t300chi kernel: Code: 89 ea 48 89 ee 4c 89 f7 e8 d2 e8 ff ff 41 89 c0 e9 36 fd ff ff 44 89 c1 48 89 ea 4c 89 e6 48 c7 c7 58 9c 2b 8a e8 b5 0>
> Mar 14 06:30:29 t300chi kernel: RSP: 0018:ffffa53a80627e08 EFLAGS: 00010282
> Mar 14 06:30:29 t300chi kernel: RAX: 0000000000000000 RBX: 0000000000001e00 RCX: 0000000000000000
> Mar 14 06:30:29 t300chi kernel: RDX: 0000000000000002 RSI: 0000000000000002 RDI: 00000000ffffffff
> Mar 14 06:30:29 t300chi kernel: RBP: ffff8e5241213800 R08: 0000000000000867 R09: 0000000000ffff0a
> Mar 14 06:30:29 t300chi kernel: R10: 0000000000000001 R11: 20726f6620737473 R12: ffff8e5241213880
> Mar 14 06:30:29 t300chi kernel: R13: 0000000000000008 R14: 0000000000000078 R15: 0000000000000000
> Mar 14 06:30:29 t300chi kernel: FS: 0000000000000000(0000) GS:ffff8e5357000000(0000) knlGS:0000000000000000
> Mar 14 06:30:29 t300chi kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> Mar 14 06:30:29 t300chi kernel: CR2: 00007f389404ee24 CR3: 000000007761c001 CR4: 00000000003706f0
> Mar 14 06:30:29 t300chi kernel: DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> Mar 14 06:30:29 t300chi kernel: DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> Mar 14 06:30:29 t300chi kernel: Call Trace:
> Mar 14 06:30:29 t300chi kernel: <TASK>
> Mar 14 06:30:29 t300chi kernel: ? alg_test+0x42b/0x580
> Mar 14 06:30:29 t300chi kernel: ? __warn+0x7d/0x130
> Mar 14 06:30:29 t300chi kernel: ? alg_test+0x42b/0x580
> Mar 14 06:30:29 t300chi kernel: ? report_bug+0x18d/0x1c0
> Mar 14 06:30:29 t300chi kernel: ? handle_bug+0x3c/0x70
> Mar 14 06:30:29 t300chi kernel: ? exc_invalid_op+0x13/0x60
> Mar 14 06:30:29 t300chi kernel: ? asm_exc_invalid_op+0x16/0x20
> Mar 14 06:30:29 t300chi kernel: ? alg_test+0x42b/0x580
> Mar 14 06:30:29 t300chi kernel: ? alg_test+0x42b/0x580
> Mar 14 06:30:29 t300chi kernel: ? finish_task_switch.isra.0+0x9b/0x2f0
> Mar 14 06:30:29 t300chi kernel: ? __schedule+0x3c7/0xb70
> Mar 14 06:30:29 t300chi kernel: ? _raw_spin_unlock_irqrestore+0x1e/0x40
> Mar 14 06:30:29 t300chi kernel: ? __pfx_cryptomgr_test+0x10/0x10
> Mar 14 06:30:29 t300chi kernel: cryptomgr_test+0x20/0x40
> Mar 14 06:30:29 t300chi kernel: kthread+0xf3/0x120
> Mar 14 06:30:29 t300chi kernel: ? __pfx_kthread+0x10/0x10
> Mar 14 06:30:29 t300chi kernel: ret_from_fork+0x30/0x50
> Mar 14 06:30:29 t300chi kernel: ? __pfx_kthread+0x10/0x10
> Mar 14 06:30:29 t300chi kernel: ret_from_fork_asm+0x1b/0x30
> Mar 14 06:30:29 t300chi kernel: </TASK>
> Mar 14 06:30:29 t300chi kernel: ---[ end trace 0000000000000000 ]---
If you can reproduce that with a current upstream kernel, can you
please forward it to upstream and loop back the report here?
Thanks already,
Regards,
Salvatore
Reply to: