]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[TCP]: tcp_highspeed: fix AIMD table out-of-bounds access
authorPatrick McHardy <kaber@trash.net>
Mon, 13 Mar 2006 04:34:53 +0000 (20:34 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Mon, 13 Mar 2006 04:39:39 +0000 (20:39 -0800)
Covertiy #547

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_highspeed.c

index 63cf7e54084791c54d5def202ef124ae70eee770..e0e9d1383c7c7e894a1019c3e2ce28785aea5dc4 100644 (file)
@@ -125,7 +125,7 @@ static void hstcp_cong_avoid(struct sock *sk, u32 adk, u32 rtt,
                /* Update AIMD parameters */
                if (tp->snd_cwnd > hstcp_aimd_vals[ca->ai].cwnd) {
                        while (tp->snd_cwnd > hstcp_aimd_vals[ca->ai].cwnd &&
-                              ca->ai < HSTCP_AIMD_MAX)
+                              ca->ai < HSTCP_AIMD_MAX - 1)
                                ca->ai++;
                } else if (tp->snd_cwnd < hstcp_aimd_vals[ca->ai].cwnd) {
                        while (tp->snd_cwnd > hstcp_aimd_vals[ca->ai].cwnd &&