Skip to contentSkip to conversation

d80211: Reinit keys on mode change

PATCH In review Jan Kiszka 2 participants 2 messages Jan 1, 2007 – Jan 2, 2007

Subsystems (2)
lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 d80211: Reinit keys on mode change

Switching the interface mode with some encryption keys set and then later touching any key, triggers an oops because ieee80211_if_reinit fails to NULL'ify the related pointers after free'ing the key on mode change. Long explanation, simple fix below.

[Sorry, yet another rt2x00 CVS patch...]

---
 ieee80211/ieee80211_iface.c |    1 +
 1 file changed, 1 insertion(+)
ieee80211/ieee80211_iface.c +1 -0
Index: rt2x00/ieee80211/ieee80211_iface.c
===================================================================
@@ -231,6 +231,7 @@ void ieee80211_if_reinit(struct net_devi
 					    local->keys[i], 0);
 #endif
 		ieee80211_key_free(sdata->keys[i]);
+		sdata->keys[i] = NULL;
 	}
 
 	/* Shouldn't be necessary but won't hurt */
#1 lore raw
Quoted 8 lines · Jan Kiszka

Switching the interface mode with some encryption keys set and then later touching any key, triggers an oops because ieee80211_if_reinit fails to NULL'ify the related pointers after free'ing the key on mode change. Long explanation, simple fix below.

[Sorry, yet another rt2x00 CVS patch...]

To make it easier for everybody, here is the same patch only this time applied to the dscape git tree. ;)

---

net/d80211/ieee80211_iface.c +0 -0
index 3e9d531..7d4ec56 100644
@@ -229,6 +229,7 @@ void ieee80211_if_reinit(struct net_device *dev)
					   local->keys[i], 0);
#endif
		ieee80211_key_free(sdata->keys[i]);
+		sdata->keys[i] = NULL;
	}

	/* Shouldn't be necessary but won't hurt */