mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 13:49:24 -04:00
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: Himansu Nayak <quic_himansu@quicinc.com>
This commit is contained in:
parent
7705d29b41
commit
fd9586ccaf
1 changed files with 3 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue