Skip to content

Commit

Permalink
mwifiex: cfg80211: do not change virtual interface during scan proces…
Browse files Browse the repository at this point in the history
…sing

(1) Change virtual interface operation in cfg80211 process reset and
reinitilize private data structure.
(2) Scan result event processed in main process will dereference private
data structure concurrently, ocassionly crash the kernel.

The cornel case could be trigger by below steps:
(1) wpa_cli mlan0 scan
(2) ./hostapd mlan0.conf

Cfg80211 asynchronous scan procedure is not all the time operated
under rtnl lock, here we add the protect to serialize the cfg80211
scan and change_virtual interface operation.

Signed-off-by: Limin Zhu <liminzhu@marvell.com>
Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  • Loading branch information
Limin Zhu authored and Kalle Valo committed Dec 7, 2017
1 parent 71121e4 commit c61cfe4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/net/wireless/marvell/mwifiex/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,12 @@ mwifiex_cfg80211_change_virtual_intf(struct wiphy *wiphy,
struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
enum nl80211_iftype curr_iftype = dev->ieee80211_ptr->iftype;

if (priv->scan_request) {
mwifiex_dbg(priv->adapter, ERROR,
"change virtual interface: scan in process\n");
return -EBUSY;
}

switch (curr_iftype) {
case NL80211_IFTYPE_ADHOC:
switch (type) {
Expand Down

0 comments on commit c61cfe4

Please sign in to comment.