diff options
author | Ian Gudger <igudger@google.com> | 2018-08-08 19:23:02 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-08-08 19:23:48 -0700 |
commit | 2a44362c0b99c6ab800e1b0d26e4f368a5e7f9f1 (patch) | |
tree | a58248a196d348bcc612f27f7282d0181893a7b9 /pkg/bits | |
parent | 9144ddda09c0a370bfc7391b0d7382836e296b5d (diff) |
Fix data race in unix.BoundEndpoint.UnidirectionalConnect.
Data race is:
Read:
(*connectionlessEndpoint).UnidirectionalConnect:
writeQueue: e.receiver.(*queueReceiver).readQueue,
Write:
(*connectionlessEndpoint).Close:
e.receiver = nil
The problem is that (*connectionlessEndpoint).UnidirectionalConnect assumed
that baseEndpoint.receiver is immutable which is explicitly not the case.
Fixing this required two changes:
1. Add synchronization around access of baseEndpoint.receiver in
(*connectionlessEndpoint).UnidirectionalConnect.
2. Check for baseEndpoint.receiver being nil in
(*connectionlessEndpoint).UnidirectionalConnect.
PiperOrigin-RevId: 207984402
Change-Id: Icddeeb43805e777fa3ef874329fa704891d14181
Diffstat (limited to 'pkg/bits')
0 files changed, 0 insertions, 0 deletions