diff --git a/pkg/tcpip/transport/tcp/snd.go b/pkg/tcpip/transport/tcp/snd.go index 5dccf81d1e..75f85129f7 100644 --- a/pkg/tcpip/transport/tcp/snd.go +++ b/pkg/tcpip/transport/tcp/snd.go @@ -1018,9 +1018,10 @@ func (s *sender) sendData() { var dataSent bool for seg := s.writeNext; seg != nil && s.Outstanding < s.SndCwnd; seg = seg.Next() { - cwndLimit := (s.SndCwnd - s.Outstanding) * s.MaxPayloadSize - if cwndLimit < limit { - limit = cwndLimit + // NOTE(gvisor.dev/issue/11632): Use uint64 to avoid overflow. + cwndLimit := uint64(s.SndCwnd-s.Outstanding) * uint64(s.MaxPayloadSize) + if cwndLimit < uint64(limit) { + limit = int(cwndLimit) } if s.isAssignedSequenceNumber(seg) && s.ep.SACKPermitted && s.ep.scoreboard.IsSACKED(seg.sackBlock()) { // Move writeNext along so that we don't try and scan data that