network/protocols/unix: Recheck fShutdown{Read|Write} before socket notify.
They may have changed, and we must not use the socket object if they are set. Related to #18535.
This commit is contained in:
@@ -288,14 +288,16 @@ UnixDatagramEndpoint::Send(const iovec* vecs, size_t vecCount,
|
|||||||
fifoLocker.Unlock();
|
fifoLocker.Unlock();
|
||||||
targetLocker.Lock();
|
targetLocker.Lock();
|
||||||
|
|
||||||
if (notifyRead)
|
// We must recheck fShutdownRead after reacquiring the lock, as it may have changed.
|
||||||
|
if (notifyRead && !targetEndpoint->fShutdownRead)
|
||||||
gSocketModule->notify(targetEndpoint->socket, B_SELECT_READ, readable);
|
gSocketModule->notify(targetEndpoint->socket, B_SELECT_READ, readable);
|
||||||
|
|
||||||
targetLocker.Unlock();
|
targetLocker.Unlock();
|
||||||
|
|
||||||
if (notifyWrite) {
|
if (notifyWrite) {
|
||||||
endpointLocker.Lock();
|
endpointLocker.Lock();
|
||||||
gSocketModule->notify(socket, B_SELECT_WRITE, writable);
|
if (!fShutdownWrite)
|
||||||
|
gSocketModule->notify(socket, B_SELECT_WRITE, writable);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (result) {
|
switch (result) {
|
||||||
|
|||||||
Reference in New Issue
Block a user