diff options
| author | Mahesh A Saptasagar <c_msapta@qti.qualcomm.com> | 2014-06-02 18:28:08 +0530 |
|---|---|---|
| committer | Akash Patel <c_akashp@qca.qualcomm.com> | 2014-06-21 02:10:05 -0700 |
| commit | 772cd7d54b5f6dbcef68e08abd0ba0d4ec699bc0 (patch) | |
| tree | a24920597c4c8b12b81723c879e7d65b688e2eb2 | |
| parent | 2ca3b1cb9aa5f5402719e54dad40b0d8933b7294 (diff) | |
wlan: Protect add get and set_default key functions from SSR
Protect add get and set default key cfg80211 functions from
accessing deallocated/unitialized data structures while SSR
is in progress.
Change-Id: I33e0a10d1f703b090835e9b4234d7926cad97727
CRs-Fixed: 676792
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg80211.c | 60 |
1 files changed, 54 insertions, 6 deletions
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index 702af5488b2f..5d18bbe4dc56 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -4188,10 +4188,10 @@ static int wlan_hdd_change_station(struct wiphy *wiphy, } /* - * FUNCTION: wlan_hdd_cfg80211_add_key + * FUNCTION: __wlan_hdd_cfg80211_add_key * This function is used to initialize the key information */ -static int wlan_hdd_cfg80211_add_key( struct wiphy *wiphy, +static int __wlan_hdd_cfg80211_add_key( struct wiphy *wiphy, struct net_device *ndev, u8 key_index, bool pairwise, const u8 *mac_addr, @@ -4545,11 +4545,27 @@ static int wlan_hdd_cfg80211_add_key( struct wiphy *wiphy, return 0; } +static int wlan_hdd_cfg80211_add_key( struct wiphy *wiphy, + struct net_device *ndev, + u8 key_index, bool pairwise, + const u8 *mac_addr, + struct key_params *params + ) +{ + int ret; + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_add_key(wiphy, ndev, key_index, pairwise, + mac_addr, params); + vos_ssr_unprotect(__func__); + + return ret; +} + /* - * FUNCTION: wlan_hdd_cfg80211_get_key + * FUNCTION: __wlan_hdd_cfg80211_get_key * This function is used to get the key information */ -static int wlan_hdd_cfg80211_get_key( +static int __wlan_hdd_cfg80211_get_key( struct wiphy *wiphy, struct net_device *ndev, u8 key_index, bool pairwise, @@ -4615,6 +4631,24 @@ static int wlan_hdd_cfg80211_get_key( return 0; } +static int wlan_hdd_cfg80211_get_key( + struct wiphy *wiphy, + struct net_device *ndev, + u8 key_index, bool pairwise, + const u8 *mac_addr, void *cookie, + void (*callback)(void *cookie, struct key_params*) + ) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_get_key(wiphy, ndev, key_index, pairwise, + mac_addr, cookie, callback); + vos_ssr_unprotect(__func__); + + return ret; +} + /* * FUNCTION: wlan_hdd_cfg80211_del_key * This function is used to delete the key information @@ -4722,10 +4756,10 @@ static int wlan_hdd_cfg80211_del_key( struct wiphy *wiphy, } /* - * FUNCTION: wlan_hdd_cfg80211_set_default_key + * FUNCTION: __wlan_hdd_cfg80211_set_default_key * This function is used to set the default tx key index */ -static int wlan_hdd_cfg80211_set_default_key( struct wiphy *wiphy, +static int __wlan_hdd_cfg80211_set_default_key( struct wiphy *wiphy, struct net_device *ndev, u8 key_index, bool unicast, bool multicast) @@ -4864,6 +4898,20 @@ static int wlan_hdd_cfg80211_set_default_key( struct wiphy *wiphy, return status; } +static int wlan_hdd_cfg80211_set_default_key( struct wiphy *wiphy, + struct net_device *ndev, + u8 key_index, + bool unicast, bool multicast) +{ + int ret; + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_set_default_key(wiphy, ndev, key_index, unicast, + multicast); + vos_ssr_unprotect(__func__); + + return ret; +} + /* * FUNCTION: wlan_hdd_cfg80211_inform_bss * This function is used to inform the BSS details to nl80211 interface. |
