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/wgengine
James Tucker 672c2c8de8 wgengine/magicsock: add filter to ignore disco to old/other ports
Incoming disco packets are now dropped unless they match one of the
current bound ports, or have a zero port*.

The BPF filter passes all packets with a disco header to the raw packet
sockets regardless of destination port (in order to avoid needing to
reconfigure BPF on rebind).

If a BPF enabled node has just rebound, due to restart or rebind, it may
receive and reply to disco ping packets destined for ports other than
those which are presently bound. If the pong is accepted, the pinging
node will now assume that it can send WireGuard traffic to the pinged
port - such traffic will not reach the node as it is not destined for a
bound port.

*The zero port is ignored, if received. This is a speculative defense
and would indicate a problem in the receive path, or the BPF filter.
This condition is allowed to pass as it may enable traffic to flow,
however it will also enable problems with the same symptoms this patch
otherwise fixes.

Fixes #5536

Signed-off-by: James Tucker <james@tailscale.com>
3 years ago
..
bench all: convert more code to use net/netip directly 3 years ago
filter all: migrate more code code to net/netip directly 3 years ago
magicsock wgengine/magicsock: add filter to ignore disco to old/other ports 3 years ago
monitor go.mod: bump wireguard/windows, which moves to using net/netip 3 years ago
netstack all: use syncs.AtomicValue 3 years ago
router go.mod: bump wireguard/windows, which moves to using net/netip 3 years ago
wgcfg wgengine/wgcfg: only write peer headers if necessary (#5449) 3 years ago
wgint go.mod, wgengine/wgint: bump wireguard-go 3 years ago
wglog all: use syncs.AtomicValue 3 years ago
winnet all: gofmt all 4 years ago
mem_ios.go go.mod: upgrade wireguard-windows, de-fork wireguard-go 5 years ago
pendopen.go wgengine: remove all peer status from open timeout diagnostics 3 years ago
userspace.go wgengine: fix race on endpoints in getStatus 3 years ago
userspace_ext_test.go go.mod: upgrade wireguard-windows, de-fork wireguard-go 5 years ago
userspace_test.go all: convert more code to use net/netip directly 3 years ago
watchdog.go wgengine: print in-flight operations on watchdog trigger (#5447) 3 years ago
watchdog_js.go wasm: drop pprof dependency 4 years ago
watchdog_test.go wgengine: remove all peer status from open timeout diagnostics 3 years ago
wgengine.go all: convert more code to use net/netip directly 3 years ago