Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e3f83c66 authored by Michael Adisumarta's avatar Michael Adisumarta
Browse files

msm: ipa: Validate pdn_idx on modify_flt_rule



Replace the incomplete validate code on ipa_mdfy_flt_rule with
the already present ipa_validate function which is checks for
pdn_idx and is more complete.

Change-Id: Icfbd0c24ee832ce7c7a7af079219cbdf0c455b60
Crs-fixed: 2250028
Signed-off-by: default avatarMichael Adisumarta <madisuma@codeaurora.org>
parent a19e1f5a
Loading
Loading
Loading
Loading
+3 −32
Original line number Original line Diff line number Diff line
@@ -1033,40 +1033,11 @@ static int __ipa_mdfy_flt_rule(struct ipa_flt_rule_mdfy *frule,
		goto error;
		goto error;
	}
	}


	if (entry->rt_tbl)
	if (__ipa_validate_flt_rule(&frule->rule, &rt_tbl, ip))
		entry->rt_tbl->ref_cnt--;

	if (frule->rule.action != IPA_PASS_TO_EXCEPTION) {
		if (!frule->rule.eq_attrib_type) {
			if (!frule->rule.rt_tbl_hdl) {
				IPAERR_RL("invalid RT tbl\n");
		goto error;
		goto error;
			}


			rt_tbl = ipa3_id_find(frule->rule.rt_tbl_hdl);
	if (entry->rt_tbl)
			if (rt_tbl == NULL) {
		entry->rt_tbl->ref_cnt--;
				IPAERR_RL("RT tbl not found\n");
				goto error;
			}

			if (rt_tbl->cookie != IPA_RT_TBL_COOKIE) {
				IPAERR_RL("RT table cookie is invalid\n");
				goto error;
			}
		} else {
			if (frule->rule.rt_tbl_idx > ((ip == IPA_IP_v4) ?
				IPA_MEM_PART(v4_modem_rt_index_hi) :
				IPA_MEM_PART(v6_modem_rt_index_hi))) {
				IPAERR_RL("invalid RT tbl\n");
				goto error;
			}
		}
	} else {
		if (frule->rule.rt_tbl_idx > 0) {
			IPAERR_RL("invalid RT tbl\n");
			goto error;
		}
	}


	entry->rule = frule->rule;
	entry->rule = frule->rule;
	entry->rt_tbl = rt_tbl;
	entry->rt_tbl = rt_tbl;