From 1e4fb53c6142d0148be782aede47bebd8e00d5b2 Mon Sep 17 00:00:00 2001 From: =?utf8?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. --- 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 7712f790b74..962b79109b3 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -11048,8 +11048,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; } -- 2.47.3