From: Joe Perches <joe@perches.com>
To: Felix Fietkau <nbd@openwrt.org>
Cc: linux-wireless@vger.kernel.org, johannes@sipsolutions.net,
krzysiek@podlesie.net
Subject: Re: [PATCH 3.11] mac80211/minstrel: fix NULL pointer dereference issue
Date: Mon, 15 Jul 2013 05:50:51 -0700 [thread overview]
Message-ID: <1373892651.2062.11.camel@joe-AO722> (raw)
In-Reply-To: <1373891706-1071-1-git-send-email-nbd@openwrt.org>
On Mon, 2013-07-15 at 14:35 +0200, Felix Fietkau wrote:
> When priv_sta == NULL, mi->prev_sample is dereferenced too early. Move
> the assignment further down, after the rate_control_send_low call.
>
> Reported-by: Krzysztof Mazur <krzysiek@podlesie.net>
> Cc: stable@vger.kernel.org # 3.10
> Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Why should this be marked for stable?
It's a local reference only, it's not used.
It's like suggesting that all the initialized
automatics should not be set until after
rate_control_set_low is called.
> ---
> net/mac80211/rc80211_minstrel.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c
> index ac7ef54..e6512e2 100644
> --- a/net/mac80211/rc80211_minstrel.c
> +++ b/net/mac80211/rc80211_minstrel.c
> @@ -290,7 +290,7 @@ minstrel_get_rate(void *priv, struct ieee80211_sta *sta,
> struct minstrel_rate *msr, *mr;
> unsigned int ndx;
> bool mrr_capable;
> - bool prev_sample = mi->prev_sample;
> + bool prev_sample;
> int delta;
> int sampling_ratio;
>
> @@ -314,6 +314,7 @@ minstrel_get_rate(void *priv, struct ieee80211_sta *sta,
> (mi->sample_count + mi->sample_deferred / 2);
>
> /* delta < 0: no sampling required */
> + prev_sample = mi->prev_sample;
> mi->prev_sample = false;
> if (delta < 0 || (!mrr_capable && prev_sample))
> return;
next prev parent reply other threads:[~2013-07-15 12:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-15 12:35 [PATCH 3.11] mac80211/minstrel: fix NULL pointer dereference issue Felix Fietkau
2013-07-15 12:50 ` Joe Perches [this message]
2013-07-15 12:54 ` Felix Fietkau
2013-07-15 13:31 ` Joe Perches
2013-07-15 17:32 ` Krzysztof Mazur
2013-07-16 14:48 ` Johannes Berg
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=1373892651.2062.11.camel@joe-AO722 \
--to=joe@perches.com \
--cc=johannes@sipsolutions.net \
--cc=krzysiek@podlesie.net \
--cc=linux-wireless@vger.kernel.org \
--cc=nbd@openwrt.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).