* [PATCH v2] mac80211: Prevent unregistering of unregistered hw
@ 2007-03-23 19:21 Ivo van Doorn
2007-03-23 20:14 ` Johannes Berg
0 siblings, 1 reply; 4+ messages in thread
From: Ivo van Doorn @ 2007-03-23 19:21 UTC (permalink / raw)
To: Jiri Benc, Linville, John; +Cc: Michael Buesch, linux-wireless, Johannes Berg
At the moment it is possible to call ieee80211_unregister_hw()
for an unregistered hw structure. This will cause a big panic.
This patch will add a BUG_ON() line to warn about this situation.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c
index 577dbe3..e7a613d 100644
--- a/net/mac80211/ieee80211.c
+++ b/net/mac80211/ieee80211.c
@@ -4765,6 +4765,9 @@ void ieee80211_unregister_hw(struct ieee80211_hw *hw)
/* TODO: skb_queue should be empty here, no need to do anything? */
rtnl_lock();
+
+ BUG_ON(local->reg_state != IEEE80211_DEV_REGISTERED);
+
local->reg_state = IEEE80211_DEV_UNREGISTERED;
if (local->apdev)
ieee80211_if_del_mgmt(local);
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] mac80211: Prevent unregistering of unregistered hw
2007-03-23 19:21 [PATCH v2] mac80211: Prevent unregistering of unregistered hw Ivo van Doorn
@ 2007-03-23 20:14 ` Johannes Berg
2007-03-23 20:33 ` Jiri Benc
2007-03-23 22:17 ` Ivo van Doorn
0 siblings, 2 replies; 4+ messages in thread
From: Johannes Berg @ 2007-03-23 20:14 UTC (permalink / raw)
To: Ivo van Doorn; +Cc: Jiri Benc, Linville, John, Michael Buesch, linux-wireless
[-- Attachment #1: Type: text/plain, Size: 668 bytes --]
On Fri, 2007-03-23 at 20:21 +0100, Ivo van Doorn wrote:
> diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c
> index 577dbe3..e7a613d 100644
> --- a/net/mac80211/ieee80211.c
> +++ b/net/mac80211/ieee80211.c
> @@ -4765,6 +4765,9 @@ void ieee80211_unregister_hw(struct ieee80211_hw *hw)
> /* TODO: skb_queue should be empty here, no need to do anything? */
>
> rtnl_lock();
> +
> + BUG_ON(local->reg_state != IEEE80211_DEV_REGISTERED);
> +
Hm. Maybe that's better since then there's no race like in my patch. Use
this one instead of mine please. But it does kill the system pretty
badly if you BUG_ON with rtnl held :)
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] mac80211: Prevent unregistering of unregistered hw
2007-03-23 20:14 ` Johannes Berg
@ 2007-03-23 20:33 ` Jiri Benc
2007-03-23 22:17 ` Ivo van Doorn
1 sibling, 0 replies; 4+ messages in thread
From: Jiri Benc @ 2007-03-23 20:33 UTC (permalink / raw)
To: Johannes Berg
Cc: Ivo van Doorn, Linville, John, Michael Buesch, linux-wireless
On Fri, 23 Mar 2007 21:14:28 +0100, Johannes Berg wrote:
> Hm. Maybe that's better since then there's no race like in my patch. Use
> this one instead of mine please. But it does kill the system pretty
> badly if you BUG_ON with rtnl held :)
Who cares? ;-)
Applied, thanks for the patch.
Jiri
--
Jiri Benc
SUSE Labs
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] mac80211: Prevent unregistering of unregistered hw
2007-03-23 20:14 ` Johannes Berg
2007-03-23 20:33 ` Jiri Benc
@ 2007-03-23 22:17 ` Ivo van Doorn
1 sibling, 0 replies; 4+ messages in thread
From: Ivo van Doorn @ 2007-03-23 22:17 UTC (permalink / raw)
To: Johannes Berg; +Cc: Jiri Benc, John, Michael Buesch, linux-wireless
On Friday 23 March 2007 21:14, Johannes Berg wrote:
> On Fri, 2007-03-23 at 20:21 +0100, Ivo van Doorn wrote:
>
> > diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c
> > index 577dbe3..e7a613d 100644
> > --- a/net/mac80211/ieee80211.c
> > +++ b/net/mac80211/ieee80211.c
> > @@ -4765,6 +4765,9 @@ void ieee80211_unregister_hw(struct ieee80211_hw *hw)
> > /* TODO: skb_queue should be empty here, no need to do anything? */
> >
> > rtnl_lock();
> > +
> > + BUG_ON(local->reg_state != IEEE80211_DEV_REGISTERED);
> > +
>
> Hm. Maybe that's better since then there's no race like in my patch. Use
> this one instead of mine please. But it does kill the system pretty
> badly if you BUG_ON with rtnl held :)
Well it would increase motivation to fix such a bug in the driver then. ;)
(yes, fixing that bug in rt2x00 is on my todo list :P)
Ivo
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-03-23 22:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-23 19:21 [PATCH v2] mac80211: Prevent unregistering of unregistered hw Ivo van Doorn
2007-03-23 20:14 ` Johannes Berg
2007-03-23 20:33 ` Jiri Benc
2007-03-23 22:17 ` Ivo van Doorn
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).