diff options
author | Christian Lamparter <chunkeey@googlemail.com> | 2010-10-16 18:49:15 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-12-09 13:32:13 -0800 |
commit | 4f3f51119829bae837ff57dbb5411eef584c6410 (patch) | |
tree | 3c0afedd552b828e94341c0dd50afa8029e4a2cb /net/mac80211 | |
parent | c58411f76a86233f53bd5e0bdfd5a4fec05a15fa (diff) |
mac80211: don't sanitize invalid rates
commit 5f4e6b2d3c74c1adda1cbfd9d9d30da22c7484fc upstream.
I found this bug while poking around with a pure-gn AP.
Commit:
cfg80211/mac80211: Use more generic bitrate mask for rate control
Added some sanity checks to ensure that each tx rate index
is included in the configured mask and it would change any
rate indexes if it wasn't.
But, the current implementation doesn't take into account
that the invalid rate index "-1" has a special meaning
(= no further attempts) and it should not be "changed".
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/rate.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c index be04d46110f..82d5750a110 100644 --- a/net/mac80211/rate.c +++ b/net/mac80211/rate.c @@ -328,6 +328,9 @@ void rate_control_get_rate(struct ieee80211_sub_if_data *sdata, * if needed. */ for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) { + /* Skip invalid rates */ + if (info->control.rates[i].idx < 0) + break; /* Rate masking supports only legacy rates for now */ if (info->control.rates[i].flags & IEEE80211_TX_RC_MCS) continue; |