linux/arch/s390/crypto
Harald Freudenberger 3ac2939bc4 crypto: s390/phmac - Do not modify the req->nbytes value
The phmac implementation used the req->nbytes field on combined
operations (finup, digest) to track the state:
with req->nbytes > 0 the update needs to be processed,
while req->nbytes == 0 means to do the final operation. For
this purpose the req->nbytes field was set to 0 after successful
update operation. However, aead uses the req->nbytes field after a
successful hash operation to determine the amount of data to
en/decrypt. So an implementation must not modify the nbytes field.

Fixed by a slight rework on the phmac implementation. There is
now a new field async_op in the request context which tracks
the (asynch) operation to process. So the 'state' via req->nbytes
is not needed any more and now this field is untouched and may
be evaluated even after a request is processed by the phmac
implementation.

Fixes: cbbc675506 ("crypto: s390 - New s390 specific protected key hash phmac")
Reported-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Tested-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2025-10-23 12:53:23 +08:00
..
Kconfig lib/crypto: s390/sha1: Migrate optimized code into library 2025-07-14 11:11:49 -07:00
Makefile This update includes the following changes: 2025-07-31 09:45:28 -07:00
aes_s390.c crypto: scatterwalk - simplify map and unmap calling convention 2025-03-21 17:33:38 +08:00
arch_random.c s390: Explicitly include <linux/export.h> 2025-06-17 18:18:02 +02:00
des_s390.c
ghash_s390.c crypto: s390/ghash - Use API partial block handling 2025-04-23 11:33:47 +08:00
hmac_s390.c crypto: s390/hmac - Fix counter in export state 2025-06-13 17:26:16 +08:00
paes_s390.c crypto: engine - remove request batching support 2025-07-18 20:52:00 +10:00
phmac_s390.c crypto: s390/phmac - Do not modify the req->nbytes value 2025-10-23 12:53:23 +08:00
prng.c s390/crypto: Switch over to sysfs_emit() 2024-10-25 16:03:24 +02:00
sha.h crypto: hash - Make HASH_MAX_DESCSIZE a bit more obvious 2025-08-22 17:28:44 +08:00
sha3_256_s390.c crypto: s390/sha3 - Use cpu byte-order when exporting 2025-06-13 17:26:16 +08:00
sha3_512_s390.c crypto: s390/sha3 - Use cpu byte-order when exporting 2025-06-13 17:26:16 +08:00
sha_common.c s390: Explicitly include <linux/export.h> 2025-06-17 18:18:02 +02:00