diff options
| author | Pavel Roskin <proski@gnu.org> | 2012-02-11 10:01:53 -0500 |
|---|---|---|
| committer | Luis Henriques <luis.henriques@canonical.com> | 2012-03-26 05:26:45 -0400 |
| commit | 8209b9c6e9dd07857437cf9677df2d649b0e0a5d (patch) | |
| tree | 96a42046132091542bdee80fc8e2c0ab06fb1de1 /drivers/net/wireless | |
| parent | c2858da9ccfe31e0d5bde0a891926d76cf377ad3 (diff) | |
ath9k: stop on rates with idx -1 in ath9k rate control's .tx_status
BugLink: http://bugs.launchpad.net/bugs/954576
commit 2504a6423b9ab4c36df78227055995644de19edb upstream.
Rate control algorithms are supposed to stop processing when they
encounter a rate with the index -1. Checking for rate->count not being
zero is not enough.
Allowing a rate with negative index leads to memory corruption in
ath_debug_stat_rc().
One consequence of the bug is discussed at
https://bugzilla.redhat.com/show_bug.cgi?id=768639
Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/wireless')
| -rw-r--r-- | drivers/net/wireless/ath/ath9k/rc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c index ea35843dd38..9d965e37b00 100644 --- a/drivers/net/wireless/ath/ath9k/rc.c +++ b/drivers/net/wireless/ath/ath9k/rc.c | |||
| @@ -1328,7 +1328,7 @@ static void ath_tx_status(void *priv, struct ieee80211_supported_band *sband, | |||
| 1328 | fc = hdr->frame_control; | 1328 | fc = hdr->frame_control; |
| 1329 | for (i = 0; i < sc->hw->max_rates; i++) { | 1329 | for (i = 0; i < sc->hw->max_rates; i++) { |
| 1330 | struct ieee80211_tx_rate *rate = &tx_info->status.rates[i]; | 1330 | struct ieee80211_tx_rate *rate = &tx_info->status.rates[i]; |
| 1331 | if (!rate->count) | 1331 | if (rate->idx < 0 || !rate->count) |
| 1332 | break; | 1332 | break; |
| 1333 | 1333 | ||
| 1334 | final_ts_idx = i; | 1334 | final_ts_idx = i; |
