linux-stable/drivers/crypto/marvell
Dan Carpenter e7ff7a46ba crypto: marvell/octeontx - prevent integer overflows
[ Upstream commit caca37cf6c ]

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 "code_length * 2" can overflow.  The round_up(ucode_size, 16) +
sizeof() expression can overflow too.  Prevent these overflows.

Fixes: d9110b0b01 ("crypto: marvell - 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-21 12:39:01 +02:00
..
cesa crypto: marvell/cesa - ECB does not IV 2022-04-21 17:53:55 +08:00
octeontx crypto: marvell/octeontx - prevent integer overflows 2022-10-21 12:39:01 +02:00
octeontx2 crypto: octeontx2 - fix potential null pointer access 2022-06-10 16:43:49 +08:00
Kconfig crypto: octeontx2 - select CONFIG_NET_DEVLINK 2022-01-31 11:21:45 +11:00
Makefile crypto: marvell - add Marvell OcteonTX2 CPT PF driver 2021-01-22 14:58:02 +11:00