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/ipn/ipnlocal
Brad Fitzpatrick 1cd4e11b26 ipn/ipnlocal: avoid initPeerAPIListener crash on certain concurrent actions
We were crashing on in initPeerAPIListener when called from
authReconfig when b.netMap is nil. But authReconfig already returns
before the call to initPeerAPIListener when b.netMap is nil, but it
releases the b.mu mutex before calling initPeerAPIListener which
reacquires it and assumes it's still nil.

The only thing that can be setting it to nil is setNetMapLocked, which
is called by ResetForClientDisconnect, Logout/logout, or Start, all of
which can happen during an authReconfig.

So be more defensive.

Fixes #1996

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
(cherry picked from commit ecfb2639cc)
5 years ago
..
local.go ipn/ipnlocal: avoid initPeerAPIListener crash on certain concurrent actions 5 years ago
local_test.go ipn: mock controlclient.Client; big ipn.Backend state machine test. 5 years ago
loglines_test.go types/logger: add key grinder stats lines to rate-limiting exemption list 5 years ago
peerapi.go ipn/ipnlocal: update peerapi logging of received PUTs 5 years ago
peerapi_macios_ext.go ipn/{ipnlocal,localapi}: add localapi handler to dial/proxy file PUTs 5 years ago
peerapi_test.go ipn/ipnlocal: use delete marker files to work around Windows delete problems 5 years ago
state_test.go ipnlocal: in Start() fast path, don't forget to send Prefs. 5 years ago