bind9/lib/ns
Evan Hunt 86eddebc83 Purge memory pool upon plugin destruction
The typical sequence of events for AAAA queries which trigger recursion
for an A RRset at the same name is as follows:

 1. Original query context is created.
 2. An AAAA RRset is found in cache.
 3. Client-specific data is allocated from the filter-aaaa memory pool.
 4. Recursion is triggered for an A RRset.
 5. Original query context is torn down.

 6. Recursion for an A RRset completes.
 7. A second query context is created.
 8. Client-specific data is retrieved from the filter-aaaa memory pool.
 9. The response to be sent is processed according to configuration.
10. The response is sent.
11. Client-specific data is returned to the filter-aaaa memory pool.
12. The second query context is torn down.

However, steps 6-12 are not executed if recursion for an A RRset is
canceled.  Thus, if named is in the process of recursing for A RRsets
when a shutdown is requested, the filter-aaaa memory pool will have
outstanding allocations which will never get released.  This in turn
leads to a crash since every memory pool must not have any outstanding
allocations by the time isc_mempool_destroy() is called.

Fix by creating a stub query context whenever fetch_callback() is called,
including cancellation events. When the qctx is destroyed, it will ensure
the client is detached and the plugin memory is freed.
2020-09-25 13:32:34 -07:00
..
include Add separate prefetch nmhandle to ns_client_t 2020-09-22 09:56:26 +02:00
tests Purge memory pool upon plugin destruction 2020-09-25 13:32:34 -07:00
win32 update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
api Update library API versions 2020-08-06 09:10:06 +02:00
client.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
hooks.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
interfacemgr.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
lib.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
listenlist.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
log.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
Makefile.am Fix "make dist" 2020-06-05 13:19:49 +02:00
notify.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
query.c Purge memory pool upon plugin destruction 2020-09-25 13:32:34 -07:00
server.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07: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 Clone the saved / query message buffers 2020-09-23 10:37:42 +10:00
xfrout.c update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00