]> git.ipfire.org Git - thirdparty/bind9.git/commit
Attach to the dns_dispatchmgr in the dns_view object
authorOndřej Surý <ondrej@isc.org>
Tue, 15 Aug 2023 15:29:27 +0000 (17:29 +0200)
committerEvan Hunt <each@isc.org>
Tue, 15 Aug 2023 17:25:37 +0000 (10:25 -0700)
commitd76ab697726cebcd3f24b174fd7d5ef832d16d97
tree7e386436e2e4df34092782088048127a3ccb6e88
parentcfad194e1d57fb3c9aba06b7501df19e9d3798c6
Attach to the dns_dispatchmgr in the dns_view object

The dns_dispatchmgr object was only set in the dns_view object making it
prone to use-after-free in the dns_xfrin unit when shutting down named.

Remove dns_view_setdispatchmgr() and optionally pass the dispatchmgr
directly to dns_view_create() when it is attached and not just assigned,
so the dns_dispatchmgr doesn't cease to exist too early.

The dns_view_getdnsdispatchmgr() is now protected by the RCU lock, the
dispatchmgr reference is incremented, so the caller needs to detach from
it, and the function can return NULL in case the dns_view has been
already shut down.
16 files changed:
bin/delv/delv.c
bin/named/server.c
bin/tests/system/pipelined/pipequeries.c
bin/tools/mdig.c
fuzz/dns_message_checksig.c
lib/dns/client.c
lib/dns/include/dns/view.h
lib/dns/view.c
lib/dns/xfrin.c
tests/dns/dnstap_test.c
tests/dns/keytable_test.c
tests/dns/resolver_test.c
tests/include/tests/dns.h
tests/libtest/dns.c
tests/libtest/ns.c
tests/ns/notify_test.c