mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 22:40:54 -04:00
msm: ipa3: Add check to validate rule_cnt
Add proper check to validate table rule count which may lead to overflow error. Change-Id: I9bdcafcaae4e4cff1b901929c8dc6ae804f85642 Signed-off-by: Praveen Kurapati <pkurapat@codeaurora.org>
This commit is contained in:
parent
3b007394ea
commit
fd57264b26
3 changed files with 10 additions and 2 deletions
|
|
@ -947,7 +947,10 @@ static int __ipa_finish_flt_rule_add(struct ipa3_flt_tbl *tbl,
|
|||
{
|
||||
int id;
|
||||
|
||||
tbl->rule_cnt++;
|
||||
if (tbl->rule_cnt < IPA_RULE_CNT_MAX)
|
||||
tbl->rule_cnt++;
|
||||
else
|
||||
return -EINVAL;
|
||||
if (entry->rt_tbl)
|
||||
entry->rt_tbl->ref_cnt++;
|
||||
id = ipa3_id_alloc(entry);
|
||||
|
|
|
|||
|
|
@ -454,6 +454,8 @@ enum {
|
|||
|
||||
#define MBOX_TOUT_MS 100
|
||||
|
||||
#define IPA_RULE_CNT_MAX 512
|
||||
|
||||
/* miscellaneous for rmnet_ipa and qmi_service */
|
||||
enum ipa_type_mode {
|
||||
IPA_HW_TYPE,
|
||||
|
|
|
|||
|
|
@ -1080,7 +1080,10 @@ static int __ipa_finish_rt_rule_add(struct ipa3_rt_entry *entry, u32 *rule_hdl,
|
|||
{
|
||||
int id;
|
||||
|
||||
tbl->rule_cnt++;
|
||||
if (tbl->rule_cnt < IPA_RULE_CNT_MAX)
|
||||
tbl->rule_cnt++;
|
||||
else
|
||||
return -EINVAL;
|
||||
if (entry->hdr)
|
||||
entry->hdr->ref_cnt++;
|
||||
else if (entry->proc_ctx)
|
||||
|
|
|
|||
Loading…
Reference in a new issue