]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[master] fix theoretical shutdown race
authorEvan Hunt <each@isc.org>
Tue, 29 Sep 2015 22:27:12 +0000 (15:27 -0700)
committerEvan Hunt <each@isc.org>
Tue, 29 Sep 2015 22:27:12 +0000 (15:27 -0700)
4226. [bug] Address a theoretical shutdown race in
zone.c:notify_send_queue(). [RT #38958]

CHANGES
lib/dns/zone.c

diff --git a/CHANGES b/CHANGES
index 782ba0e7f79acbb44bfec7ff5cc92b900148eaed..9eb12b717b6b799aa059afc9678e285834fea00d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+4226.  [bug]           Address a theoretical shutdown race in
+                       zone.c:notify_send_queue(). [RT #38958]
+
 4225.  [port]          freebsd/openbsd:  Use '${CC} -shared' for building
                        shared libraries. [RT #39557]
 
index 85bc5eca45cfcb9abba88d53bbad3670881ebc8c..2f691583c90b1af7afe0c4a10c4b84b8e8c347a9 100644 (file)
@@ -10518,6 +10518,9 @@ notify_send(dns_notify_t *notify) {
        REQUIRE(DNS_NOTIFY_VALID(notify));
        REQUIRE(LOCKED_ZONE(notify->zone));
 
+       if (DNS_ZONE_FLAG(notify->zone, DNS_ZONEFLG_EXITING))
+               return;
+
        for (ai = ISC_LIST_HEAD(notify->find->list);
             ai != NULL;
             ai = ISC_LIST_NEXT(ai, publink)) {
@@ -10593,7 +10596,8 @@ zone_notify(dns_zone_t *zone, isc_time_t *now) {
        DNS_ZONE_TIME_ADD(now, zone->notifydelay, &zone->notifytime);
        UNLOCK_ZONE(zone);
 
-       if (! DNS_ZONE_FLAG(zone, DNS_ZONEFLG_LOADED))
+       if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_EXITING) ||
+           ! DNS_ZONE_FLAG(zone, DNS_ZONEFLG_LOADED))
                return;
 
        if (notifytype == dns_notifytype_no)