diff options
author | Akshay Pandit <pandit@codeaurora.org> | 2019-05-10 17:53:27 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2019-10-02 13:05:11 -0700 |
commit | c067df34e83888d7e6fe5a9d118f23c7179cf720 (patch) | |
tree | 87f95956af894f348546c99c98b16188809723ec | |
parent | f8c470c5dccd296d4dd4947164832b11e35a4470 (diff) |
msm: ipa_v2: Protect ipa default routing tableLA.UM.7.6.2.r1-10100-89xx.0
Protect ipa default routing table from
addition, deletion and modification once after
default rule added by ipa driver.
Change-Id: I4b8fdd9208425c5eb0bceed0ce62fb7d7a075e36
Signed-off-by: Pooja Kumari <kumarip@codeaurora.org>
Signed-off-by: Akshay Pandit <pandit@codeaurora.org>
-rw-r--r-- | drivers/platform/msm/ipa/ipa_v2/ipa_rt.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/platform/msm/ipa/ipa_v2/ipa_rt.c b/drivers/platform/msm/ipa/ipa_v2/ipa_rt.c index be529688b3f2..afd80e183c1a 100644 --- a/drivers/platform/msm/ipa/ipa_v2/ipa_rt.c +++ b/drivers/platform/msm/ipa/ipa_v2/ipa_rt.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -1067,9 +1067,8 @@ static int __ipa_add_rt_rule(enum ipa_ip_type ip, const char *name, * tables */ if (!strcmp(tbl->name, IPA_DFLT_RT_TBL_NAME) && - (tbl->rule_cnt > 0) && (at_rear != 0)) { - IPAERR("cannot add rule at end of tbl rule_cnt=%d at_rear=%d\n", - tbl->rule_cnt, at_rear); + (tbl->rule_cnt > 0)) { + IPAERR_RL("cannot add rules to default rt table\n"); goto error; } @@ -1606,6 +1605,11 @@ static int __ipa_mdfy_rt_rule(struct ipa_rt_rule_mdfy *rtrule) goto error; } + if (!strcmp(entry->tbl->name, IPA_DFLT_RT_TBL_NAME)) { + IPAERR_RL("Default tbl rule cannot be modified\n"); + return -EINVAL; + } + /* Adding check to confirm still * header entry present in header table or not */ |