Fix data race in tcp.GetSockOpt.
e.ID can't be read without holding e.mu. GetSockOpt was reading e.ID when looking up OriginalDst without holding e.mu. PiperOrigin-RevId: 330562293
This commit is contained in:
parent
d35f07b36a
commit
38cdb0579b
|
@ -2019,8 +2019,10 @@ func (e *endpoint) GetSockOpt(opt tcpip.GettableSocketOption) *tcpip.Error {
|
|||
e.UnlockUser()
|
||||
|
||||
case *tcpip.OriginalDestinationOption:
|
||||
e.LockUser()
|
||||
ipt := e.stack.IPTables()
|
||||
addr, port, err := ipt.OriginalDst(e.ID)
|
||||
e.UnlockUser()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue