Patch "crypto: talitos - Don't provide setkey for non hmac hashing algs." has been added to the 4.4-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
crypto: talitos - Don't provide setkey for non hmac hashing algs.
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
crypto-talitos-don-t-provide-setkey-for-non-hmac-hashing-algs.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
56136631573baa537a15e0012055ffe8cfec1a33Mon Sep 17 00:00:00 2001
From: LEROY Christophe <[email protected]>
Date: Tue, 12 Sep 2017 11:03:39 +0200
Subject: crypto: talitos - Don't provide setkey for non hmac hashing algs.
From: LEROY Christophe <[email protected]>
commit 56136631573baa537a15e0012055ffe8cfec1a33 upstream.
Today, md5sum fails with error -ENOKEY because a setkey function is set for non hmac hashing algs, see strace output below:
mmap(NULL, 378880, PROT_READ, MAP_SHARED, 6, 0) = 0x77f50000accept(3, 0, NULL) = 7
vmsplice(5, [{"bin/\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 378880}], 1, SPLICE_F_MORE|SPLICE_F_GIFT) = 262144 splice(4, NULL, 7, NULL, 262144, SPLICE_F_MORE) = -1 ENOKEY (Required key not available)write(2, "Generation of hash for file kcap"..., 50) = 50munmap(0x77f50000, 378880) = 0
This patch ensures that setkey() function is set only for hmac hashing.
--- drivers/crypto/talitos.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/crypto/talitos.c +2 -1
@@ -2770,7 +2770,8 @@ static struct talitos_crypto_alg *talito t_alg->algt.alg.hash.final = ahash_final; t_alg->algt.alg.hash.finup = ahash_finup; t_alg->algt.alg.hash.digest = ahash_digest; - t_alg->algt.alg.hash.setkey = ahash_setkey; +if (!strncmp (alg->cra_name,"hmac" ,4 )) + t_alg->algt.alg.hash.setkey = ahash_setkey; t_alg->algt.alg.hash.import = ahash_import; t_alg->algt.alg.hash.export = ahash_export;
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/crypto-talitos-fix-sha224.patch queue-4.4/crypto-talitos-don-t-provide-setkey-for-non-hmac-hashing-algs.patch