From 7c960e89eac2fae57c4c732559d5c8d6db44d65a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Witold=20Kr=C4=99cicki?= Date: Fri, 29 Mar 2019 14:30:40 +0100 Subject: [PATCH 1/2] In resume_qmin check if the fetch context is already shutting down - if so, try to destroy it, don't continue --- lib/dns/resolver.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index cd0c8f84c3..e4294ec4e6 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -4102,7 +4102,6 @@ resume_qmin(isc_task_t *task, isc_event_t *event) { fetchctx_t *fctx; isc_result_t result; bool bucket_empty; - bool locked = false; unsigned int bucketnum; unsigned int findoptions = 0; dns_name_t *fname, *dcname; @@ -4135,6 +4134,11 @@ resume_qmin(isc_task_t *task, isc_event_t *event) { dns_resolver_destroyfetch(&fctx->qminfetch); + if (SHUTTINGDOWN(fctx)) { + maybe_destroy(fctx, false); + goto cleanup; + } + /* * Note: fevent->rdataset must be disassociated and * isc_event_free(&event) be called before resuming @@ -4217,8 +4221,7 @@ resume_qmin(isc_task_t *task, isc_event_t *event) { cleanup: INSIST(event == NULL); INSIST(fevent == NULL); - if (!locked) - LOCK(&res->buckets[bucketnum].lock); + LOCK(&res->buckets[bucketnum].lock); bucket_empty = fctx_decreference(fctx); UNLOCK(&res->buckets[bucketnum].lock); if (bucket_empty) From d11791e24ccacf0d2b1f4ab07652cd69c5dd7ebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Witold=20Kr=C4=99cicki?= Date: Fri, 29 Mar 2019 14:30:53 +0100 Subject: [PATCH 2/2] CHANGES --- CHANGES | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES b/CHANGES index b0c064e0c0..a3863135e4 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +5198. [bug] If a fetch context was being shut down and, at the same + time, we returned from qname minimization, an INSIST + could be hit. [GL #966] + 5197. [bug] dig could die in best effort mode on multiple SIG(0) records. Similarly on multiple OPT and multiple TSIG records. [GL #920]