diff options
author | Ian Gudger <igudger@google.com> | 2020-03-03 13:40:59 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-03-03 13:42:13 -0800 |
commit | c15b8515eb4a07699e5f2401f0332286f0a51043 (patch) | |
tree | 88ddd70d54388e3b1947b87490f45846f3fdf656 /pkg/gate/gate_state_autogen.go | |
parent | b3c549d8391e7cadd82a5ab9280bc63bb372aa97 (diff) |
Fix datarace on TransportEndpointInfo.ID and clean up semantics.
Ensures that all access to TransportEndpointInfo.ID is either:
* In a function ending in a Locked suffix.
* While holding the appropriate mutex.
This primary affects the checkV4Mapped method on affected endpoints, which has
been renamed to checkV4MappedLocked. Also document the method and change its
argument to be a value instead of a pointer which had caused some awkwardness.
This race was possible in the udp and icmp endpoints between Connect and uses
of TransportEndpointInfo.ID including in both itself and Bind.
The tcp endpoint did not suffer from this bug, but benefited from better
documentation.
Updates #357
PiperOrigin-RevId: 298682913
Diffstat (limited to 'pkg/gate/gate_state_autogen.go')
0 files changed, 0 insertions, 0 deletions