Linux wireless drivers development
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Tomas Winkler <tomas.winkler@intel.com>
Cc: linville@tuxdriver.com, yi.zhu@intel.com,
	linux-wireless@vger.kernel.org,
	Assaf Krauss <assaf.krauss@intel.com>
Subject: Re: [RFC PATCH 1/2] mac80211: 11d Handling - Country Information Element
Date: Thu, 19 Jun 2008 21:03:36 +0200	[thread overview]
Message-ID: <1213902216.8967.78.camel@johannes.berg> (raw)
In-Reply-To: <1213900512-21565-1-git-send-email-tomas.winkler@intel.com>

[-- Attachment #1: Type: text/plain, Size: 1467 bytes --]


> +static void ieee80211_calculate_power_level(struct ieee80211_local *local)
> +{
> +	struct ieee80211_channel *chan = local->hw.conf.channel;
> +
> +	local->hw.conf.power_level = chan->max_power;
> +	if (local->hw.conf.user_pwr_limit)
> +		local->hw.conf.power_level = min(local->hw.conf.user_pwr_limit,
> +			local->hw.conf.power_level);
> +	if (local->hw.conf.tpc_pwr_limit)
> +		local->hw.conf.power_level = min(local->hw.conf.tpc_pwr_limit,
> +			local->hw.conf.power_level);
> +}
> +
>  int ieee80211_hw_config(struct ieee80211_local *local)
>  {
>  	struct ieee80211_channel *chan;
> @@ -1040,13 +1053,7 @@ int ieee80211_hw_config(struct ieee80211_local *local)
>  
>  	local->hw.conf.channel = chan;
>  
> -	if (!local->hw.conf.power_level)
> -		local->hw.conf.power_level = chan->max_power;
> -	else
> -		local->hw.conf.power_level = min(chan->max_power,
> -					       local->hw.conf.power_level);
> -
> -	local->hw.conf.max_antenna_gain = chan->max_antenna_gain;
> +	ieee80211_calculate_power_level(local);

Lost antenna gain setting?
 

> +	if (country_ie_len < 6) {
> +		printk(KERN_ERR "%s: country information element shorter (%d)"
> +			" than expected.\n", __func__, country_ie_len);

Remotely exploitable security bug.


> -	if (local->hw.conf.power_level != new_power_level) {
> -		local->hw.conf.power_level = new_power_level;
> +		 local->hw.conf.user_pwr_limit = 0;

whitespace damage.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  parent reply	other threads:[~2008-06-19 19:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-19 18:35 [RFC PATCH 1/2] mac80211: 11d Handling - Country Information Element Tomas Winkler
2008-06-19 18:35 ` [RFC PATCH 2/2] mac80211: workaround for resetting the tx power Tomas Winkler
2008-06-19 19:04   ` Johannes Berg
2008-06-19 20:26     ` Tomas Winkler
2008-06-19 19:03 ` Johannes Berg [this message]
2008-06-19 20:16   ` [RFC PATCH 1/2] mac80211: 11d Handling - Country Information Element Tomas Winkler
2008-06-19 20:18     ` Johannes Berg
2008-06-19 20:29       ` Tomas Winkler
2008-06-19 22:04         ` David Miller
2008-06-19 22:32           ` Tomas Winkler
2008-07-23 13:15             ` Luis R. Rodriguez
2008-07-23 15:02               ` Tomas Winkler

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=1213902216.8967.78.camel@johannes.berg \
    --to=johannes@sipsolutions.net \
    --cc=assaf.krauss@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=tomas.winkler@intel.com \
    --cc=yi.zhu@intel.com \
    /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