Search Linux Wireless

[PATCH] cfg80211: Fix changing regulatory from userspace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux