linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6.37] mac80211: add missing synchronize_rcu
@ 2011-01-03 18:42 Johannes Berg
  0 siblings, 0 replies; only message in thread
From: Johannes Berg @ 2011-01-03 18:42 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless@vger.kernel.org

From: Johannes Berg <johannes.berg@intel.com>

commit ad0e2b5a00dbec303e4682b403bb6703d11dcdb2
Author: Johannes Berg <johannes.berg@intel.com>
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.

Reported-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Cc: stable@kernel.org [2.6.36+]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/key.c |    6 ++++++
 1 file changed, 6 insertions(+)

--- wireless-testing.orig/net/mac80211/key.c	2011-01-03 19:04:10.000000000 +0100
+++ wireless-testing/net/mac80211/key.c	2011-01-03 19:04:20.000000000 +0100
@@ -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);
 



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-01-03 18:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-03 18:42 [PATCH 2.6.37] mac80211: add missing synchronize_rcu Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).