Concurrent Map Data Race Crashes Agent via Unsynchronized Global State
Concurrent data race on unprotected global maps and counters: listenerConntrack, listenerMap, connTrackID, and listenerID are package-level variables accessed from multiple goroutines (every yamux stream dispatches a new go agent.HandleConn() goroutine at cmd/agent/main.go:252 and :352) with zero synchronization. The ListenAndServe goroutine (line 258) writes connTrackID++ and listenerConntrack[connTrackID]=conn while another HandleConn goroutine may simultaneously read listenerConntrack[sockRequest.SockID] (line 347) or read/write listenerMap (lines 208, 249, 278). In Go, concurrent map read+write triggers a fatal runtime panic; a race between two ListenerRequestPackets from the proxy will also corrupt listenerID++ (line 295) non-atomically. An attacker controlling the proxy can reliably trigger this by issuing two simultaneous listener_add or listener_stop commands, crashing the agent.