From: Larry Finger <larry.finger@lwfinger.net>
To: Stefano Brivio <stefano.brivio@polimi.it>
Cc: "John W. Linville" <linville@tuxdriver.com>,
linux-wireless@vger.kernel.org,
Mattias Nissler <mattias.nissler@gmx.de>
Subject: Re: [PATCH 2/2] rc80211-pid: add sanity check
Date: Sun, 27 Jan 2008 09:56:00 -0700 [thread overview]
Message-ID: <479CB7A0.6090000@lwfinger.net> (raw)
In-Reply-To: <20080126040534.005e6736@morte>
Stefano Brivio wrote:
> From: Larry Finger <larry.finger@lwfinger.net>
>
> Add a sanity check in rate_control_pid_adjust_rate(). Thanks to Larry Finger
> for suggesting this and reporting a related bug.
>
> Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it>
> NOT-Signed-off-by: Larry Finger <larry.finger@lwfinger.net>
> ---
> Index: wireless-2.6/net/mac80211/rc80211_pid_algo.c
> ===================================================================
> --- wireless-2.6.orig/net/mac80211/rc80211_pid_algo.c
> +++ wireless-2.6/net/mac80211/rc80211_pid_algo.c
> @@ -128,6 +128,11 @@ static void rate_control_pid_adjust_rate
> }
>
> newidx += back;
> +
> + if (newidx < 0 || newidx >= sband->n_bitrates) {
> + WARN_ON(1);
> + break;
> + }
> }
>
> #ifdef CONFIG_MAC80211_DEBUGFS
The bug is triggered when the following conditions are true: (1) an 802.11g device is being used on
an 802.11b network, (2) "newidx" from rate_control_pid_shift_adjust is higher than the index of
rates used by the AP, and (3) the value of "back" is 1. The loop keeps increasing "newidx" but
sta->supp_rates & BIT(newidx) can never be true.
Although the real cause of the bug is due to selecting a trial value for the new rate that can never
be satisfied, I think that this sanity check is a reasonable way to detect and stop the runaway. As
this condition is likely to affect a lot of systems, I think the WARN_ON(1) should be removed from
the final version of the patch. With it in, a lot of logs will get spammed.
Larry
next prev parent reply other threads:[~2008-01-27 17:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-26 3:05 [PATCH 2/2] rc80211-pid: add sanity check Stefano Brivio
2008-01-26 3:20 ` Larry Finger
2008-01-26 11:19 ` Michael Buesch
2008-01-26 19:40 ` Lars
2008-01-27 12:42 ` Stefano Brivio
2008-01-27 13:22 ` mac80211 refcounting bug was: " Stefano Brivio
2008-01-27 14:32 ` Stefano Brivio
2008-01-27 13:53 ` Lars Ericsson
2008-01-27 16:56 ` Larry Finger [this message]
2008-01-27 18:51 ` Stefano Brivio
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=479CB7A0.6090000@lwfinger.net \
--to=larry.finger@lwfinger.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=mattias.nissler@gmx.de \
--cc=stefano.brivio@polimi.it \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.