Skip to contentSkip to conversation

Regression: hmac(sha3-224) is missing in newer kernels on s390?

PATCH New Ingo Franzki 3 participants 4 messages Jul 30, 2025 – Jul 31, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi Eric, Herbert,

I just noticed that the algorithm 'hmac(sha3-224)' is not supported anymore.
This is at least on yesterday's 6.17 as well as on linux-next.
On earlier kernels 'hmac(sha3-224)' was available. I don't exactly know when it started to be missing. I can't tell if the same is true on other archs.

'sha3-224' as digest is there, but 'hmac(sha3-224)' is not. All the other sha3 and all sha2 variants are there as well (digest and hmac).

# grep "sha3-" /proc/crypto
name         : hmac(sha3-512)
driver       : hmac(sha3-512-s390)
name         : hmac(sha3-384)
driver       : hmac(sha3-384-s390)
name         : hmac(sha3-256)
driver       : hmac(sha3-256-s390)
name         : sha3-384
driver       : sha3-384-s390
name         : sha3-512
driver       : sha3-512-s390
name         : sha3-224
driver       : sha3-224-s390   
name         : sha3-256
driver       : sha3-256-s390
name         : sha3-512
driver       : sha3-512-generic
name         : sha3-384
driver       : sha3-384-generic
name         : sha3-256
driver       : sha3-256-generic
name         : sha3-224
driver       : sha3-224-generic

On a 6.11 kernel:

# grep "sha3-" /proc/crypto
name         : sha3-384
driver       : sha3-384-s390
name         : sha3-512
driver       : sha3-512-s390
name         : sha3-224           <---- its there
driver       : sha3-224-s390
name         : sha3-256
driver       : sha3-256-s390
name         : sha3-512
driver       : sha3-512-generic
name         : sha3-384
driver       : sha3-384-generic
name         : sha3-256
driver       : sha3-256-generic
name         : sha3-224
driver       : sha3-224-generic
Signature · 10 lines
Ingo Franzki
eMail: [email protected]  
Tel: ++49 (0)7031-16-4648
Linux on IBM Z Development, Schoenaicher Str. 220, 71032 Boeblingen, Germany

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Gregor Pillen
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294
IBM DATA Privacy Statement: https://www.ibm.com/privacy/us/en/
#1 lore raw
Quoted 1 line · Ingo Franzki

On a 6.11 kernel:

This must of course be:

On a 6.11 kernel:

# grep sha3- /proc/crypto
name         : hmac(sha3-512)
driver       : hmac(sha3-512-s390)
name         : hmac(sha3-384)
driver       : hmac(sha3-384-s390)
name         : hmac(sha3-224)        <--- its here
driver       : hmac(sha3-224-s390)
name         : hmac(sha3-256)
driver       : hmac(sha3-256-s390)
name         : sha3-384
driver       : sha3-384-s390
name         : sha3-512
driver       : sha3-512-s390
name         : sha3-224
driver       : sha3-224-s390
name         : sha3-256
driver       : sha3-256-s390
name         : sha3-512
driver       : sha3-512-generic
name         : sha3-384
driver       : sha3-384-generic
name         : sha3-256
driver       : sha3-256-generic
name         : sha3-224
driver       : sha3-224-generic
Signature · 10 lines
Ingo Franzki
eMail: [email protected]  
Tel: ++49 (0)7031-16-4648
Linux on IBM Z Development, Schoenaicher Str. 220, 71032 Boeblingen, Germany

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Gregor Pillen
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294
IBM DATA Privacy Statement: https://www.ibm.com/privacy/us/en/
#2 lore raw
In reply to Ingo Franzki
Quoted 44 lines · Ingo Franzki

Hi Eric, Herbert,

I just noticed that the algorithm 'hmac(sha3-224)' is not supported anymore.
This is at least on yesterday's 6.17 as well as on linux-next.
On earlier kernels 'hmac(sha3-224)' was available. I don't exactly know when it started to be missing. I can't tell if the same is true on other archs.

'sha3-224' as digest is there, but 'hmac(sha3-224)' is not. All the other sha3 and all sha2 variants are there as well (digest and hmac).

# grep "sha3-" /proc/crypto
name         : hmac(sha3-512)
driver       : hmac(sha3-512-s390)
name         : hmac(sha3-384)
driver       : hmac(sha3-384-s390)
name         : hmac(sha3-256)
driver       : hmac(sha3-256-s390)
name         : sha3-384
driver       : sha3-384-s390
name         : sha3-512
driver       : sha3-512-s390
name         : sha3-224
driver       : sha3-224-s390   
name         : sha3-256
driver       : sha3-256-s390
name         : sha3-512
driver       : sha3-512-generic
name         : sha3-384
driver       : sha3-384-generic
name         : sha3-256
driver       : sha3-256-generic
name         : sha3-224
driver       : sha3-224-generic

On a 6.11 kernel:

# grep "sha3-" /proc/crypto
name         : sha3-384
driver       : sha3-384-s390
name         : sha3-512
driver       : sha3-512-s390
name         : sha3-224           <---- its there
driver       : sha3-224-s390
name         : sha3-256
driver       : sha3-256-s390
Quoted 8 lines
name         : sha3-512
driver       : sha3-512-generic
name         : sha3-384
driver       : sha3-384-generic
name         : sha3-256
driver       : sha3-256-generic
name         : sha3-224
driver       : sha3-224-generic

I haven't touched SHA-3 yet. This is a bug from the following commit:

commit 6f90ba7065515d69b24729cf85c45b2add99e638
Author: Herbert Xu <[email protected]>
Date: Fri Apr 18 11:00:13 2025 +0800

crypto: s390/sha3 - Use API partial block handling

Use the Crypto API partial block handling.

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.

- Eric

maintainer
#3 lore raw

PATCH 1/1 crypto: hash - Increase HASH_MAX_DESCSIZE for hmac(sha3-224-s390)

Quoted 7 lines · Eric Biggers

I haven't touched SHA-3 yet. This is a bug from the following commit:

commit 6f90ba7065515d69b24729cf85c45b2add99e638
Author: Herbert Xu <[email protected]>
Date: Fri Apr 18 11:00:13 2025 +0800

Quoted 8 lines

crypto: s390/sha3 - Use API partial block handling

Use the Crypto API partial block handling.

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.

Fixes 6f90ba706551 ("crypto: s390/sha3 - Use API partial block handling")
include/crypto/hash.h +1 -1
index db294d452e8c..bbaeae705ef0 100644
@@ -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)
 
Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt