Skip to contentSkip to conversation

cfg80211: defautl CONFIG_WIRELESS_OLD_REGULATORY to n

PATCH New Luis R. Rodriguez 3 participants 4 messages Mar 25, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cfg80211: defautl CONFIG_WIRELESS_OLD_REGULATORY to n

And update description and feature-removal schedule according to the new plan.

---
 Documentation/feature-removal-schedule.txt |   13 +++++++---
 net/wireless/Kconfig                       |   37 +++++++---------------------
 2 files changed, 18 insertions(+), 32 deletions(-)
Documentation/feature-removal-schedule.txt +9 -4
index 020bc66..d0914e3 100644
@@ -7,7 +7,7 @@ be removed from this file.
 ---------------------------
 
 What:	The ieee80211_regdom module parameter
-When:	March 2010
+When:	March 2010 / desktop catchup
 
 Why:	This was inherited by the CONFIG_WIRELESS_OLD_REGULATORY code,
 	and currently serves as an option for users to define an
@@ -30,18 +30,23 @@ Who:	Luis R. Rodriguez <[email protected]>
 
 ---------------------------
 
-What:	old static regulatory information
-When:	2.6.29
+What:	CONFIG_WIRELESS_OLD_REGULATORY - old static regulatory information
+When:	March 2010 / desktop catchup
+
 Why:	The old regulatory infrastructure has been replaced with a new one
 	which does not require statically defined regulatory domains. We do
 	not want to keep static regulatory domains in the kernel due to the
 	the dynamic nature of regulatory law and localization. We kept around
 	the old static definitions for the regulatory domains of:
+
 		* US
 		* JP
 		* EU
+
 	and used by default the US when CONFIG_WIRELESS_OLD_REGULATORY was
-	set.
+	set. We will remove this option once the standard Linux desktop catches
+	up with the new userspace APIs we have implemented.
+
 Who:	Luis R. Rodriguez <[email protected]>
 
 ---------------------------
net/wireless/Kconfig +9 -28
index d1d18f3..3c3bc9e 100644
@@ -12,36 +12,17 @@ config CFG80211_REG_DEBUG
 
 config WIRELESS_OLD_REGULATORY
 	bool "Old wireless static regulatory definitions"
-	default y
+	default n
 	---help---
 	  This option enables the old static regulatory information
-	  and uses it within the new framework. This is available
-	  temporarily as an option to help prevent immediate issues
-	  due to the switch to the new regulatory framework which
-	  does require a new userspace application which has the
-	  database of regulatory information (CRDA) and another for
-	  setting regulatory domains (iw).
-
-	  For more information see:
-
-	  http://wireless.kernel.org/en/developers/Regulatory/CRDA
-	  http://wireless.kernel.org/en/users/Documentation/iw
-
-	  It is important to note though that if you *do* have CRDA present
-	  and if this option is enabled CRDA *will* be called to update the
-	  regulatory domain (for US and JP only). Support for letting the user
-	  set the regulatory domain through iw is also supported. This option
-	  mainly exists to leave around for a kernel release some old static
-	  regulatory domains that were defined and to keep around the old
-	  ieee80211_regdom module parameter. This is being phased out and you
-	  should stop using them ASAP.
-
-	  Note: You will need CRDA if you want 802.11d support
-
-	  Say Y unless you have installed a new userspace application.
-	  Also say Y if have one currently depending on the ieee80211_regdom
-	  module parameter and cannot port it to use the new userspace
-	  interfaces.
+	  and uses it within the new framework. This option is available
+	  for historical reasons and it is advised to leave it off.
+
+	  For details see:
+
+	  http://wireless.kernel.org/en/developers/Regulatory
+
+	  Say N and if you say Y, please tell us why. The default is N.
 
 config WIRELESS_EXT
 	bool "Wireless extensions"
Signature · 1 line
1.6.0.6
#1 lore raw

PATCH 1/1 cfg80211: fix NULL pointer deference in reg_device_remove()

We won't ever get here as regulatory_hint_core() can only fail on -ENOMEM and in that case we don't initialize cfg80211 but this is technically correct code.

This is actually good for stable, where we don't check for -ENOMEM failure on __regulatory_hint()'s failure.

---
 net/wireless/reg.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
net/wireless/reg.c +3 -2
index 6327e16..6c1993d 100644
@@ -2095,11 +2095,12 @@ int set_regdom(const struct ieee80211_regdomain *rd)
 /* Caller must hold cfg80211_mutex */
 void reg_device_remove(struct wiphy *wiphy)
 {
-	struct wiphy *request_wiphy;
+	struct wiphy *request_wiphy = NULL;
 
 	assert_cfg80211_lock();
 
-	request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx);
+	if (last_request)
+		request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx);
 
 	kfree(wiphy->regd);
 	if (!last_request || !request_wiphy)
Signature · 1 line
1.6.0.6
#2 lore raw

Re: [PATCH] cfg80211: fix NULL pointer deference in reg_device_remove()

net/wireless/reg.c int set_regdom(const struct ieee80211_regdomain *rd) · line 2098

Quoted 4 lines · Luis R. Rodriguez

void reg_device_remove(struct wiphy *wiphy)
{

net/wireless/reg.c +1 -1
-	struct wiphy *request_wiphy;
+	struct wiphy *request_wiphy = NULL;

I think the assignment of NULL to request_wiphy is not necessary here, since request_wiphy is set below if last_request != NULL and request_wiphy is only tested if last_request != NULL. But then again, this function isn't called very often.

Quoted 9 lines
net/wireless/reg.c +2 -1
 	assert_cfg80211_lock();
 
-	request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx);
+	if (last_request)
+		request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx);
 
 	kfree(wiphy->regd);
 	if (!last_request || !request_wiphy)
#3 lore raw

Re: [PATCH] cfg80211: fix NULL pointer deference in reg_device_remove()

Quoted 7 lines · Quentin Armitage
Quoted 4 lines · Luis R. Rodriguez

=C2=A0void reg_device_remove(struct wiphy *wiphy) =C2=A0{
- =C2=A0 =C2=A0 struct wiphy *request_wiphy;
+ =C2=A0 =C2=A0 struct wiphy *request_wiphy =3D NULL;

I think the assignment of NULL to request_wiphy is not necessary here=

,

Sparse complains otherwise, or gcc, I forget which.

Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html