mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 06:25:52 +02:00
tcp: fix overflow in __tcp_retransmit_skb()
[ Upstream commit ffb4d6c850 ]
If a TCP socket gets a large write queue, an overflow can happen
in a test in __tcp_retransmit_skb() preventing all retransmits.
The flow then stalls and resets after timeouts.
Tested:
sysctl -w net.core.wmem_max=1000000000
netperf -H dest -- -s 1000000000
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
beb996c1c3
commit
a35ce624a3
|
|
@ -2569,7 +2569,8 @@ int __tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb)
|
|||
* copying overhead: fragmentation, tunneling, mangling etc.
|
||||
*/
|
||||
if (atomic_read(&sk->sk_wmem_alloc) >
|
||||
min(sk->sk_wmem_queued + (sk->sk_wmem_queued >> 2), sk->sk_sndbuf))
|
||||
min_t(u32, sk->sk_wmem_queued + (sk->sk_wmem_queued >> 2),
|
||||
sk->sk_sndbuf))
|
||||
return -EAGAIN;
|
||||
|
||||
if (skb_still_in_host_queue(sk, skb))
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user