wlan: Protect standard hostapd ioctls from SSR
Protect standard hostapd ioctl functions from accessing uninitialized
or de-allocated data structures while SSR is in progress.
Change-Id: I26788c2855f783c097a62b7fb77c35cc31bf04cf
CRs-Fixed: 709101
diff --git a/CORE/HDD/src/wlan_hdd_hostapd.c b/CORE/HDD/src/wlan_hdd_hostapd.c
index 9a5bd30..5eddeab 100644
--- a/CORE/HDD/src/wlan_hdd_hostapd.c
+++ b/CORE/HDD/src/wlan_hdd_hostapd.c
@@ -2229,7 +2229,7 @@
/**---------------------------------------------------------------------------
- \brief iw_set_auth_hostap() -
+ \brief __iw_set_auth_hostap() -
This function sets the auth type received from the wpa_supplicant.
\param - dev - Pointer to the net device.
@@ -2239,8 +2239,9 @@
\return - 0 for success, non zero for failure
--------------------------------------------------------------------------*/
-int iw_set_auth_hostap(struct net_device *dev,struct iw_request_info *info,
- union iwreq_data *wrqu,char *extra)
+int __iw_set_auth_hostap(struct net_device *dev,
+ struct iw_request_info *info,
+ union iwreq_data *wrqu,char *extra)
{
hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
@@ -2277,9 +2278,22 @@
return 0;
}
-static int iw_set_ap_encodeext(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
+int iw_set_auth_hostap(struct net_device *dev,
+ struct iw_request_info *info,
+ union iwreq_data *wrqu,char *extra)
+{
+ int ret;
+
+ vos_ssr_protect(__func__);
+ ret = __iw_set_auth_hostap(dev, info, wrqu, extra);
+ vos_ssr_unprotect(__func__);
+
+ return ret;
+}
+
+static int __iw_set_ap_encodeext(struct net_device *dev,
+ struct iw_request_info *info,
+ union iwreq_data *wrqu, char *extra)
{
hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev));
v_CONTEXT_t pVosContext = (WLAN_HDD_GET_CTX(pHostapdAdapter))->pvosContext;
@@ -2455,6 +2469,18 @@
return retval;
}
+static int iw_set_ap_encodeext(struct net_device *dev,
+ struct iw_request_info *info,
+ union iwreq_data *wrqu, char *extra)
+{
+ int ret;
+
+ vos_ssr_protect(__func__);
+ ret = __iw_set_ap_encodeext(dev, info, wrqu, extra);
+ vos_ssr_unprotect(__func__);
+
+ return ret;
+}
static int iw_set_ap_mlme(struct net_device *dev,
struct iw_request_info *info,
@@ -2504,9 +2530,9 @@
// return status;
}
-static int iw_get_ap_rts_threshold(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
+static int __iw_get_ap_rts_threshold(struct net_device *dev,
+ struct iw_request_info *info,
+ union iwreq_data *wrqu, char *extra)
{
hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev));
v_U32_t status = 0;
@@ -2516,9 +2542,22 @@
return status;
}
-static int iw_get_ap_frag_threshold(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
+static int iw_get_ap_rts_threshold(struct net_device *dev,
+ struct iw_request_info *info,
+ union iwreq_data *wrqu, char *extra)
+{
+ int ret;
+
+ vos_ssr_protect(__func__);
+ ret = __iw_get_ap_rts_threshold(dev, info, wrqu, extra);
+ vos_ssr_unprotect(__func__);
+
+ return ret;
+}
+
+static int __iw_get_ap_frag_threshold(struct net_device *dev,
+ struct iw_request_info *info,
+ union iwreq_data *wrqu, char *extra)
{
hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev));
v_U32_t status = 0;
@@ -2528,8 +2567,22 @@
return status;
}
-static int iw_get_ap_freq(struct net_device *dev, struct iw_request_info *info,
- struct iw_freq *fwrq, char *extra)
+static int iw_get_ap_frag_threshold(struct net_device *dev,
+ struct iw_request_info *info,
+ union iwreq_data *wrqu, char *extra)
+{
+ int ret;
+
+ vos_ssr_protect(__func__);
+ ret = __iw_get_ap_frag_threshold(dev, info, wrqu, extra);
+ vos_ssr_unprotect(__func__);
+
+ return ret;
+}
+
+static int __iw_get_ap_freq(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_freq *fwrq, char *extra)
{
v_U32_t status = FALSE, channel = 0, freq = 0;
hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev));
@@ -2586,10 +2639,22 @@
return 0;
}
-static int iw_get_mode(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *wrqu,
- char *extra)
+static int iw_get_ap_freq(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_freq *fwrq, char *extra)
+{
+ int ret;
+
+ vos_ssr_protect(__func__);
+ ret = __iw_get_ap_freq(dev, info, fwrq, extra);
+ vos_ssr_unprotect(__func__);
+
+ return ret;
+}
+
+static int __iw_get_mode(struct net_device *dev,
+ struct iw_request_info *info,
+ union iwreq_data *wrqu, char *extra)
{
int status = 0;
@@ -2598,6 +2663,19 @@
return status;
}
+static int iw_get_mode(struct net_device *dev,
+ struct iw_request_info *info,
+ union iwreq_data *wrqu, char *extra)
+{
+ int ret;
+
+ vos_ssr_protect(__func__);
+ ret = __iw_get_mode(dev, info, wrqu, extra);
+ vos_ssr_unprotect(__func__);
+
+ return ret;
+}
+
static int iw_softap_setwpsie(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu,
@@ -3037,10 +3115,9 @@
return 0;
}
-static int iw_set_ap_genie(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *wrqu,
- char *extra)
+static int __iw_set_ap_genie(struct net_device *dev,
+ struct iw_request_info *info,
+ union iwreq_data *wrqu, char *extra)
{
hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev));
@@ -3078,6 +3155,19 @@
return halStatus;
}
+static int iw_set_ap_genie(struct net_device *dev,
+ struct iw_request_info *info,
+ union iwreq_data *wrqu, char *extra)
+{
+ int ret;
+
+ vos_ssr_protect(__func__);
+ ret = __iw_set_ap_genie(dev, info, wrqu, extra);
+ vos_ssr_unprotect(__func__);
+
+ return ret;
+}
+
static VOS_STATUS wlan_hdd_get_classAstats_for_station(hdd_adapter_t *pAdapter, u8 staid)
{
eHalStatus hstatus;