linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* mac80211 crash in ieee80211_sta_scan_work
@ 2008-01-28  9:07 Larry Finger
  2008-01-28  9:29 ` Tomas Winkler
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Larry Finger @ 2008-01-28  9:07 UTC (permalink / raw)
  To: Johannes Berg; +Cc: John Linville, wireless

Johannes,

With the latest wireless-2.6 git tree on my x86_64 system, I am getting a GPF in
ieee80211_sta_scan_work. I tracked it down to the following astatement:

                if (!sband ||
                    (local->scan_channel_idx >= sband->n_channels &&
                     local->scan_band >= IEEE80211_NUM_BANDS)) {

Specifically, it is the "local->scan_channel_idx >= sband->n_channels" part of the if test. When I
added test prints of local->scan_channel_idx, local->scan_band, and sband, I got the following:

mac80211: scan_channel_idx = 0, scan_band = 0, sband = ffffffff882c2f10
mac80211: scan_channel_idx = 1, scan_band = 0, sband = ffffffff882c2f10
...
...
mac80211: scan_channel_idx = 13, scan_band = 0, sband = ffffffff882c2f10
mac80211: scan_channel_idx = 0, scan_band = 2, sband = dead4ead00000001
general protection fault: 0000 [1] SMP

As can be seen, "sband" is some kind of magic number and is an invalid pointer when scan_band is
larger than IEEE80211_NUM_BANDS, which causes the GPF.

With the following patch, it works:

Index: wireless-2.6/net/mac80211/ieee80211_sta.c
===================================================================
--- wireless-2.6.orig/net/mac80211/ieee80211_sta.c
+++ wireless-2.6/net/mac80211/ieee80211_sta.c
@@ -3237,8 +3237,7 @@ void ieee80211_sta_scan_work(struct work
 		}

 		if (!sband ||
-		    (local->scan_channel_idx >= sband->n_channels &&
-		     local->scan_band >= IEEE80211_NUM_BANDS)) {
+		     local->scan_band >= IEEE80211_NUM_BANDS) {
 			ieee80211_scan_completed(local_to_hw(local));
 			return;
 		}

It seems to me that it should be OK to skip the scan_chan_idx >= sband->n_channels part of the test
as scan_band won't get to be >= to IEEE80211_NUM_BANDS until all the channels have been tested in
the legal bands.

Larry



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

end of thread, other threads:[~2008-01-28 18:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-28  9:07 mac80211 crash in ieee80211_sta_scan_work Larry Finger
2008-01-28  9:29 ` Tomas Winkler
2008-01-28  9:37   ` stefano.brivio
2008-01-28  9:48     ` Tomas Winkler
2008-01-28 15:12       ` John W. Linville
2008-01-28 17:07         ` Michael Buesch
2008-01-28 17:46           ` Larry Finger
2008-01-28 18:19             ` John W. Linville
2008-01-28 18:39               ` Michael Buesch
2008-01-28 15:18       ` Michael Buesch
2008-01-28 12:35 ` Bas Hulsken
2008-01-28 17:25 ` Jory A. Pratt

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).