Skip to contentSkip to conversation

cfg80211: Fix for crash in cfg80211

PATCH In review Srinivasan B 3 participants 4 messages Aug 7, 2012 802.11 (including cfg80211/NL80211)

lore
Share & tools
lore
#0 lore raw

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
index dcd64d5..74bb7c4 100755
@@ -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
maintainer
#1 lore raw
Quoted 5 lines · Srinivasan B

Patch Description:

                     cfg80211 module crashes when cfg80211 & mac80211 

loaded and unloading lmac driver.

Scenario Explanation:

Quoted 8 lines
                     (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.

This doesn't make any sense to me at all.

johannes

#2 lore raw
Quoted 15 lines · Johannes Berg
Quoted 5 lines · Srinivasan B

Patch Description:

                      cfg80211 module crashes when cfg80211 & mac80211

loaded and unloading lmac driver.

Scenario Explanation:

Quoted 8 lines
                      (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.

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

maintainer
#3 lore raw
Quoted 5 lines · Mahesh Palivela
Quoted 5 lines
Quoted 2 lines
                      dev->ethtools_ops is assigned during

NETDEV_REGISTER and the same can be cleared during NETDEV_UNREGISTER.

This doesn't make any sense to me at all.

Quoted 7 lines

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.

I don't see how anything could access ethtool_ops after the netdev is unregistered.

johannes