Skip to contentSkip to conversation

mac80211: add missing synchronize_rcu

PATCH New Johannes Berg 1 participant 1 message Jan 3, 2011 mac80211

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 mac80211: add missing synchronize_rcu

From: Johannes Berg <[email protected]>

commit ad0e2b5a00dbec303e4682b403bb6703d11dcdb2

Author: Johannes Berg <[email protected]>
Date:   Tue Jun 1 10:19:19 2010 +0200

mac80211: simplify key locking

removed the synchronization against RCU and thus opened a race window where we can use a key for TX while it is already freed. Put a synchronisation into the right place to close that window.

---
 net/mac80211/key.c |    6 ++++++
 1 file changed, 6 insertions(+)
net/mac80211/key.c +6 -0
@@ -379,6 +379,12 @@ static void __ieee80211_key_destroy(stru
 	if (!key)
 		return;
 
+	/*
+	 * Synchronize so the TX path can no longer be using
+	 * this key before we free/remove it.
+	 */
+	synchronize_rcu();
+
 	if (key->local)
 		ieee80211_key_disable_hw_accel(key);