bind9/lib/ns
Matthijs Mekking 87591de6f7 Fix servestale fetchlimits crash
When we query the resolver for a domain name that is in the same zone
for which is already one or more fetches outstanding, we could
potentially hit the fetch limits. If so, recursion fails immediately
for the incoming query and if serve-stale is enabled, we may try to
return a stale answer.

If the resolver is also is authoritative for the parent zone (for
example the root zone), first a delegation is found, but we first
check the cache for a better response.

Nothing is found in the cache, so we try to recurse to find the
answer to the query.

Because of fetch-limits 'dns_resolver_createfetch()' returns an error,
which 'ns_query_recurse()' propagates to the caller,
'query_delegation_recurse()'.

Because serve-stale is enabled, 'query_usestale()' is called,
setting 'qctx->db' to the cache db, but leaving 'qctx->version'
untouched. Now 'query_lookup()' is called to search for stale data
in the cache database with a non-NULL 'qctx->version'
(which is set to a zone db version), and thus we hit an assertion
in rbtdb.

This crash was introduced in 'main' by commit
8bcd7fe69e.
2021-03-11 12:16:14 +01:00
..
include support "tls ephemeral" with https 2021-02-03 12:06:17 +01:00
tests Record skipped unit test as skipped in Automake framework 2021-02-15 11:18:03 +01:00
win32 Initial support for DNS-over-HTTP(S) 2021-02-03 12:06:17 +01:00
client.c Bump the maximum number of hazard pointers in tests 2021-02-18 19:32:55 +01:00
hooks.c Use libuv's shared library handling capabilities 2020-10-28 15:48:58 +01:00
interfacemgr.c refactor outgoing HTTP connection support 2021-03-05 13:29:26 +02:00
lib.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
listenlist.c support "tls ephemeral" with https 2021-02-03 12:06:17 +01:00
log.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
Makefile.am Use -release instead of -version-info for internal library SONAMEs 2021-01-25 14:19:53 +01:00
notify.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
query.c Fix servestale fetchlimits crash 2021-03-11 12:16:14 +01:00
server.c Simplify the EDNS buffer size logic for DNS Flag Day 2020 2020-10-05 16:21:21 +02:00
sortlist.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
stats.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
update.c Print warning when falling back to increment soa serial method 2020-12-11 10:48:28 +01:00
xfrout.c Fix the isc_nm_closedown() to actually close the pending connections 2020-10-22 11:37:16 -07:00