You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/net
Nick Khyl c9836b454d net/netmon: fix goroutine leak in winMon if the monitor is never started
When the portable Monitor creates a winMon via newOSMon, we register
address and route change callbacks with Windows. Once a callback is hit,
it starts a goroutine that attempts to send the event into messagec and returns.
The newly started goroutine then blocks until it can send to the channel.
However, if the monitor is never started and winMon.Receive is never called,
the goroutines remain indefinitely blocked, leading to goroutine leaks and
significant memory consumption in the tailscaled service process on Windows.
Unlike the tailscaled subprocess, the service process creates but never starts
a Monitor.

This PR adds a check within the callbacks to confirm the monitor's active status,
and exits immediately if the monitor hasn't started.

Updates #9864

Signed-off-by: Nick Khyl <nickk@tailscale.com>
9 months ago
..
art net/art: allow non-pointers as values 1 year ago
connstats net/connstats: exclude traffic with internal Tailscale service (#7904) 1 year ago
dns net/dns: use an additional registry setting to disable dynamic DNS updates for our interface on Windows 10 months ago
dnscache net/dnscache: remove completed TODO 11 months ago
dnsfallback net/dnsfallback: add singleflight to recursive resolver 11 months ago
flowtrack all: update copyright and license headers 2 years ago
interfaces net/interfaces: better handle multiple interfaces in LikelyHomeRouterIP 9 months ago
memnet net/memnet: export the network name (#9111) 1 year ago
netaddr all: update copyright and license headers 2 years ago
netcheck net/netcheck: use DERP frames as a signal for home region liveness 10 months ago
neterror net/neterror, wgengine/magicsock: use UDP GSO and GRO on Linux (#7791) 2 years ago
netkernelconf client/tailscale,ipn/{ipnlocal,localapi}: check UDP GRO config (#10071) 11 months ago
netknob all: update copyright and license headers 2 years ago
netmon net/netmon: fix goroutine leak in winMon if the monitor is never started 9 months ago
netns net/{interfaces,netmon}: remove "interesting", EqualFiltered API 1 year ago
netstat net/{netns,netstat}: use new x/sys/cpu.IsBigEndian 2 years ago
netutil net/netutil: add function to check rp_filter value (#5703) 9 months ago
packet all: cleanup unused code, part 1 (#10661) 9 months ago
ping net/ping: fix ICMP echo code field to 0 1 year ago
portmapper all: cleanup unused code, part 1 (#10661) 9 months ago
proxymux all: cleanup unused code, part 1 (#10661) 9 months ago
routetable all: cleanup unused code, part 1 (#10661) 9 months ago
socks5 net/socks5: add password auth support 2 years ago
sockstats net/dns: retry forwarder requests over TCP 1 year ago
speedtest all: update copyright and license headers 2 years ago
stun wgengine/magicsock, types/nettype, etc: finish ReadFromUDPAddrPort netip migration 1 year ago
tcpinfo net/tcpinfo: add package to allow fetching TCP information 1 year ago
tlsdial cmd/tailscale/cli: make netcheck run even if machine lacks TLS certs 1 year ago
tsaddr all: cleanup unused code, part 1 (#10661) 9 months ago
tsdial all: cleanup unused code, part 1 (#10661) 9 months ago
tshttpproxy net/tshttpproxy: don't proxy through ourselves 2 years ago
tstun all: cleanup unused code, part 1 (#10661) 9 months ago
wsconn net/wsconn: accept a remote addr string and plumb it through 1 year ago