linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cfg80211: Fix changing regulatory from userspace
@ 2011-11-23  2:30 Timo Lindhorst
  2011-11-23 14:28 ` Luis R. Rodriguez
  0 siblings, 1 reply; 8+ messages in thread
From: Timo Lindhorst @ 2011-11-23  2:30 UTC (permalink / raw)
  To: johannes, linville; +Cc: mcgrof, linux-wireless

The commit de3584bd62d87b4c250129fbc46ca52c80330add -
"cfg80211: fix regulatory NULL dereference" prevents the regulatory
domain from being changed by user space. A wiphy is only present
if the request comes from driver or is set by country IE, thus
check only those cases.

Signed-off-by: Timo Lindhorst <tlnd@online.de>
---
 net/wireless/reg.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 76b35df..c9588ae 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -2076,7 +2076,9 @@ static int __set_regdom(const struct ieee80211_regdomain *rd)
 	}
 
 	request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx);
-	if (!request_wiphy) {
+	if (((last_request->initiator == NL80211_REGDOM_SET_BY_DRIVER) ||
+	     (last_request->initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE)) &&
+	    !request_wiphy) {
 		reg_set_request_processed();
 		return -ENODEV;
 	}
-- 
1.7.7.3


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

end of thread, other threads:[~2011-11-29  8:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-23  2:30 [PATCH] cfg80211: Fix changing regulatory from userspace Timo Lindhorst
2011-11-23 14:28 ` Luis R. Rodriguez
2011-11-23 14:34   ` John W. Linville
2011-11-23 14:42     ` John W. Linville
2011-11-23 14:58       ` Luis R. Rodriguez
2011-11-28 18:45         ` John W. Linville
2011-11-28 19:14           ` Luis R. Rodriguez
2011-11-29  8:32             ` Johannes Berg

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