Skip to contentSkip to conversation

TCP: tcp_hybla: Fix integer overflow in slow start increment

PATCH Applied Daniele Lacamera 2 participants 2 messages Jun 2, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 TCP: tcp_hybla: Fix integer overflow in slow start increment

From: root <root@kitchen.(none)>

For large values of rtt, 2^rho operation may overflow u32. Clamp down the increment to 2^16.

---
 net/ipv4/tcp_hybla.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
net/ipv4/tcp_hybla.c +2 -2
index c209e05..8db01d4 100644
@@ -126,8 +126,8 @@ static void hybla_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
 		 * calculate 2^fract in a <<7 value.
 		 */
 		is_slowstart = 1;
-		increment = ((1 << ca->rho) * hybla_fraction(rho_fractions))
-			- 128;
+		increment = ((1 << min(ca->rho, 16U)) *
+			hybla_fraction(rho_fractions)) - 128;
 	} else {
 		/*
 		 * congestion avoidance
Signature · 1 line
1.5.6.5
maintainer Applied
#1 lore raw

From: Daniele Lacamera <[email protected]>
Date: Wed, 2 Jun 2010 14:02:04 +0200

Quoted 1 line

From: root <root@kitchen.(none)>

Please do not include incomplete authorship tags in your patch postings like this, I used the more complete one from your email headers.

Quoted 2 lines

For large values of rtt, 2^rho operation may overflow u32. Clamp down the increment to 2^16.

Applied, thanks.