]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3025. [bug] Fixed a possible deadlock due to zone resigning.
authorEvan Hunt <each@isc.org>
Fri, 18 Feb 2011 23:23:08 +0000 (23:23 +0000)
committerEvan Hunt <each@isc.org>
Fri, 18 Feb 2011 23:23:08 +0000 (23:23 +0000)
[RT #22964]

CHANGES
bin/named/bind.keys.h
lib/dns/rbtdb.c
lib/dns/zone.c

diff --git a/CHANGES b/CHANGES
index 940a2dbbd4584a37f1e1c0238468b3790f6aeca6..11c56e9f50a7d6a5608ad9b57d268380cc3cb92a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,7 @@
-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
index 61e3f700c6cf0823ad49dcf9c8543048cf4179cb..0177214159e7119caca748cac24dc30e9638a7db 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Generated by bindkeys.pl 1.7 2011/01/04 23:47:13 tbox Exp  
- * From bind.keys 1.7 2011/01/03 23:45:07 each Exp  
+ * Generated by bindkeys.pl 1.7 2011-01-04 23:47:13 tbox Exp  
+ * From bind.keys 1.7 2011-01-03 23:45:07 each Exp  
  */
 #define TRUSTED_KEYS "\
 # The bind.keys file is used to override the built-in DNSSEC trust anchors\n\
index b131921cfdf887cd72252d350ba48fe17848a6bd..f6d48486b0b0072bb5061d6c367fdbc42e7a4030 100644 (file)
@@ -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.310.8.1 2011/02/18 23:23:08 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 *
index a2a5defe28cd7fd4908eb55fc0e47a5bf8fd641a..a92b04032fefb6c97f49855fdca6376ef1c68edf 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: zone.c,v 1.582.8.6 2011/02/17 23:46:51 tbox Exp $ */
+/* $Id: zone.c,v 1.582.8.7 2011/02/18 23:23:08 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);
 }