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

Commit fd9586cc 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.

Signed-off-by: default avatarHimansu Nayak <quic_himansu@quicinc.com>
parent 7705d29b
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1366,8 +1366,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;
	}