From 62182fc37d44c0a8185b7d96f30465710dd68b66 Mon Sep 17 00:00:00 2001 From: Jordan Whited Date: Mon, 14 Apr 2025 10:09:56 -0700 Subject: [PATCH] wgengine/netstack: revert cubic cc to reno cc (#15677) Updates google/gvisor#11632 Updates tailscale/corp#27717 Signed-off-by: Jordan Whited --- wgengine/netstack/netstack.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/wgengine/netstack/netstack.go b/wgengine/netstack/netstack.go index 04bab0cf9..dab692ead 100644 --- a/wgengine/netstack/netstack.go +++ b/wgengine/netstack/netstack.go @@ -327,10 +327,15 @@ func Create(logf logger.Logf, tundev *tstun.Wrapper, e wgengine.Engine, mc *magi if tcpipErr != nil { return nil, fmt.Errorf("could not disable TCP RACK: %v", tcpipErr) } - cubicOpt := tcpip.CongestionControlOption("cubic") - tcpipErr = ipstack.SetTransportProtocolOption(tcp.ProtocolNumber, &cubicOpt) + // gVisor defaults to reno at the time of writing. We explicitly set reno + // congestion control in order to prevent unexpected changes. Netstack + // has an int overflow in sender congestion window arithmetic that is more + // prone to trigger with cubic congestion control. + // See https://github.com/google/gvisor/issues/11632 + renoOpt := tcpip.CongestionControlOption("reno") + tcpipErr = ipstack.SetTransportProtocolOption(tcp.ProtocolNumber, &renoOpt) if tcpipErr != nil { - return nil, fmt.Errorf("could not set cubic congestion control: %v", tcpipErr) + return nil, fmt.Errorf("could not set reno congestion control: %v", tcpipErr) } err := setTCPBufSizes(ipstack) if err != nil {