Commit 3438e722 authored by Dan Carpenter's avatar Dan Carpenter Committed by Herbert Xu
Browse files

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: d9d77497 ("crypto: octeontx2 - add apis for custom engine groups")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 0cec19c7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
	}