Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] mac80211: Fix NULL-pointer deference on ibss merge when not ready
@ 2010-12-09 16:43 Tim Harvey
  2010-12-09 17:19 ` John W. Linville
  0 siblings, 1 reply; 2+ messages in thread
From: Tim Harvey @ 2010-12-09 16:43 UTC (permalink / raw)
  To: linux-wireless; +Cc: 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(-)

diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 410d104..24e2482 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -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;
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-12-09 17:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-09 16:43 [PATCH] mac80211: Fix NULL-pointer deference on ibss merge when not ready Tim Harvey
2010-12-09 17:19 ` John W. Linville

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox