From f11a8928a60c969ac9579709687e195922962af0 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Thu, 1 Jul 2021 12:20:19 -0700 Subject: [PATCH] ipn/ipnlocal: fix data race We can't access b.netMap without holding b.mu. We already grabbed it earlier in the function with the lock held. Introduced in Nov 2020 in 7ea809897df1764ea420be2ff6ae58459b0e6902. Discovered during stress testing. Apparently it's a pretty rare? Signed-off-by: Josh Bleecher Snyder --- ipn/ipnlocal/local.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipn/ipnlocal/local.go b/ipn/ipnlocal/local.go index 60b6c4ae4..66039267c 100644 --- a/ipn/ipnlocal/local.go +++ b/ipn/ipnlocal/local.go @@ -2213,7 +2213,7 @@ func (b *LocalBackend) enterState(newState ipn.State) { b.e.RequestStatus() case ipn.Running: var addrs []string - for _, addr := range b.netMap.Addresses { + for _, addr := range netMap.Addresses { addrs = append(addrs, addr.IP().String()) } systemd.Status("Connected; %s; %s", activeLogin, strings.Join(addrs, " "))