summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorHoria Geantă2018-09-12 15:20:48 +0200
committerGreg Kroah-Hartman2018-11-13 20:08:45 +0100
commit94c7bb6598567a663835efdbf8377ee4fbe9426d (patch)
tree7a9560a44fead33644a586b0c58d96e2ab343ad2 /crypto
parentcrypto: lrw - Fix out-of bounds access on counter overflow (diff)
downloadkernel-qcow2-linux-94c7bb6598567a663835efdbf8377ee4fbe9426d.tar.gz
kernel-qcow2-linux-94c7bb6598567a663835efdbf8377ee4fbe9426d.tar.xz
kernel-qcow2-linux-94c7bb6598567a663835efdbf8377ee4fbe9426d.zip
crypto: tcrypt - fix ghash-generic speed test
commit 331351f89c36bf7d03561a28b6f64fa10a9f6f3a upstream. ghash is a keyed hash algorithm, thus setkey needs to be called. Otherwise the following error occurs: $ modprobe tcrypt mode=318 sec=1 testing speed of async ghash-generic (ghash-generic) tcrypt: test 0 ( 16 byte blocks, 16 bytes per update, 1 updates): tcrypt: hashing failed ret=-126 Cc: <stable@vger.kernel.org> # 4.6+ Fixes: 0660511c0bee ("crypto: tcrypt - Use ahash") Tested-by: Franck Lenormand <franck.lenormand@nxp.com> Signed-off-by: Horia Geantă <horia.geanta@nxp.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/tcrypt.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index bdde95e8d369..6e0a054bb61d 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -1103,6 +1103,9 @@ static void test_ahash_speed_common(const char *algo, unsigned int secs,
break;
}
+ if (speed[i].klen)
+ crypto_ahash_setkey(tfm, tvmem[0], speed[i].klen);
+
pr_info("test%3u "
"(%5u byte blocks,%5u bytes per update,%4u updates): ",
i, speed[i].blen, speed[i].plen, speed[i].blen / speed[i].plen);