From aafe857e487669f4637cb809c287e1909a26ba91 Mon Sep 17 00:00:00 2001 From: Aram Sargsyan Date: Mon, 13 Feb 2023 14:47:09 +0000 Subject: [PATCH 1/2] Fix RPZ reference counting error on shutdown A dns_rpz_unref_rpzs() call is missing when taking the 'goto unlock;' path on shutdown, in order to compensate for the earlier dns_rpz_ref_rpzs() call. Move the dns_rpz_ref_rpzs() call after the shutdown check. (cherry picked from commit afbe63565fa444f13359425554c871cc924d9547) --- lib/dns/rpz.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/dns/rpz.c b/lib/dns/rpz.c index dbdf6a05fc..a29b6f8e3d 100644 --- a/lib/dns/rpz.c +++ b/lib/dns/rpz.c @@ -1957,8 +1957,6 @@ dns__rpz_timer_cb(isc_task_t *task, isc_event_t *event) { REQUIRE(isc_nm_tid() >= 0); REQUIRE(DNS_RPZ_ZONE_VALID(rpz)); - dns_rpz_ref_rpzs(rpz->rpzs); - LOCK(&rpz->rpzs->maint_lock); if (rpz->rpzs->shuttingdown) { @@ -1981,6 +1979,7 @@ dns__rpz_timer_cb(isc_task_t *task, isc_event_t *event) { isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER, ISC_LOG_INFO, "rpz: %s: reload start", domain); + dns_rpz_ref_rpzs(rpz->rpzs); isc_nm_work_offload(isc_task_getnetmgr(rpz->rpzs->updater), update_rpz_cb, update_rpz_done_cb, rpz); From e2f19d1a4be41a5def00a933295d0dc1b4a2fad0 Mon Sep 17 00:00:00 2001 From: Aram Sargsyan Date: Mon, 13 Feb 2023 15:19:08 +0000 Subject: [PATCH 2/2] Add a CHANGES note for [GL #3866] (cherry picked from commit a5927f115128a4487961eca0159a71cb26d84844) --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index 7c93df7dbf..cc695e8356 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +6096. [bug] Fix RPZ reference counting error on shutdown in + dns__rpz_timer_cb(). [GL #3866] + 6095. [test] Test various 'islands of trust' configurations when using managed keys. [GL #3662]