wlan: Add "compat" support in iw_setnone_getnone
The pointer passed to iw_setnone_getnone() handler is not
safe when used in a 32U/64K environment.
Add "compat" support so that when the driver is part of a
64-bit kernel, all the sub commands will work with 32-bit
userspace applications
Change-Id: I8bca47cc6e1eece5e7c964082adf28d517b3f5a3
CRs-Fixed: 680356
diff --git a/CORE/HDD/src/wlan_hdd_wext.c b/CORE/HDD/src/wlan_hdd_wext.c
index cf500ab..aa71177 100644
--- a/CORE/HDD/src/wlan_hdd_wext.c
+++ b/CORE/HDD/src/wlan_hdd_wext.c
@@ -5132,8 +5132,9 @@
union iwreq_data *wrqu, char *extra)
{
hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
- int sub_cmd = wrqu->data.flags;
+ int sub_cmd;
int ret = 0; /* success */
+ struct iw_point s_priv_data;
if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress)
{
@@ -5142,6 +5143,14 @@
return -EBUSY;
}
+ /* helper function to get iwreq_data with compat handling. */
+ if (hdd_priv_get_data(&s_priv_data, wrqu))
+ {
+ return -EINVAL;
+ }
+
+ sub_cmd = s_priv_data.flags;
+
switch (sub_cmd)
{
case WE_CLEAR_STATS: