bind9/bin
Aram Sargsyan b23d88947a DiG: fix lookup reference counting bug
When DiG finishes its work with a lookup (due to success or error), it
calls the clear_current_lookup() function, which decreases the lookup's
reference count. That decrease action is the counterpart of the initial
creation of the reference counter, so this function was designed in such
a way that it should decrease the reference count only once, when there
are no more active queries in the lookup.

The way it checks whether there are any active queries is by looking
at the queries list of the lookup object - if it's NULL then there are
no active queries. But that is not always true - the cancel_lookup()
function, when canceling the queries one by one, also removes them
from the lookup's list, but in NSSEARCH mode, when the queries are
working in parallel, some of those queries can be still active. And
when their recv_done() callback gets called, it sees that the lookup
has been canceled, calls clear_current_lookup(), which decreases the
reference count every time for each query that was still active
(because ISC_LIST_HEAD(lookup->q) is NULL) and results in a reference
counting error.

Fix the issue by introducing a new "cleared" property for the lookup,
which will ensure that the clear_current_lookup() function does its
job only once per lookup.

(cherry picked from commit 08ba2732e061710d3622ae181de33bbaaf63f63c)
2022-08-08 10:48:38 +00:00
..
check Replace ISC_NORETURN with C11's noreturn 2022-03-25 08:42:18 +01:00
confgen Replace ISC_NORETURN with C11's noreturn 2022-03-25 08:42:18 +01:00
delv Add hyperlinks to dig/mdig/delv +options 2022-04-26 14:06:33 +02:00
dig DiG: fix lookup reference counting bug 2022-08-08 10:48:38 +00:00
dnssec Update NSEC3 guidance to match draft-ietf-dnsop-nsec3-guidance-10 2022-06-15 17:57:40 +02:00
named Reject zones with TTL higher than dnssec-policy max-zone-ttl 2022-07-22 13:13:24 -07:00
nsupdate Rename yes_or_no to boolean 2022-07-04 16:09:24 +02:00
plugins Hyperlink program names to their manual pages 2022-03-14 11:01:31 +01:00
rndc Rename key_id to server_key 2022-07-04 16:09:23 +02:00
tests Ensure suffix is always valid in bin/tests/system/qmin/ans4/ans.py 2022-07-27 14:27:18 -04:00
tools Add hyperlinks to dig/mdig/delv +options 2022-04-26 14:06:33 +02:00
Makefile.am Remove native PKCS#11 support 2021-09-09 15:35:39 +02:00