mirror-linux/drivers/crypto/starfive
Haotian Zhang e9eb52037a crypto: starfive - Correctly handle return of sg_nents_for_len
The return value of sg_nents_for_len was assigned to an unsigned long
in starfive_hash_digest, causing negative error codes to be converted
to large positive integers.

Add error checking for sg_nents_for_len and return immediately on
failure to prevent potential buffer overflows.

Fixes: 7883d1b28a ("crypto: starfive - Add hash and HMAC support")
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2025-11-22 10:04:49 +08:00
..
Kconfig crypto: starfive - Use dma for aes requests 2024-04-02 10:49:38 +08:00
Makefile crypto: starfive - Add AES skcipher and aead support 2023-07-28 18:20:25 +08:00
jh7110-aes.c crypto: jh7110 - Remove the use of dev_err_probe() 2025-08-30 15:43:26 +08:00
jh7110-cryp.c crypto: starfive - remove unneeded crypto_engine_stop() call 2024-10-28 18:33:11 +08:00
jh7110-cryp.h crypto: starfive - Fix nent assignment in rsa dec 2024-07-06 10:20:00 +10:00
jh7110-hash.c crypto: starfive - Correctly handle return of sg_nents_for_len 2025-11-22 10:04:49 +08:00
jh7110-rsa.c crypto: drivers - Drop sign/verify operations 2024-10-05 13:22:04 +08:00