Skip to contentSkip to conversation

mac80211: Fix NULL-pointer deference on ibss merge when not ready

PATCH Superseded Tim Harvey 2 participants 2 messages Dec 9, 2010 mac80211

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Tim Harvey

author
#0 lore raw

PATCH 1/1 mac80211: Fix NULL-pointer deference on ibss merge when not ready

dev_open will eventually call ieee80211_ibss_join which sets up the skb used for beacons/probe-responses however it is possible to receive beacons that attempt to merge before this occurs causing a null pointer dereference.

This occurs quite easily in the presence of adhoc nodes with hidden SSID's

---
 net/mac80211/ibss.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
net/mac80211/ibss.c +2 -0
index 410d104..24e2482 100644
@@ -86,6 +86,8 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
 	drv_reset_tsf(local);
 
 	skb = ifibss->skb;
+	if (!skb)
+		return; /* not ready to merge yet */
 	rcu_assign_pointer(ifibss->presp, NULL);
 	synchronize_rcu();
 	skb->data = skb->head;
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 9 lines · Tim Harvey

dev_open will eventually call ieee80211_ibss_join which sets up the skb used for beacons/probe-responses however it is possible to receive beacons that attempt to merge before this occurs causing a null pointer dereference.

This occurs quite easily in the presence of adhoc nodes with hidden SSID's

---
 net/mac80211/ibss.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Signed-off-by?

Signature · 2 lines
John W. Linville		Someday the world will need a hero, and you
[email protected]			might be all we have.  Be ready.