diff options
author | Chaitanya Pratapa <cpratapa@codeaurora.org> | 2019-02-26 15:06:31 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2019-03-19 00:00:15 -0700 |
commit | ae82de33ed6776508358f86a744d6e082b6144f1 (patch) | |
tree | f4caec1024f27d2b01da893da2e2ae625ff4eec7 /drivers | |
parent | 9280a655b9c11b73024494f2885de6a84457ed9d (diff) |
msm: ipa: fix to validate the ioctl WAN_IOC_SEND_LAN_CLIENT_MSG params
When processing WAN_IOC_SEND_LAN_CLIENT_MSG ioctl there is a possibility
of message_type being invalid and this can lead to out of buffer error.
Make a change to validate the ioctl params before processing.
Change-Id: If7955f77863b772ae1c8feda5ca0145c822403b9
Signed-off-by: Chaitanya Pratapa <cpratapa@codeaurora.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c | 9 |
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)); |