From 4b93ae74c74533d45fd35eed1ebe1ea1624fe9f1 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 18 Jan 2024 13:43:30 +1100 Subject: [PATCH 1/2] Restore dns_requestmgr_shutdown re-entrancy In the conversion to rcu the ability to call dns_requestmgr_shutdown multiple times was lost. nsupdate depended on this. Restore support for that. --- lib/dns/request.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/dns/request.c b/lib/dns/request.c index 14a96058c2..400cfe04f5 100644 --- a/lib/dns/request.c +++ b/lib/dns/request.c @@ -190,15 +190,20 @@ requests_shutdown(void *arg) { void dns_requestmgr_shutdown(dns_requestmgr_t *requestmgr) { + bool first; REQUIRE(VALID_REQUESTMGR(requestmgr)); req_log(ISC_LOG_DEBUG(3), "%s: %p", __func__, requestmgr); rcu_read_lock(); - INSIST(atomic_compare_exchange_strong(&requestmgr->shuttingdown, - &(bool){ false }, true)); + first = atomic_compare_exchange_strong(&requestmgr->shuttingdown, + &(bool){ false }, true); rcu_read_unlock(); + if (!first) { + return; + } + /* * Wait until all dns_request_create{raw}() are finished, so * there will be no new requests added to the lists. From 4087a75fd62bb71c098e4a5f5d1411020597fd27 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 1 Feb 2024 12:38:51 +1100 Subject: [PATCH 2/2] Add CHANGES entry for [GL #4529] --- CHANGES | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index 32ebaec2f9..ddc71de48f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +6337. [bug] Nsupdate could assert while shutting down. [GL #4529] + 6336. [func] Expose the zones with the 'first refresh' flag set in statistics channel's "Incoming Zone Transfers" section to indicate the zones that are not yet fully ready, and