linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: "Luis R. Rodriguez" <mcgrof@qca.qualcomm.com>
Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [RFC 2/2] cfg80211: amend regulatory NULL dereference fix
Date: Thu, 24 Nov 2011 16:22:22 +0100	[thread overview]
Message-ID: <1322148142.5366.25.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <1322060687-6512-3-git-send-email-mcgrof@qca.qualcomm.com> (sfid-20111123_160529_165324_6E4AEB51)

On Wed, 2011-11-23 at 10:04 -0500, Luis R. Rodriguez wrote:
> Johannes' patch for "cfg80211: fix regulatory NULL dereference"
> broke user regulaotry hints and it did not address the fact that
> last_request was left populated even if the previous regulatory
> hint was stale due to the wiphy disappearing.
> 
> Fix user reguluatory hints by only bailing out if for those
> regulatory hints where a request_wiphy is expected. The stale last_request
> considerations are addressed through the previous fixes on last_request
> where we reset the last_request to a static world regdom request upon
> reset_regdomains(). In this case though we further enhance the effect
> by simply restoring reguluatory settings completely.
> 
> Cc: stable@vger.kernel.org
> Cc: Johannes Berg <johannes.berg@intel.com>
> Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
> ---
>  net/wireless/reg.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/net/wireless/reg.c b/net/wireless/reg.c
> index df73b96..6049050 100644
> --- a/net/wireless/reg.c
> +++ b/net/wireless/reg.c
> @@ -2091,8 +2091,10 @@ static int __set_regdom(const struct ieee80211_regdomain *rd)
>  	}
>  
>  	request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx);
> -	if (!request_wiphy) {
> -		reg_set_request_processed();
> +	if (!request_wiphy &&
> +	    (last_request->initiator == NL80211_REGDOM_SET_BY_DRIVER ||
> +	     last_request->initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE)) {
> +		schedule_delayed_work(&reg_timeout, 0);
>  		return -ENODEV;

This seems OK to me, but the function is really hard to follow -- maybe
(later) we should take some code duplication and make it easier to read
by switching on the type of hint first?

johannes


  reply	other threads:[~2011-11-24 15:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-23 15:04 [RFC 0/2] cfg80211: two stable fixes Luis R. Rodriguez
2011-11-23 15:04 ` [RFC 1/2] cfg80211: fix race on init and driver registration Luis R. Rodriguez
2011-11-25 19:59   ` Timo Lindhorst
2011-11-28 20:07     ` Luis R. Rodriguez
2011-11-23 15:04 ` [RFC 2/2] cfg80211: amend regulatory NULL dereference fix Luis R. Rodriguez
2011-11-24 15:22   ` Johannes Berg [this message]
2011-11-24 16:25     ` Luis R. Rodriguez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1322148142.5366.25.camel@jlt3.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mcgrof@qca.qualcomm.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).