WARNING: DATA RACE Write at 0x00c001252368 by goroutine 2594: gvisor.dev/gvisor/pkg/tcpip/stack.(*PacketBuffer).reset() pkg/tcpip/stack/packet_buffer.go:201 +0x78 gvisor.dev/gvisor/pkg/tcpip/stack.NewPacketBuffer() pkg/tcpip/stack/packet_buffer.go:167 +0x66 gvisor.dev/gvisor/pkg/tcpip/link/loopback.(*endpoint).WriteRawPacket() pkg/tcpip/link/loopback/loopback.go:104 +0x132 gvisor.dev/gvisor/pkg/tcpip/link/loopback.(*endpoint).WritePacket() pkg/tcpip/link/loopback/loopback.go:80 +0x45 gvisor.dev/gvisor/pkg/tcpip/link/nested.(*Endpoint).WritePacket() pkg/tcpip/link/nested/nested.go:107 +0x1cc gvisor.dev/gvisor/pkg/tcpip/link/ethernet.(*Endpoint).WritePacket() pkg/tcpip/link/ethernet/ethernet.go:78 +0xd6 gvisor.dev/gvisor/pkg/tcpip/link/nested.(*Endpoint).WritePacket() pkg/tcpip/link/nested/nested.go:107 +0x16c gvisor.dev/gvisor/pkg/tcpip/link/sniffer.(*endpoint).WritePacket() pkg/tcpip/link/sniffer/sniffer.go:169 +0x77 gvisor.dev/gvisor/pkg/tcpip/stack.(*nic).writePacket() pkg/tcpip/stack/nic.go:382 +0x28c gvisor.dev/gvisor/pkg/tcpip/stack.(*nic).writePacketBuffer() pkg/tcpip/stack/nic.go:326 +0x111 gvisor.dev/gvisor/pkg/tcpip/stack.(*nic).enqueuePacketBuffer() pkg/tcpip/stack/nic.go:341 +0x2dc gvisor.dev/gvisor/pkg/tcpip/stack.(*nic).WritePacket() pkg/tcpip/stack/nic.go:319 +0x64 gvisor.dev/gvisor/pkg/tcpip/network/ipv4.(*endpoint).writePacket() pkg/tcpip/network/ipv4/ipv4.go:503 +0x58f gvisor.dev/gvisor/pkg/tcpip/network/ipv4.(*endpoint).WritePacket() pkg/tcpip/network/ipv4/ipv4.go:453 +0x2bd gvisor.dev/gvisor/pkg/tcpip/stack.(*Route).WritePacket() pkg/tcpip/stack/route.go:462 +0x11b gvisor.dev/gvisor/pkg/tcpip/transport/tcp.sendTCP() pkg/tcpip/transport/tcp/connect.go:891 +0x430 gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*endpoint).sendTCP() pkg/tcpip/transport/tcp/connect.go:781 +0x17e gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*endpoint).sendSynTCP() pkg/tcpip/transport/tcp/connect.go:772 +0x147 gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*endpoint).handleListenSegment() pkg/tcpip/transport/tcp/accept.go:579 +0x897 gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*endpoint).protocolListenLoop() pkg/tcpip/transport/tcp/accept.go:804 +0x2a4 Previous read at 0x00c001252368 by goroutine 2655: gvisor.dev/gvisor/pkg/tcpip/stack.(*PacketBuffer).Clone() pkg/tcpip/stack/packet_buffer.go:327 +0x93 gvisor.dev/gvisor/pkg/tcpip/stack.(*nic).DeliverNetworkPacket.func1() pkg/tcpip/stack/nic.go:765 +0xca gvisor.dev/gvisor/pkg/tcpip/stack.(*packetEndpointList).forEach() pkg/tcpip/stack/nic.go:133 +0xf5 gvisor.dev/gvisor/pkg/tcpip/stack.(*nic).DeliverNetworkPacket() pkg/tcpip/stack/nic.go:781 +0x477 gvisor.dev/gvisor/pkg/tcpip/link/nested.(*Endpoint).DeliverNetworkPacket() pkg/tcpip/link/nested/nested.go:59 +0xef gvisor.dev/gvisor/pkg/tcpip/link/sniffer.(*endpoint).DeliverNetworkPacket() pkg/tcpip/link/sniffer/sniffer.go:140 +0xa4 gvisor.dev/gvisor/pkg/tcpip/link/nested.(*Endpoint).DeliverNetworkPacket() pkg/tcpip/link/nested/nested.go:59 +0xef gvisor.dev/gvisor/pkg/tcpip/link/ethernet.(*Endpoint).DeliverNetworkPacket() pkg/tcpip/link/ethernet/ethernet.go:63 +0x224 gvisor.dev/gvisor/pkg/tcpip/link/loopback.(*endpoint).WriteRawPacket() pkg/tcpip/link/loopback/loopback.go:108 +0x1f5 gvisor.dev/gvisor/pkg/tcpip/link/loopback.(*endpoint).WritePacket() pkg/tcpip/link/loopback/loopback.go:80 +0x45 gvisor.dev/gvisor/pkg/tcpip/link/nested.(*Endpoint).WritePacket() pkg/tcpip/link/nested/nested.go:107 +0x1cc gvisor.dev/gvisor/pkg/tcpip/link/ethernet.(*Endpoint).WritePacket() pkg/tcpip/link/ethernet/ethernet.go:78 +0xd6 gvisor.dev/gvisor/pkg/tcpip/link/nested.(*Endpoint).WritePacket() pkg/tcpip/link/nested/nested.go:107 +0x16c gvisor.dev/gvisor/pkg/tcpip/link/sniffer.(*endpoint).WritePacket() pkg/tcpip/link/sniffer/sniffer.go:169 +0x77 gvisor.dev/gvisor/pkg/tcpip/stack.(*nic).writePacket() pkg/tcpip/stack/nic.go:382 +0x28c gvisor.dev/gvisor/pkg/tcpip/stack.(*nic).writePacketBuffer() pkg/tcpip/stack/nic.go:326 +0x111 gvisor.dev/gvisor/pkg/tcpip/stack.(*nic).enqueuePacketBuffer() pkg/tcpip/stack/nic.go:341 +0x2dc gvisor.dev/gvisor/pkg/tcpip/stack.(*nic).WritePacket() pkg/tcpip/stack/nic.go:319 +0x64 gvisor.dev/gvisor/pkg/tcpip/network/ipv4.(*endpoint).writePacket() pkg/tcpip/network/ipv4/ipv4.go:503 +0x58f gvisor.dev/gvisor/pkg/tcpip/network/ipv4.(*endpoint).WritePacket() pkg/tcpip/network/ipv4/ipv4.go:453 +0x2bd gvisor.dev/gvisor/pkg/tcpip/stack.(*Route).WritePacket() pkg/tcpip/stack/route.go:462 +0x11b gvisor.dev/gvisor/pkg/tcpip/transport/tcp.sendTCP() pkg/tcpip/transport/tcp/connect.go:891 +0x430 gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*endpoint).sendTCP() pkg/tcpip/transport/tcp/connect.go:781 +0x17e gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*endpoint).sendRaw() pkg/tcpip/transport/tcp/connect.go:948 +0x331 gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*sender).sendSegmentFromView() pkg/tcpip/transport/tcp/snd.go:1668 +0x224 gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*sender).sendSegment() pkg/tcpip/transport/tcp/snd.go:1636 +0x29e gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*sender).maybeSendSegment() pkg/tcpip/transport/tcp/snd.go:866 +0x7cf gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*sender).sendData() pkg/tcpip/transport/tcp/snd.go:969 +0x304 gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*endpoint).sendData() pkg/tcpip/transport/tcp/connect.go:973 +0x414 gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*endpoint).shutdownLocked() pkg/tcpip/transport/tcp/endpoint.go:2436 +0x39b gvisor.dev/gvisor/pkg/tcpip/transport/tcp.(*endpoint).Close() pkg/tcpip/transport/tcp/endpoint.go:1019 +0xe5 gvisor.dev/gvisor/pkg/sentry/socket/netstack.(*socketOpsCommon).Release() pkg/sentry/socket/netstack/netstack.go:443 +0x269 gvisor.dev/gvisor/pkg/sentry/socket/netstack.(*SocketVFS2).Release() pkg/sentry/socket/netstack/netstack_vfs2.go:84 +0xb3 gvisor.dev/gvisor/pkg/sentry/vfs.(*FileDescription).DecRef.func1() pkg/sentry/vfs/file_description.go:194 +0x372 gvisor.dev/gvisor/pkg/sentry/vfs.(*FileDescriptionRefs).DecRef() bazel-out/k8-fastbuild-ST-0995fa9490c1/bin/pkg/sentry/vfs/file_description_refs.go:131 +0x7c gvisor.dev/gvisor/pkg/sentry/vfs.(*FileDescription).DecRef() pkg/sentry/vfs/file_description.go:163 +0x76 gvisor.dev/gvisor/pkg/sentry/syscalls/linux/vfs2.Close() pkg/sentry/syscalls/linux/vfs2/fd.go:44 +0x24d gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).executeSyscall() pkg/sentry/kernel/task_syscall.go:103 +0x452 gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallInvoke() pkg/sentry/kernel/task_syscall.go:238 +0xb3 gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscallEnter() pkg/sentry/kernel/task_syscall.go:198 +0x10e gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).doSyscall() pkg/sentry/kernel/task_syscall.go:173 +0x213 gvisor.dev/gvisor/pkg/sentry/kernel.(*runApp).execute() pkg/sentry/kernel/task_run.go:282 +0x12c6 gvisor.dev/gvisor/pkg/sentry/kernel.(*Task).run() pkg/sentry/kernel/task_run.go:97 +0x352