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

Commit b19893d4 authored by Himansu Nayak's avatar Himansu Nayak
Browse files

msm: ipa3: Fix to validate the NAT table entries during NAT table init



During NAT table Initialization parameter pass from HLOS, if max/zero 
table entries passed it was leading to out of bound read. Adding checks 
to validate the table entries before passing to NAT table parameter.

Change-Id: I85ae3272e6c72eefd241c3b26f3bfc02a636fd75
Signed-off-by: default avatarHimansu Nayak <quic_himansu@quicinc.com>
parent 93e270aa
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1364,8 +1364,9 @@ int ipa3_nat_init_cmd(
		goto bail;
	}

	if (init->table_entries == 0) {
		IPAERR_RL("Table entries is zero\n");
	if (init->table_entries == 0 ||
		init->table_entries == U16_MAX) {
		IPAERR_RL("Table entries is %d\n", init->table_entries);
		result = -EPERM;
		goto bail;
	}