linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] rc80211-pid: add sanity check
@ 2008-01-26  3:05 Stefano Brivio
  2008-01-26  3:20 ` Larry Finger
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Stefano Brivio @ 2008-01-26  3:05 UTC (permalink / raw)
  To: John W. Linville, Larry Finger; +Cc: linux-wireless, Mattias Nissler

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


-- 
Ciao
Stefano

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-01-27 18:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2008-01-27 18:51   ` Stefano Brivio

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).