[PATCH] crypto: hash - Increase HASH_MAX_DESCSIZE for hmac(sha3-224-s390)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 30, 2025 at 09:11:49AM -0700, Eric Biggers wrote:
>
> I haven't touched SHA-3 yet.  This is a bug from the following commit:
> 
>     commit 6f90ba7065515d69b24729cf85c45b2add99e638
>     Author: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
>     Date:   Fri Apr 18 11:00:13 2025 +0800
> 
>         crypto: s390/sha3 - Use API partial block handling
> 
>         Use the Crypto API partial block handling.
> 
>         Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
> 
> That increased the descsize of hmac(sha3-224-s390) from 368 to 369,
> which made it exceed HASH_MAX_DESCSIZE, causing it to fail to register.

Thanks for diagnosing the problem.

---8<---
The value of HASH_MAX_DESCSIZE is off by one for hmac(sha3-224-s390).
Fix this so that hmac(sha3-224-s390) can be registered.

Reported-by: Ingo Franzki <ifranzki@xxxxxxxxxxxxx>
Reported-by: Eric Biggers <ebiggers@xxxxxxxxxx>
Fixes: 6f90ba706551 ("crypto: s390/sha3 - Use API partial block handling")
Cc: <stable@xxxxxxxxxxxxxxx>
Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>

diff --git a/include/crypto/hash.h b/include/crypto/hash.h
index db294d452e8c..bbaeae705ef0 100644
--- a/include/crypto/hash.h
+++ b/include/crypto/hash.h
@@ -184,7 +184,7 @@ struct shash_desc {
  * Worst case is hmac(sha3-224-s390).  Its context is a nested 'shash_desc'
  * containing a 'struct s390_sha_ctx'.
  */
-#define HASH_MAX_DESCSIZE	(sizeof(struct shash_desc) + 360)
+#define HASH_MAX_DESCSIZE	(sizeof(struct shash_desc) + 361)
 #define MAX_SYNC_HASH_REQSIZE	(sizeof(struct ahash_request) + \
 				 HASH_MAX_DESCSIZE)
 
-- 
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux