[master] fix race

3804.   [bug]           Corrected a race condition in dispatch.c in which
                        portentry could be reset leading to an assertion
                        failure in socket_search(). (Change #3708
                        addressed the same issue but was incomplete.)
                        [RT #35128]
This commit is contained in:
Evan Hunt
2014-04-07 13:54:08 -07:00
parent baad8d9fd8
commit 38c3ed154a
2 changed files with 13 additions and 2 deletions

View File

@@ -1,3 +1,9 @@
3804. [bug] Corrected a race condition in dispatch.c in which
portentry could be reset leading to an assertion
failure in socket_search(). (Change #3708
addressed the same issue but was incomplete.)
[RT #35128]
3803. [bug] "named-checkconf -z" incorrectly rejected zones
using alternate data sources for not having a "file"
option. [RT #35685]

View File

@@ -796,14 +796,19 @@ deref_portentry(dns_dispatch_t *disp, dispportentry_t **portentryp) {
portentry, link);
isc_mempool_put(disp->portpool, portentry);
}
UNLOCK(&qid->lock);
/*
* Set '*portentryp' to NULL inside the lock so that
* dispsock->portentry does not change in socket_search.
*/
*portentryp = NULL;
UNLOCK(&qid->lock);
}
/*%
* Find a dispsocket for socket address 'dest', and port number 'port'.
* Return NULL if no such entry exists.
* Return NULL if no such entry exists. Requires qid->lock to be held.
*/
static dispsocket_t *
socket_search(dns_qid_t *qid, isc_sockaddr_t *dest, in_port_t port,