From 7682d63bd4041c25ce3a904ed3fbad5fb2a039b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Tue, 25 Feb 2025 12:13:56 +0100 Subject: [PATCH] Destroy the hashmap iterator inside the rwlock Previously, the hashmap iterator for fetches-per-zone was destroy outside the rwlock. This could lead to an assertion failure due to a timing race with the internal rehashing of the hashmap table as the rehashing process requires no iterators to be running when rehashing the hashmap table. This has been fixed by moving the destruction of the iterator inside the read locked section. (cherry picked from commit 1e4fb53c6142d0148be782aede47bebd8e00d5b2) --- lib/dns/resolver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index e9d323ab81..c73272992c 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -11087,8 +11087,8 @@ dns_resolver_dumpquota(dns_resolver_t *res, isc_buffer_t **buf) { } cleanup: - RWUNLOCK(&res->counters_lock, isc_rwlocktype_read); isc_hashmap_iter_destroy(&it); + RWUNLOCK(&res->counters_lock, isc_rwlocktype_read); return result; }