cfg80211: fix regulatory NULL dereference
Johannes Berg
maintainerPATCH 1/1 cfg80211: fix regulatory NULL dereference
From: Johannes Berg <[email protected]>
By the time userspace returns with a response to the regulatory domain request, the wiphy causing the request might have gone away. If this is so, reject the update but mark the request as having been processed anyway.
--- net/wireless/reg.c | 4 ++++ 1 file changed, 4 insertions(+)
net/wireless/reg.c +4 -0
@@ -2037,6 +2037,10 @@ static int __set_regdom(const struct iee } request_wiphy =wiphy_idx_to_wiphy (last_request->wiphy_idx); +if (!request_wiphy) { +reg_set_request_processed (); +return -ENODEV ; + }if (!last_request->intersect) {int r;
Johannes Berg
maintainerQuoted 10 lines · Johannes Berg
From: Johannes Berg <[email protected]>
By the time userspace returns with a response to the regulatory domain request, the wiphy causing the request might have gone away. If this is so, reject the update but mark the request as having been processed anyway.
Cc Luis R. Rodriguez <[email protected]>Signed-off-by Johannes Berg <[email protected]>
Oops, Cc: [email protected]
johannes
Quoted 17 lines · Johannes Berg
From: Johannes Berg <[email protected]>
By the time userspace returns with a response to the regulatory domain request, the wiphy causing the request might have gone away. If this is so, reject the update but mark the request as having been processed anyway.
Cc Luis R. Rodriguez <[email protected]>Signed-off-by Johannes Berg <[email protected]>---
net/wireless/reg.c | 4 ++++1 file changed, 4 insertions(+)
net/wireless/reg.c 2011-11-21 10:41:57.000000000 +0100 static int __set_regdom(const struct iee · line 2046
Quoted 10 lines
net/wireless/reg.c 2011-11-21 10:41:57.000000000 +0100 renamed from net/wireless/reg.c 2011-11-10 09:27:32.000000000 +0100 +4
-0@@ -2037,6 +2037,10 @@ static int __set_regdom(const struct iee } request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx); + if (!request_wiphy) { + reg_set_request_processed(); + return -ENODEV; + } if (!last_request->intersect) { int r;
last_request is still populated with the driver request info though, so you'd have to reset_regdomains() too to clear last_request as if we're starting all over again. If you don't get to it, I'm working on two fixes that cover this.
Luis