util/syspolicy/source: fix data race between Reader.Close and reload
Reader.Close set r.store to nil without holding r.mu, while reload read r.store while holding r.mu. If a policy store is closed while a concurrent reload is in flight, reload could observe a nil store and crash tailscaled with a nil interface method call in readPolicySettingValue. Nil out r.store only while holding r.mu, and make reload return the last known policy once the reader is closing instead of reading from a store that may no longer exist. Fixes tailscale/corp#45548 Fixes tailscale/triage#394 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com> Change-Id: I494cfe9ea1df67b563bc061db9e6944f87b42a4e
B
Brad Fitzpatrick committed
514e50bd1bd0f0689f87ffb3a7adc306150290c8
Parent: c90380f
Committed by Brad Fitzpatrick <brad@danga.com>
on 7/27/2026, 4:28:51 PM