Skip to content

Commit 45a0769

Browse files
Christoph Paaschdavem330
Christoph Paasch
authored andcommitted
tcp: Fix integer-overflows in TCP veno
In veno we do a multiplication of the cwnd and the rtt. This may overflow and thus their result is stored in a u64. However, we first need to cast the cwnd so that actually 64-bit arithmetic is done. A first attempt at fixing 76f1017 ([TCP]: TCP Veno congestion control) was made by 1591311 (tcp: Overflow bug in Vegas), but it failed to add the required cast in tcp_veno_cong_avoid(). Fixes: 76f1017 ([TCP]: TCP Veno congestion control) Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 95cb574 commit 45a0769

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv4/tcp_veno.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ static void tcp_veno_cong_avoid(struct sock *sk, u32 ack, u32 acked)
144144

145145
rtt = veno->minrtt;
146146

147-
target_cwnd = (tp->snd_cwnd * veno->basertt);
147+
target_cwnd = (u64)tp->snd_cwnd * veno->basertt;
148148
target_cwnd <<= V_PARAM_SHIFT;
149149
do_div(target_cwnd, rtt);
150150

0 commit comments

Comments
 (0)