From 8dc50105e4ea60898ed1d9d7c217c7cbfc5e2a71 Mon Sep 17 00:00:00 2001 From: Mazdak Nasab Date: Fri, 20 Nov 2026 15:24:05 -0700 Subject: [PATCH] feature/conn25: do not lock mu in packetFilterAllow (#22534) packetFilterAllow holds c.mu while touching nothing it protects. It only calls getIPSets, a func field assigned once in newConn25 that reads the config out of an atomic pointer. Its siblings transitIPInPool and destinationInPools already call it unlocked. Drop the acquisition, which besides being dead was a lock-ordering hazard if getIPSets ever grows a lock of its own. Updates https://github.com/tailscale/corp/issues/38924 Change-Id: I2942a9b0a6a57378473393c62611c557f07e71b3 Signed-off-by: Mazdak Nasab --- feature/conn25/connector.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/feature/conn25/connector.go b/feature/conn25/connector.go index 1424e12e6..9cdf10290 100644 --- a/feature/conn25/connector.go +++ b/feature/conn25/connector.go @@ -152,8 +152,6 @@ func (c *connector) destinationInPools(dst netip.Addr) bool { // packetFilterAllow returns true if the provided packet has a Src that is in // the configured transit IP range for this connector, false otherwise. func (c *connector) packetFilterAllow(p packet.Parsed) (bool, string) { - c.mu.Lock() - defer c.mu.Unlock() ipSets := c.getIPSets() if ipSets.v4Transit != nil && ipSets.v4Transit.Contains(p.Dst.Addr()) { return true, packetFilterAllowReason