cfg80211: Fix for crash in cfg80211
PATCH 1/1 cfg80211: Fix for crash in cfg80211
Patch Description:
cfg80211 module crashes when cfg80211 & mac80211
loaded and unloading lmac driver.
Scenario Explanation:
(Step 1) : cfg80211, mac80211 and lmac driver
modules are loaded initially.
(Step 2) : unload the lmac driver.
then any dev calls to stack causes
the crash.
Code Changes:
dev->ethtools_ops is assigned during
NETDEV_REGISTER and the same can be cleared during NETDEV_UNREGISTER.
---
net/wireless/core.c +4 -0
@@ -944,6 +944,10 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,#endif }mutex_unlock (&rdev->devlist_mtx); + +if (dev->ethtool_ops) + dev->ethtool_ops =NULL ; +/* * synchronise (so that we won't find this netdev * from other code any more) and then clear the list
Johannes Berg
maintainerQuoted 5 lines · Srinivasan B
Patch Description:
cfg80211 module crashes when cfg80211 & mac80211loaded and unloading lmac driver.
Scenario Explanation:
Quoted 8 lines
(Step 1) : cfg80211, mac80211 and lmac drivermodules are loaded initially.
(Step 2) : unload the lmac driver.
then any dev calls to stack causes
the crash.
Code Changes:dev->ethtools_ops is assigned during
NETDEV_REGISTERand the same can be cleared duringNETDEV_UNREGISTER.
This doesn't make any sense to me at all.
johannes
Quoted 15 lines · Johannes Berg
Quoted 5 lines · Srinivasan B
Patch Description:
cfg80211 module crashes when cfg80211 & mac80211loaded and unloading lmac driver.
Scenario Explanation:
Quoted 8 lines
(Step 1) : cfg80211, mac80211 and lmac drivermodules are loaded initially.
(Step 2) : unload the lmac driver.
then any dev calls to stack causes
the crash.
Code Changes:dev->ethtools_ops is assigned during
NETDEV_REGISTERand the same can be cleared duringNETDEV_UNREGISTER.
Quoted 2 lines
This doesn't make any sense to me at all.
cleanup of ethtools_ops pointer is required upon netdev_unreg notification. we are assigning this pointer to cfg80211_ethtool_ops on netdev_reg notification. Is it not required?
we have seen crash when keeping cfg80211 and mac80211 loaded and lmac driver unloaded. With this fix, we didn't see crash. Crash doesn't happen right away. Only when some operation trying to access ethtool_ops.
Quoted 7 lines
johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Johannes Berg
maintainerQuoted 5 lines · Mahesh Palivela
Quoted 5 lines
Quoted 2 lines
dev->ethtools_ops is assigned during
NETDEV_REGISTERand the same can be cleared duringNETDEV_UNREGISTER.This doesn't make any sense to me at all.
Quoted 7 lines
cleanup of
ethtools_opspointer is required uponnetdev_unregnotification. we are assigning this pointer tocfg80211_ethtool_opsonnetdev_regnotification. Is it not required?we have seen crash when keeping cfg80211 and mac80211 loaded and lmac driver unloaded. With this fix, we didn't see crash. Crash doesn't happen right away. Only when some operation trying to access
ethtool_ops.
I don't see how anything could access ethtool_ops after the netdev is unregistered.
johannes