Skip to contentSkip to conversation

ath5k: fix buffer overrun in rate debug code

PATCH New Bob Copeland 1 participant 1 message Apr 28, 2009 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath5k: fix buffer overrun in rate debug code

char bname[5] is too small for the string "X GHz" when the null terminator is taken into account. Thus, turning on rate debugging can crash unless we have lucky stack alignment.

---
John, this patch should probably go for 2.6.30, I'll send a version for wireless-testing next.

 drivers/net/wireless/ath5k/debug.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/ath5k/debug.c +1 -1
index 9770bb3..4904a07 100644
@@ -424,7 +424,7 @@ ath5k_debug_dump_bands(struct ath5k_softc *sc)
 
 	for (b = 0; b < IEEE80211_NUM_BANDS; b++) {
 		struct ieee80211_supported_band *band = &sc->sbands[b];
-		char bname[5];
+		char bname[6];
 		switch (band->band) {
 		case IEEE80211_BAND_2GHZ:
 			strcpy(bname, "2 GHz");
Signature · 4 lines
1.6.0.6

-- 
Bob Copeland %% www.bobcopeland.com