2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-02 07:35:26 +00:00

1968. [bug] Missing lock in resolver.c:validated(). [RT #15739]

This commit is contained in:
Mark Andrews
2006-01-06 01:05:46 +00:00
parent 8549bc9b78
commit fde1a334ee
2 changed files with 15 additions and 7 deletions

View File

@@ -1,3 +1,5 @@
1968. [bug] Missing lock in resolver.c:validated(). [RT #15739]
1967. [func] dig/nslookup/host: warn about missing "QR". [RT #15779] 1967. [func] dig/nslookup/host: warn about missing "QR". [RT #15779]
1966. [bug] Don't set CD when we have fallen back to plain DNS. 1966. [bug] Don't set CD when we have fallen back to plain DNS.

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: resolver.c,v 1.327 2006/01/06 00:38:21 marka Exp $ */ /* $Id: resolver.c,v 1.328 2006/01/06 01:05:46 marka Exp $ */
/*! \file */ /*! \file */
@@ -3215,10 +3215,12 @@ validated(isc_task_t *task, isc_event_t *event) {
* so, destroy the fctx. * so, destroy the fctx.
*/ */
if (SHUTTINGDOWN(fctx) && !sentresponse) { if (SHUTTINGDOWN(fctx) && !sentresponse) {
maybe_destroy(fctx); maybe_destroy(fctx); /* Locks bucket. */
goto cleanup_event; goto cleanup_event;
} }
LOCK(&fctx->res->buckets[fctx->bucketnum].lock);
/* /*
* If chaining, we need to make sure that the right result code is * If chaining, we need to make sure that the right result code is
* returned, and that the rdatasets are bound. * returned, and that the rdatasets are bound.
@@ -3277,10 +3279,11 @@ validated(isc_task_t *task, isc_event_t *event) {
result = vevent->result; result = vevent->result;
add_bad(fctx, &addrinfo->sockaddr, result); add_bad(fctx, &addrinfo->sockaddr, result);
isc_event_free(&event); isc_event_free(&event);
UNLOCK(&fctx->res->buckets[fctx->bucketnum].lock);
if (sentresponse) if (sentresponse)
fctx_done(fctx, result); fctx_done(fctx, result); /* Locks bucket. */
else else
fctx_try(fctx); fctx_try(fctx); /* Locks bucket. */
return; return;
} }
@@ -3359,9 +3362,9 @@ validated(isc_task_t *task, isc_event_t *event) {
* If we only deferred the destroy because we wanted to cache * If we only deferred the destroy because we wanted to cache
* the data, destroy now. * the data, destroy now.
*/ */
UNLOCK(&fctx->res->buckets[fctx->bucketnum].lock);
if (SHUTTINGDOWN(fctx)) if (SHUTTINGDOWN(fctx))
maybe_destroy(fctx); maybe_destroy(fctx); /* Locks bucket. */
goto cleanup_event; goto cleanup_event;
} }
@@ -3374,6 +3377,7 @@ validated(isc_task_t *task, isc_event_t *event) {
* more rdatasets that still need to * more rdatasets that still need to
* be validated. * be validated.
*/ */
UNLOCK(&fctx->res->buckets[fctx->bucketnum].lock);
goto cleanup_event; goto cleanup_event;
} }
@@ -3446,7 +3450,9 @@ validated(isc_task_t *task, isc_event_t *event) {
if (node != NULL) if (node != NULL)
dns_db_detachnode(fctx->cache, &node); dns_db_detachnode(fctx->cache, &node);
fctx_done(fctx, result); UNLOCK(&fctx->res->buckets[fctx->bucketnum].lock);
fctx_done(fctx, result); /* Locks bucket. */
cleanup_event: cleanup_event:
isc_event_free(&event); isc_event_free(&event);