* [PATCH] mac80211: Add netif state checking to ieee80211_ifa_changed
@ 2010-06-07 7:52 Juuso Oikarinen
2010-06-07 16:52 ` reinette chatre
0 siblings, 1 reply; 2+ messages in thread
From: Juuso Oikarinen @ 2010-06-07 7:52 UTC (permalink / raw)
To: linville; +Cc: reinette.chatre, linux-wireless
There's a window for ieee80211_ifa_changed() to get called whilst the
managed mode mutex has not been initialized when opening and stopping the
interface. Currently this causes a kernel BUG like the following:
[ 132.460013] kernel BUG at /home/wifi/iwlwifi-2.6/net/mac80211/main.c:380!
[ 132.460013] invalid opcode: 0000 [#1] SMP
The mutex is initialized during open(), hence once netif_running() is true,
the mutex should be valid. Fix by adding a netif_running() check to the
function.
Reported-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
---
net/mac80211/main.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 5706156..88b671a 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -359,6 +359,9 @@ static int ieee80211_ifa_changed(struct notifier_block *nb,
struct ieee80211_sub_if_data *sdata;
struct ieee80211_if_managed *ifmgd;
+ if (!netif_running(ndev))
+ return NOTIFY_DONE;
+
/* Make sure it's our interface that got changed */
if (!wdev)
return NOTIFY_DONE;
--
1.6.3.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mac80211: Add netif state checking to ieee80211_ifa_changed
2010-06-07 7:52 [PATCH] mac80211: Add netif state checking to ieee80211_ifa_changed Juuso Oikarinen
@ 2010-06-07 16:52 ` reinette chatre
0 siblings, 0 replies; 2+ messages in thread
From: reinette chatre @ 2010-06-07 16:52 UTC (permalink / raw)
To: Juuso Oikarinen; +Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org
Hi Juuso,
On Mon, 2010-06-07 at 00:52 -0700, Juuso Oikarinen wrote:
> There's a window for ieee80211_ifa_changed() to get called whilst the
> managed mode mutex has not been initialized when opening and stopping the
> interface. Currently this causes a kernel BUG like the following:
>
> [ 132.460013] kernel BUG at /home/wifi/iwlwifi-2.6/net/mac80211/main.c:380!
> [ 132.460013] invalid opcode: 0000 [#1] SMP
>
> The mutex is initialized during open(), hence once netif_running() is true,
> the mutex should be valid. Fix by adding a netif_running() check to the
> function.
>
> Reported-by: Reinette Chatre <reinette.chatre@intel.com>
> Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Thank you very much. I've been running with this patch for more than ten
iterations of my testing and I have not encountered this issue again.
Tested-by: Reinette Chatre <reinette.chatre@intel.com>
Reinette
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-06-07 16:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-07 7:52 [PATCH] mac80211: Add netif state checking to ieee80211_ifa_changed Juuso Oikarinen
2010-06-07 16:52 ` reinette chatre
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox