From: Mark Andrews Date: Thu, 27 Feb 2020 06:48:05 +0000 (+1100) Subject: Always call set_resigntime with the zone lock held X-Git-Tag: v9.17.1~87^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7212961849510f97146f815fa03f1e90de9d3201;p=thirdparty%2Fbind9.git Always call set_resigntime with the zone lock held --- diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 52e2b8a767a..c07dfb12981 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -3854,6 +3854,8 @@ set_resigntime(dns_zone_t *zone) { uint32_t nanosecs; dns_db_t *db = NULL; + INSIST(LOCKED_ZONE(zone)); + /* We only re-sign zones that can be dynamically updated */ if (zone->update_disabled) { return; @@ -7166,8 +7168,8 @@ failure: dns_db_detach(&db); } if (result == ISC_R_SUCCESS) { - set_resigntime(zone); LOCK_ZONE(zone); + set_resigntime(zone); zone_needdump(zone, DNS_DUMP_DELAY); DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_NEEDNOTIFY); UNLOCK_ZONE(zone); @@ -8884,7 +8886,9 @@ done: nsec3chain = ISC_LIST_HEAD(cleanup); } + LOCK_ZONE(zone); set_resigntime(zone); + UNLOCK_ZONE(zone); failure: if (result != ISC_R_SUCCESS) { @@ -9622,14 +9626,13 @@ pauseall: signing = ISC_LIST_HEAD(cleanup); } + LOCK_ZONE(zone); set_resigntime(zone); - if (commit) { - LOCK_ZONE(zone); DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_NEEDNOTIFY); zone_needdump(zone, DNS_DUMP_DELAY); - UNLOCK_ZONE(zone); } + UNLOCK_ZONE(zone); failure: if (result != ISC_R_SUCCESS) {