summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2019-03-19 04:57:12 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2019-03-19 04:57:12 -0700
commit0a0147a03eea011894e164fefda56e442b005389 (patch)
treeea34a4088f5e0b9dc8f56d05dd9b2c545a003b1a
parent004a90d2203a5b8e9496b032a4004769f31134e0 (diff)
parentae82de33ed6776508358f86a744d6e082b6144f1 (diff)
Merge "msm: ipa: fix to validate the ioctl WAN_IOC_SEND_LAN_CLIENT_MSG params"
-rw-r--r--drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c b/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c
index db638930e2a1..656b95316895 100644
--- a/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c
+++ b/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c
@@ -3601,6 +3601,15 @@ int rmnet_ipa3_send_lan_client_msg(
IPAWANERR("Can't allocate memory for tether_info\n");
return -ENOMEM;
}
+
+ if (data->client_event != IPA_PER_CLIENT_STATS_CONNECT_EVENT &&
+ data->client_event != IPA_PER_CLIENT_STATS_DISCONNECT_EVENT) {
+ IPAWANERR("Wrong event given. Event:- %d\n",
+ data->client_event);
+ kfree(lan_client);
+ return -EINVAL;
+ }
+ data->lan_client.lanIface[IPA_RESOURCE_NAME_MAX-1] = '\0';
memset(&msg_meta, 0, sizeof(struct ipa_msg_meta));
memcpy(lan_client, &data->lan_client,
sizeof(struct ipa_lan_client_msg));