Commit b32e3916 authored by Evan Hunt's avatar Evan Hunt
Browse files

3025. [bug] Fixed a possible deadlock due to zone resigning.

			[RT #22964]
parent ec519db9
3024. [func] RTT Banding removed due to minor security increase
3025. [bug] Fixed a possible deadlock due to zone resigning.
[RT #22964]
3024. [func] RTT Banding removed due to minor security increase
but major impact on resolver latency. [RT #23310]
3023. [bug] Named could be left in an inconsistent state when
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rbtdb.c,v 1.310 2011/01/13 09:53:04 marka Exp $ */
/* $Id: rbtdb.c,v 1.311 2011/02/18 23:26:44 each Exp $ */
/*! \file */
......@@ -392,12 +392,15 @@ typedef ISC_LIST(rbtdb_version_t) rbtdb_versionlist_t;
typedef struct {
/* Unlocked. */
dns_db_t common;
/* Locks the data in this struct */
#if DNS_RBTDB_USERWLOCK
isc_rwlock_t lock;
#else
isc_mutex_t lock;
#endif
/* Locks the tree structure (prevents nodes appearing/disappearing) */
isc_rwlock_t tree_lock;
/* Locks for individual tree nodes */
unsigned int node_lock_count;
rbtdb_nodelock_t * node_locks;
dns_rbtnode_t * origin_node;
......@@ -7264,7 +7267,7 @@ getsigningtime(dns_db_t *db, dns_rdataset_t *rdataset,
REQUIRE(VALID_RBTDB(rbtdb));
RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_read);
RWLOCK(&rbtdb->tree_lock, isc_rwlocktype_read);
for (i = 0; i < rbtdb->node_lock_count; i++) {
NODE_LOCK(&rbtdb->node_locks[i].lock, isc_rwlocktype_read);
......@@ -7300,7 +7303,7 @@ getsigningtime(dns_db_t *db, dns_rdataset_t *rdataset,
result = ISC_R_SUCCESS;
unlock:
RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_read);
RWUNLOCK(&rbtdb->tree_lock, isc_rwlocktype_read);
return (result);
}
......@@ -7322,7 +7325,7 @@ resigned(dns_db_t *db, dns_rdataset_t *rdataset, dns_dbversion_t *version)
header = rdataset->private3;
header--;
RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_write);
RWLOCK(&rbtdb->tree_lock, isc_rwlocktype_write);
NODE_LOCK(&rbtdb->node_locks[node->locknum].lock,
isc_rwlocktype_write);
/*
......@@ -7336,7 +7339,7 @@ resigned(dns_db_t *db, dns_rdataset_t *rdataset, dns_dbversion_t *version)
NODE_UNLOCK(&rbtdb->node_locks[node->locknum].lock,
isc_rwlocktype_write);
RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_write);
RWUNLOCK(&rbtdb->tree_lock, isc_rwlocktype_write);
}
static dns_stats_t *
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: zone.c,v 1.588 2011/02/17 23:47:24 tbox Exp $ */
/* $Id: zone.c,v 1.589 2011/02/18 23:26:44 each Exp $ */
/*! \file */
......@@ -7916,7 +7916,8 @@ void
dns_zone_markdirty(dns_zone_t *zone) {
LOCK_ZONE(zone);
set_resigntime(zone); /* XXXMPA make separate call back */
if (zone->type == dns_zone_master)
set_resigntime(zone); /* XXXMPA make separate call back */
zone_needdump(zone, DNS_DUMP_DELAY);
UNLOCK_ZONE(zone);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment