tailscale/wgengine
Josh Bleecher Snyder b3d6704aa3 wgengine/magicsock: fix data race on endpoint.discoKey
endpoint.discoKey is protected by endpoint.mu.
endpoint.sendDiscoMessage was reading it without holding the lock.
This showed up in a CI failure and is readily reproducible locally.

The fix is in two parts.

First, for Conn.enqueueCallMeMaybe, eliminate the one-line helper method endpoint.sendDiscoMessage; call Conn.sendDiscoMessage directly.
This makes it more natural to read endpoint.discoKey in a context
in which endpoint.mu is already held.

Second, for endpoint.sendDiscoPing, explicitly pass the disco key
as an argument. Again, this makes it easier to read endpoint.discoKey
in a context in which endpoint.mu is already held.

Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-11-17 17:49:33 -08:00
..
bench types/netmap: use key.NodePublic instead of tailcfg.NodeKey. 2021-11-01 17:07:40 -07:00
filter all: use testingutil.MinAllocsPerRun 2021-10-28 12:48:37 -07:00
magicsock wgengine/magicsock: fix data race on endpoint.discoKey 2021-11-17 17:49:33 -08:00
monitor wgengine/monitor: ignore ipsec link monitor events on iOS/macOS 2021-09-27 20:45:51 -07:00
netstack cmd/tailscaled, wgengine/netstack: always wire up netstack 2021-11-01 14:11:30 -07:00
router util/multierr: new package 2021-11-02 17:50:15 -07:00
wgcfg go.mod: update wireguard-go to pick up roaming toggle 2021-11-16 13:15:04 -08:00
wglog wgengine/wgcfg: convert to use new node key type. 2021-10-28 09:39:23 -07:00
winnet wgengine/winnet: don't build on non-windows 2021-02-09 21:09:24 -08:00
mem_ios.go go.mod: upgrade wireguard-windows, de-fork wireguard-go 2021-05-25 13:18:21 -07:00
pendopen.go tailcfg: use key.NodePublic in wire protocol types. 2021-11-02 09:11:43 -07:00
userspace.go net/tstun, wgengine: add packet-level and drop metrics 2021-11-17 16:18:52 -08:00
userspace_ext_test.go go.mod: upgrade wireguard-windows, de-fork wireguard-go 2021-05-25 13:18:21 -07:00
userspace_test.go tailcfg: use key.NodePublic in wire protocol types. 2021-11-02 09:11:43 -07:00
watchdog.go all: replace tailcfg.DiscoKey with key.DiscoPublic. 2021-11-03 14:00:16 -07:00
watchdog_test.go all: close fake userspace engines when tests complete 2021-09-15 15:31:51 -07:00
wgengine.go all: replace tailcfg.DiscoKey with key.DiscoPublic. 2021-11-03 14:00:16 -07:00