linux-sg2042/drivers/crypto
zhenwei pi 62f361bfea crypto: virtio/akcipher - Fix stack overflow on memcpy
commit c0ec2a712d upstream.

sizeof(struct virtio_crypto_akcipher_session_para) is less than
sizeof(struct virtio_crypto_op_ctrl_req::u), copying more bytes from
stack variable leads stack overflow. Clang reports this issue by
commands:
make -j CC=clang-14 mrproper >/dev/null 2>&1
make -j O=/tmp/crypto-build CC=clang-14 allmodconfig >/dev/null 2>&1
make -j O=/tmp/crypto-build W=1 CC=clang-14 drivers/crypto/virtio/
  virtio_crypto_akcipher_algs.o

Fixes: 59ca6c9338 ("virtio-crypto: implement RSA algorithm")
Link: https://lore.kernel.org/all/0a194a79-e3a3-45e7-be98-83abd3e1cb7e@roeck-us.net/
Cc: <stable@vger.kernel.org>
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Tested-by: Nathan Chancellor <nathan@kernel.org> # build
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-03-01 13:26:32 +01:00
..
allwinner crypto: sun8i-ss - Fix a test in sun8i_ss_setup_ivs() 2023-05-17 11:53:40 +02:00
amcc crypto: crypto4xx - Call dma_unmap_page when done 2023-03-10 09:33:04 +01:00
amlogic crypto: amlogic - Remove kcalloc without check 2022-12-31 13:32:36 +01:00
aspeed crypto: aspeed - Remove redundant dev_err call 2022-09-30 13:59:13 +08:00
axis crypto: artpec6 - Fix printk warning on size_t/%d 2022-09-24 16:14:43 +08:00
bcm crypto: bcm - Simplify obtain the name for cipher 2022-09-30 13:59:13 +08:00
caam crypto: caam/jr - fix Chacha20 + Poly1305 self test failure 2023-11-20 11:52:05 +01:00
cavium crypto: nitrox - avoid double free on error path in nitrox_sriov_init() 2022-12-31 13:32:30 +01:00
ccp crypto: ccp - Fix null pointer dereference in __sev_platform_shutdown_locked 2024-02-23 09:12:44 +01:00
ccree crypto: ccree - Make cc_debugfs_global_fini() available for module init function 2022-12-31 13:32:33 +01:00
chelsio
gemini Revert "crypto: gemini - Fix error check for dma_map_sg" 2022-09-02 18:15:53 +08:00
hisilicon crypto: hisilicon/zip - save capability registers in probe process 2024-01-25 15:27:22 -08:00
inside-secure crypto: safexcel - Add error handling for dma_map_sg() calls 2024-01-25 15:27:21 -08:00
keembay crypto: keembay-ocs - Drop obsolete dependency on COMPILE_TEST 2022-08-19 18:39:36 +08:00
marvell crypto: octeontx2 - Fix cptvf driver cleanup 2024-02-05 20:12:48 +00:00
nx crypto: nx - fix build warnings when DEBUG_FS is not enabled 2023-07-19 16:21:41 +02:00
qat crypto: qat - fix deadlock in backlog processing 2023-11-20 11:52:07 +01:00
qce crypto: qce - Fix dma_map_sg error check 2022-08-26 18:50:39 +08:00
rockchip crypto: rockchip - rework by using crypto_engine 2022-12-31 13:32:31 +01:00
stm32 crypto: stm32/crc32 - fix parsing list of devices 2024-02-05 20:12:48 +00:00
ux500 crypto: ux500/hash - drop unexpected word "the" 2022-06-30 15:56:57 +08:00
virtio crypto: virtio/akcipher - Fix stack overflow on memcpy 2024-03-01 13:26:32 +01:00
vmx crypto: vmx - Fix warning on p8_ghash_alg 2022-07-08 15:21:15 +08:00
xilinx
Kconfig crypto: sa2ul - Select CRYPTO_DES 2023-05-11 23:03:20 +09:00
Makefile crypto: aspeed - Add HACE hash driver 2022-08-26 18:50:37 +08:00
atmel-aes-regs.h
atmel-aes.c crypto: atmel-aes - Drop if with an always false condition 2022-07-15 16:43:20 +08:00
atmel-authenc.h
atmel-ecc.c i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
atmel-i2c.c crypto: atmel - Avoid flush_scheduled_work() usage 2022-05-06 18:16:55 +08:00
atmel-i2c.h crypto: atmel - Avoid flush_scheduled_work() usage 2022-05-06 18:16:55 +08:00
atmel-sha-regs.h
atmel-sha.c crypto: atmel-sha - initialize sha_dd while declaring 2022-07-15 16:43:22 +08:00
atmel-sha204a.c i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
atmel-tdes-regs.h
atmel-tdes.c crypto: atmel-tdes - initialize tdes_dd while declaring 2022-07-15 16:43:22 +08:00
exynos-rng.c
geode-aes.c
geode-aes.h
hifn_795x.c
img-hash.c crypto: img-hash - Fix variable dereferenced before check 'hdev->req' 2022-12-31 13:32:37 +01:00
ixp4xx_crypto.c
mxs-dcp.c
n2_asm.S
n2_core.c crypto: n2 - add missing hash statesize 2023-01-07 11:11:54 +01:00
n2_core.h
omap-aes-gcm.c
omap-aes.c crypto: omap-aes - Drop if with an always false condition 2022-07-15 16:43:21 +08:00
omap-aes.h
omap-crypto.c
omap-crypto.h
omap-des.c crypto: omap-des - Drop if with an always false condition 2022-07-15 16:43:21 +08:00
omap-sham.c crypto: omap-sham - Use pm_runtime_resume_and_get() in omap_sham_probe() 2022-12-31 13:32:36 +01:00
padlock-aes.c
padlock-sha.c
qcom-rng.c crypto: qcom-rng - Fix qcom_rng_of_match unused warning 2022-08-19 18:39:35 +08:00
s5p-sss.c crypto: s5p-sss - Drop if with an always false condition 2022-07-15 16:43:21 +08:00
sa2ul.c crypto: sa2ul - Return crypto_aead_setkey to transfer the error 2024-01-25 15:27:21 -08:00
sa2ul.h crypto: sa2ul - Check engine status before enabling 2022-07-15 16:43:22 +08:00
sahara.c crypto: sahara - do not resize req->src when doing hash operations 2024-01-25 15:27:23 -08:00
talitos.c crypto: talitos - Uniform coding style with defined variable 2022-05-13 17:24:49 +08:00
talitos.h