From 03e583ffa8bbc1f7adf3abdb02078048f5c080b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Witold=20Kr=C4=99cicki?= Date: Thu, 21 May 2020 11:18:53 +0200 Subject: [PATCH 1/3] Fix assertion failure during startup when the server is under load. When we're coming back from recursion fetch_callback does not accept DNS_R_NXDOMAIN as an rcode - query_gotanswer calls query_nxdomain in which an assertion fails on qctx->is_zone. Yet, under some circumstances, qname minimization will return an DNS_R_NXDOMAIN - when root zone mirror is not yet loaded. The fix changes the DNS_R_NXDOMAIN answer to DNS_R_SERVFAIL. --- lib/dns/resolver.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index 31549c64e5..7d443fd55b 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -4407,6 +4407,15 @@ resume_qmin(isc_task_t *task, isc_event_t *event) { fctx->now, findoptions, true, true, &fctx->nameservers, NULL); + /* + * DNS_R_NXDOMAIN here means we have not loaded the root zone mirror + * yet - but DNS_R_NXDOMAIN is not a valid return value when doing + * recursion, we need to patch it. + */ + if (result == DNS_R_NXDOMAIN) { + result = DNS_R_SERVFAIL; + } + if (result != ISC_R_SUCCESS) { fctx_done(fctx, result, __LINE__); goto cleanup; From 85a786abd21abc50c9e095bea1ba7cc81e4a600c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Witold=20Kr=C4=99cicki?= Date: Thu, 21 May 2020 11:18:53 +0200 Subject: [PATCH 2/3] Add CHANGES note for #1862 --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index ffc7d0fb91..81cdb6638c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +5454. [bug] Address a startup crash happening when server is + under load and root zone is not yet loaded. [GL #1862] + 5453. [bug] `named` would crash on shutdown when new `rndc` connection is received at the same time as shutting down. [GL #1747] From 935123ff9984b34efa0a1804e3f08e2ff958af34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Thu, 28 May 2020 11:37:05 +0200 Subject: [PATCH 3/3] Add release notes for #1862 --- doc/notes/notes-current.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/notes/notes-current.rst b/doc/notes/notes-current.rst index 31bfd4556b..eb1591df79 100644 --- a/doc/notes/notes-current.rst +++ b/doc/notes/notes-current.rst @@ -62,3 +62,6 @@ Bug Fixes - ``named`` would crash on shutdown when new ``rndc`` connection is received at the same time as shutting down. [GL #1747] + +- Fix assertion failure when server is under load and root zone is not yet + loaded. [GL #1862]