[lkml]   [2009]   [Jun]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[patch 063/108] cfg80211: fix for duplicate userspace replies
2.6.30-stable review patch.  If anyone has any objections, please let us know.


From: Luis R. Rodriguez <>

commit 729e9c7663190d71fe5e29831634df80f38199c1 upstream.

This fixes an incorrect assumption (BUG_ON) made in
cfg80211 when handling country IE regulatory requests.
The assumption was that we won't try to call_crda()
twice for the same event and therefore we will not
recieve two replies through nl80211 for the regulatory
request. As it turns out it is true we don't call_crda()
twice for the same event, however, kobject_uevent_env()
*might* send the udev event twice and/or userspace can
simply process the udev event twice. We remove the BUG_ON()
and simply ignore the duplicate request.

For details refer to this thread:

Reported-by: Maxim Levitsky <>
Signed-off-by: Luis R. Rodriguez <>
Signed-off-by: John W. Linville <>
Signed-off-by: Greg Kroah-Hartman <>

net/wireless/reg.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -2042,7 +2042,13 @@ static int __set_regdom(const struct iee
* the country IE rd with what CRDA believes that country should have

- BUG_ON(!country_ie_regdomain);
+ /*
+ * Userspace could have sent two replies with only
+ * one kernel request. By the second reply we would have
+ * already processed and consumed the country_ie_regdomain.
+ */
+ if (!country_ie_regdomain)
+ return -EALREADY;
BUG_ON(rd == country_ie_regdomain);


 \ /
  Last update: 2009-07-01 03:33    [W:0.224 / U:6.172 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site