From da9b5153f2fafab1597b34336f8a95c1b861f0ac Mon Sep 17 00:00:00 2001 From: Brian Geffon Date: Mon, 9 Jul 2018 20:47:32 -0700 Subject: Fix two race conditions in tcp stack. PiperOrigin-RevId: 203880278 Change-Id: I66b790a616de59142859cc12db4781b57ea626d3 --- pkg/tcpip/transport/tcp/connect.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pkg/tcpip/transport/tcp/connect.go') diff --git a/pkg/tcpip/transport/tcp/connect.go b/pkg/tcpip/transport/tcp/connect.go index 980663675..afdea2b53 100644 --- a/pkg/tcpip/transport/tcp/connect.go +++ b/pkg/tcpip/transport/tcp/connect.go @@ -949,9 +949,10 @@ func (e *endpoint) protocolMainLoop(passive bool) *tcpip.Error { } if n¬ifyReset != 0 { + e.mu.Lock() e.resetConnectionLocked(tcpip.ErrConnectionAborted) + e.mu.Unlock() } - if n¬ifyClose != 0 && closeTimer == nil { // Reset the connection 3 seconds after the // endpoint has been closed. -- cgit v1.2.3