aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2021-12-17 10:12:32 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2021-12-24 14:18:27 +1100
commit3438e7220b3183b1ee80227e3a0d742b18df4623 (patch)
treea5de74a35f06f9e6efc56b5f720389152b03f5a3 /drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c
parentcrypto: qat - add support for compression for 4xxx (diff)
downloadlinux-dev-3438e7220b3183b1ee80227e3a0d742b18df4623.tar.xz
linux-dev-3438e7220b3183b1ee80227e3a0d742b18df4623.zip
crypto: octeontx2 - out of bounds access in otx2_cpt_dl_custom_egrp_delete()
If "egrp" is negative then it is causes an out of bounds access in eng_grps->grp[]. Fixes: d9d7749773e8 ("crypto: octeontx2 - add apis for custom engine groups") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
-rw-r--r--drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c b/drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c
index 9aef37972246..27f6d0a0cd3c 100644
--- a/drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c
+++ b/drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c
@@ -1685,7 +1685,7 @@ int otx2_cpt_dl_custom_egrp_delete(struct otx2_cptpf_dev *cptpf,
if (kstrtoint(tmp, 10, &egrp))
goto err_print;
- if (egrp >= OTX2_CPT_MAX_ENGINE_GROUPS) {
+ if (egrp < 0 || egrp >= OTX2_CPT_MAX_ENGINE_GROUPS) {
dev_err(dev, "Invalid engine group %d", egrp);
return -EINVAL;
}