Re: CI: Selftest failures of s390 SHA3 and HMAC on next kernel

Herbert Xu
2025-05-23T11:41:21Z

On Thu, May 22, 2025 at 04:13:59PM +0200, Ingo Franzki wrote:
>
> May 22 15:59:44 b3545036.lnxne.boe kernel: alg: ahash: sha3-224-s390 test failed (wrong result) on test vector "random: psize=388 ksize=0", cfg="random: may_sleep use_final src_divs=[<flush>100.0%@+2585] key_offset=82"
> May 22 15:59:44 b3545036.lnxne.boe kernel: alg: self-tests for sha3-224 using sha3-224-s390 failed (rc=-22)

I have no idea what's going on with the sha3 export state, perhaps
the hardware just stores things in a different byte-order?

Please apply this debugging patch and send me the results on s390.
It goes on top of commit 0413bcf0fc460a68a2a7a8354aee833293d7d693.
If you've already reverted 18c438b228558e05ede7dccf947a6547516fc0c7
you would need to reapply it first.

Thanks,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index 737064b31480..42aaf2e7c164 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -158,7 +158,7 @@ struct alg_test_desc {
} suite;
};

-static void hexdump(unsigned char *buf, unsigned int len)
+static void hexdump(const unsigned char *buf, unsigned int len)
{
print_hex_dump(KERN_CONT, "", DUMP_PREFIX_OFFSET,
16, 1,
@@ -1485,6 +1485,11 @@ static int check_ahash_export(struct ahash_request *req,
driver, err, vec_name, cfg->name);
return err;
}
+ if (!memcmp(driver, "sha3", 4) && memcmp(hashstate, vec->state, 200)) {
+ pr_err("alg: ahash: sha3 export state different from generic: %s\n", driver);
+ hexdump(vec->state, 200);
+ hexdump(hashstate, 200);
+ }
err = crypto_ahash_import(req, vec->state);
if (err) {
pr_err("alg: ahash: %s mixed import() failed with err %d on test vector %s, cfg=\"%s\"\n",