linux/drivers/crypto
Haotian Zhang f57925f0c4 crypto: ccree - Correctly handle return of sg_nents_for_len
[ Upstream commit 8700ce07c5 ]

Fix error handling in cc_map_hash_request_update where sg_nents_for_len
return value was assigned to u32, converting negative errors to large
positive values before passing to sg_copy_to_buffer.

Check sg_nents_for_len return value and propagate errors before
assigning to areq_ctx->in_nents.

Fixes: b7ec853068 ("crypto: ccree - use std api when possible")
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-01-19 13:09:32 +01:00
..
allwinner crypto: sun8i-ce - move fallback ahash_request to the end of the struct 2025-06-27 11:05:10 +01:00
amcc crypto: crypto4xx - Call dma_unmap_page when done 2023-03-10 09:39:17 +01:00
amlogic crypto: amlogic - Remove kcalloc without check 2022-12-31 13:14:25 +01:00
axis crypto: sha - split sha.h into sha1.h and sha2.h 2020-11-20 14:45:33 +11:00
bcm crypto: bcm - add error check in the ahash_hmac_init function 2024-12-14 19:50:45 +01:00
caam crypto: caam/qi - Fix drv_ctx refcount bug 2025-05-02 07:44:12 +02:00
cavium crypto: cavium - Fix an error handling path in cpt_ucode_load_fw() 2024-12-14 19:50:45 +01:00
ccp crypto: ccp - Fix crash when rebind ccp device for ccp.ko 2025-08-28 16:24:10 +02:00
ccree crypto: ccree - Correctly handle return of sg_nents_for_len 2026-01-19 13:09:32 +01:00
chelsio crypto: chelsio/chcr - Remove useless MODULE_VERSION 2021-04-22 17:31:31 +10:00
gemini crypto: gemini - call finalize with bh disabled 2022-04-08 14:23:08 +02:00
hisilicon crypto: hisilicon/qm - restore original qos values 2026-01-19 13:09:24 +01:00
inside-secure crypto: inside-secure - Fix dma_unmap_sg() nents value 2025-08-28 16:24:09 +02:00
keembay crypto: keembay - Fix dma_unmap_sg() nents value 2025-08-28 16:24:10 +02:00
marvell crypto: octeontx2 - add timeout for load_fvc completion poll 2025-08-28 16:24:24 +02:00
nx crypto: nx - Fix uninitialised hv_nxc on error 2025-04-10 14:32:01 +02:00
qat crypto: qat - fix seq_file position update in adf_ring_next() 2025-08-28 16:24:11 +02:00
qce crypto: qce - unregister previously registered algos in error path 2025-03-13 12:50:31 +01:00
rockchip crypto: rockchip - Fix dma_unmap_sg() nents value 2025-10-29 14:03:07 +01:00
stm32 crypto: stm32/crc32 - fix parsing list of devices 2024-02-23 08:54:39 +01:00
ux500 crypto: ux500 - Fix error return code in hash_hw_final() 2021-05-14 19:07:58 +08:00
virtio virtio-crypto: fix memory leak in virtio_crypto_alg_skcipher_close_session() 2024-01-25 14:52:46 -08:00
vmx crypto: vmx - add missing dependencies 2022-04-08 14:23:08 +02:00
xilinx crypto: xilinx - call finalize with bh disabled 2024-03-26 18:21:27 -04:00
atmel-aes-regs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
atmel-aes.c crypto: atmel-aes - Reestablish the correct tfm context at dequeue 2022-01-27 11:03:14 +01:00
atmel-authenc.h crypto: sha - split sha.h into sha1.h and sha2.h 2020-11-20 14:45:33 +11:00
atmel-ecc.c crypto: atmel-ecc - Struct headers need to start with keyword 'struct' 2021-03-26 20:02:36 +11:00
atmel-i2c.c crypto: atmel - use the correct print format 2021-04-16 21:16:33 +10:00
atmel-i2c.h crypto: atmel - Fix -Wunused-const-variable warning 2019-08-30 18:05:31 +10:00
atmel-sha-regs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
atmel-sha.c crypto: atmel - use the correct print format 2021-04-16 21:16:33 +10:00
atmel-sha204a.c crypto: atmel-sha204a - Set hwrng quality to lowest possible 2025-05-02 07:44:39 +02:00
atmel-tdes-regs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
atmel-tdes.c crypto: atmel - Fix dma_unmap_sg() direction 2025-10-19 16:21:45 +02:00
exynos-rng.c crypto: exynos - use devm_platform_ioremap_resource() to simplify code 2019-08-09 15:11:59 +10:00
geode-aes.c crypto: geode - use DEFINE_SPINLOCK() for spinlock 2021-04-16 21:16:31 +10:00
geode-aes.h crypto: geode-aes - convert to skcipher API and make thread-safe 2019-10-23 19:46:56 +11:00
hifn_795x.c crypto: drivers - use semicolons rather than commas to separate statements 2020-10-02 18:02:15 +10:00
img-hash.c crypto: img-hash - Fix dma_unmap_sg() nents value 2025-08-28 16:24:10 +02:00
ixp4xx_crypto.c crypto: ixp4xx - fix OF node reference leaks in init_ixp_crypto() 2025-03-13 12:50:01 +01:00
Kconfig crypto: sa2ul - Select CRYPTO_DES 2023-05-11 23:00:27 +09:00
Makefile crypto: sl3516 - Add sl3516 crypto engine 2021-06-11 15:03:29 +08:00
mxs-dcp.c crypto: mxs-dcp - Fix scatterlist processing 2022-04-08 14:23:05 +02:00
n2_asm.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
n2_core.c crypto: n2 - add missing hash statesize 2023-01-12 11:58:58 +01:00
n2_core.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
omap-aes-gcm.c crypto: omap-aes - avoid spamming console with self tests 2020-06-04 22:03:39 +10:00
omap-aes.c crypto: omap-aes - Fix broken pm_runtime_and_get() usage 2022-01-27 11:05:06 +01:00
omap-aes.h crypto: omap-aes - permit asynchronous skcipher as fallback 2020-07-16 21:49:02 +10:00
omap-crypto.c crypto: omap - Avoid redundant copy when using truncated sg list 2021-08-21 15:44:53 +08:00
omap-crypto.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
omap-des.c crypto: omap - Fix inconsistent locking of device lists 2021-08-21 15:44:53 +08:00
omap-sham.c crypto: omap-sham - Use pm_runtime_resume_and_get() in omap_sham_probe() 2022-12-31 13:14:26 +01:00
padlock-aes.c crypto: algapi - Remove skbuff.h inclusion 2020-08-20 14:04:28 +10:00
padlock-sha.c crypto: sha - split sha.h into sha1.h and sha2.h 2020-11-20 14:45:33 +11:00
qcom-rng.c crypto: qcom-rng - fix infinite loop on requests not multiple of WORD_SZ 2022-05-25 09:57:28 +02:00
s5p-sss.c crypto: s5p-sss - Add error handling in s5p_aes_probe() 2021-11-18 19:15:53 +01:00
sa2ul.c crypto: sa2ul - Return crypto_aead_setkey to transfer the error 2024-01-25 14:52:34 -08:00
sa2ul.h crypto: sa2ul - Add support for AM64 2021-04-22 17:31:30 +10:00
sahara.c crypto: sahara - do not resize req->src when doing hash operations 2024-01-25 14:52:35 -08:00
talitos.c crypto: talitos - Fix ctr(aes) on SEC1 2021-01-29 15:57:59 +11:00
talitos.h crypto: talitos - Work around SEC6 ERRATA (AES-CTR mode data size error) 2021-01-29 15:57:58 +11:00