Michał Kępień [Thu, 15 Feb 2018 19:31:55 +0000 (20:31 +0100)]
Add CHANGES entry
4892. [bug] named could leak memory when "rndc reload" was invoked
before all zone loading actions triggered by a previous
"rndc reload" command were completed. [RT #47076]
Michał Kępień [Thu, 15 Feb 2018 19:31:54 +0000 (20:31 +0100)]
Do not recheck DNS_ZONEFLG_LOADPENDING in zone_asyncload()
Remove a block of code which dates back to commit 8a2ab2b9203, when
dns_zone_asyncload() did not yet check DNS_ZONEFLG_LOADPENDING.
Currently, no race in accessing DNS_ZONEFLG_LOADPENDING is possible any
more, because:
- dns_zone_asyncload() is still the only function which may queue
zone_asyncload(),
- dns_zone_asyncload() accesses DNS_ZONEFLG_LOADPENDING under a lock
(and potentially queues an event under the same lock),
- DNS_ZONEFLG_LOADPENDING is not cleared until the load actually
completes.
Thus, the rechecking code can be safely removed from zone_asyncload().
Note that this also brings zone_asyncload() to a state in which the
completion callback is always invoked. This is required to prevent
leaking memory in case something goes wrong in zone_asyncload() and a
zone table the zone belongs to is indefinitely left with a positive
reference count.
Michał Kępień [Thu, 15 Feb 2018 19:31:53 +0000 (20:31 +0100)]
Asynchronous zone load events have no way of getting canceled
Code handling cancellation of asynchronous zone load events was likely
copied over from other functions when asynchronous zone loading was
first implemented in commit 8a2ab2b9203. However, unlike those other
functions, asynchronous zone loading events currently have no way of
getting canceled once they get posted, which means the aforementioned
code is effectively dead. Remove it to prevent confusion.
Michał Kępień [Thu, 15 Feb 2018 19:31:51 +0000 (20:31 +0100)]
Only clear DNS_ZONEFLG_LOADPENDING in zone_asyncload() if zone loading is completed immediately
zone_load() is not always synchronous, it may only initiate an
asynchronous load and return DNS_R_CONTINUE, which means zone loading
has not yet been completed. In such a case, zone_asyncload() must not
clear DNS_ZONEFLG_LOADPENDING immediately and leave that up to
zone_postload().
Michał Kępień [Thu, 15 Feb 2018 19:31:49 +0000 (20:31 +0100)]
Lock zone before checking whether its asynchronous load is already pending
While this is not an issue in named, which only calls
dns_zone_asyncload() from task-exclusive mode, this function is exported
by libdns and thus may in theory be concurrently called for the same
zone by multiple threads. It also does not hurt to be consistent
locking-wise with other DNS_ZONEFLG_LOADPENDING accesses.
Mark Andrews [Fri, 9 Feb 2018 01:04:45 +0000 (12:04 +1100)]
4889. [func] Warn about the use of old root keys without the new
root key being present. Warn about dlv.isc.org's
key being present. Warn about both managed and
trusted root keys being present. [RT #43670]
Mark Andrews [Wed, 7 Feb 2018 02:34:02 +0000 (13:34 +1100)]
4885. [security] update-policy rules that otherwise ignore the name
field now require that it be set to "." to ensure
that any type list present is properly interpreted.
[RT #47126]
Mark Andrews [Tue, 30 Jan 2018 02:10:06 +0000 (13:10 +1100)]
4880. [bug] Named wasn't returning the target of a cross zone
CNAME between to served zones when recursion was
desired and available (RD=1, RA=1). Don't return
the CNAME target otherwise to prevent accidental
cache poisoning. [RT #47078]