Files
tailscale/feature/conn25
Mazdak Nasab 091ebe8543 feature/conn25: only admit protocols the datapath can map to a transit IP (#22697)
The connector's ingress filter hook accepts any packet addressed to one
of its transit IP pools, on the understanding that the datapath will
take it from there. For most of what it admits, the datapath does not:
HandlePacketFromWireGuard returns Accept untouched for everything
isSupportedProtocol excludes, so SCTP, GRE, ESP and friends are handed
to the host stack addressed to a transit IP, which is not an address
this node holds.

Nor does the hook ask anything of the sender. A peer holding no conn25
grant at all, having registered no mapping, can send those to any
address in a connector's pool and have the filter wave them through.

Split the ingress hook off into ingressAllow and have it require a
protocol the datapath can map. What is left behind serves only the
link-local hook, which lifts the filter's blanket drop of link-local
destinations rather than accepting anything, so rename it to
linkLocalAllow to match its remaining job and the client's hook of the
same name. A packet to a transit IP still has to pass ingressAllow
either way. packetFilterAllowReason loses its reason to be named after
a packetFilterAllow and becomes transitIPAllowReason.

Non-first fragments are unaffected: Filter.pre accepts ipproto.Fragment
before RunIn consults the hooks at all.

Updates https://github.com/tailscale/corp/issues/50118

Change-Id: I3486377181f406465293902c91f39b873741c6ec

Signed-off-by: Mazdak Nasab <[email protected]>
2026-11-27 15:52:21 -07:00
..