android_kernel_xiaomi_sm7250/drivers/crypto
Dan Carpenter 90e483e7f2 crypto: cavium - prevent integer overflow loading firmware
[ Upstream commit 2526d6bf27d15054bb0778b2f7bc6625fd934905 ]

The "code_length" value comes from the firmware file.  If your firmware
is untrusted realistically there is probably very little you can do to
protect yourself.  Still we try to limit the damage as much as possible.
Also Smatch marks any data read from the filesystem as untrusted and
prints warnings if it not capped correctly.

The "ntohl(ucode->code_length) * 2" multiplication can have an
integer overflow.

Fixes: 9e2c7d9994 ("crypto: cavium - Add Support for Octeon-tx CPT Engine")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-10-26 13:19:35 +02:00
..
amcc
axis
bcm
caam
cavium crypto: cavium - prevent integer overflow loading firmware 2022-10-26 13:19:35 +02:00
ccp
ccree
chelsio
hisilicon crypto: hisilicon - Kunpeng916 crypto driver don't sleep when in softirq 2022-08-25 11:15:07 +02:00
inside-secure
marvell crypto: marvell/cesa - ECB does not IV 2022-06-14 16:59:24 +02:00
mediatek
nx
qat
qce
rockchip
stm32
sunxi-ss
ux500
virtio
vmx
atmel-aes-regs.h
atmel-aes.c
atmel-authenc.h
atmel-ecc.c
atmel-ecc.h
atmel-sha-regs.h
atmel-sha.c
atmel-tdes-regs.h
atmel-tdes.c
exynos-rng.c
geode-aes.c
geode-aes.h
hifn_795x.c
img-hash.c
ixp4xx_crypto.c
Kconfig
Makefile
mxc-scc.c
mxs-dcp.c
n2_asm.S
n2_core.c
n2_core.h
omap-aes-gcm.c
omap-aes.c
omap-aes.h
omap-crypto.c
omap-crypto.h
omap-des.c
omap-sham.c
padlock-aes.c
padlock-sha.c
picoxcell_crypto_regs.h
picoxcell_crypto.c
qcom-rng.c
s5p-sss.c
sahara.c
talitos.c
talitos.h