linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cfg80211: fix regulatory NULL dereference
@ 2011-11-21  9:44 Johannes Berg
  2011-11-21  9:45 ` Johannes Berg
  2011-11-21 19:39 ` Luis R. Rodriguez
  0 siblings, 2 replies; 3+ messages in thread
From: Johannes Berg @ 2011-11-21  9:44 UTC (permalink / raw)
  To: John Linville; +Cc: Luis R. Rodriguez, linux-wireless

From: Johannes Berg <johannes.berg@intel.com>

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 <lrodriguez@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/wireless/reg.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/net/wireless/reg.c	2011-11-10 09:27:32.000000000 +0100
+++ b/net/wireless/reg.c	2011-11-21 10:41:57.000000000 +0100
@@ -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;



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

* Re: [PATCH] cfg80211: fix regulatory NULL dereference
  2011-11-21  9:44 [PATCH] cfg80211: fix regulatory NULL dereference Johannes Berg
@ 2011-11-21  9:45 ` Johannes Berg
  2011-11-21 19:39 ` Luis R. Rodriguez
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2011-11-21  9:45 UTC (permalink / raw)
  To: John Linville; +Cc: Luis R. Rodriguez, linux-wireless

On Mon, 2011-11-21 at 10:44 +0100, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> 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 <lrodriguez@qca.qualcomm.com>
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Oops, Cc: stable@vger.kernel.org

johannes


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

* Re: [PATCH] cfg80211: fix regulatory NULL dereference
  2011-11-21  9:44 [PATCH] cfg80211: fix regulatory NULL dereference Johannes Berg
  2011-11-21  9:45 ` Johannes Berg
@ 2011-11-21 19:39 ` Luis R. Rodriguez
  1 sibling, 0 replies; 3+ messages in thread
From: Luis R. Rodriguez @ 2011-11-21 19:39 UTC (permalink / raw)
  To: Johannes Berg; +Cc: John Linville, linux-wireless

On Mon, Nov 21, 2011 at 1:44 AM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> 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 <lrodriguez@qca.qualcomm.com>
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
>  net/wireless/reg.c |    4 ++++
>  1 file changed, 4 insertions(+)
>
> --- a/net/wireless/reg.c        2011-11-10 09:27:32.000000000 +0100
> +++ b/net/wireless/reg.c        2011-11-21 10:41:57.000000000 +0100
> @@ -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

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

end of thread, other threads:[~2011-11-21 19:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-21  9:44 [PATCH] cfg80211: fix regulatory NULL dereference Johannes Berg
2011-11-21  9:45 ` Johannes Berg
2011-11-21 19:39 ` Luis R. Rodriguez

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