]> git.ipfire.org Git - thirdparty/bind9.git/commit
Fix a race issue in dns_view_addzone()
authorAram Sargsyan <aram@isc.org>
Tue, 11 Feb 2025 10:22:35 +0000 (10:22 +0000)
committerArаm Sаrgsyаn <aram@isc.org>
Mon, 17 Feb 2025 17:21:38 +0000 (17:21 +0000)
commitfc24cfd71d4260325cd16c3a47f6027347229ced
tree252fcd2d85fbfb3545501479b185f0ec5b697dd7
parent853a966fe7019f62e4f717345e034dd442160617
Fix a race issue in dns_view_addzone()

Views use two types of reference counting - regular and weak, and
when there are no more regular references, the view_flushanddetach()
function destroys or detaches some parts of the view, including
'view->zonetable', while other parts are freed by destroy() when
the last weak reference is detached. Since catalog zones use weak
references to attach a view, it's currently possible that during
shutdown catalog zone processing will try to add a new zone into
an otherwise unused view (because it's shutting down) which doesn't
have an attached zonetable any more. This could cause an assertion
failure. Fix this issue by modifying the dns_view_addzone() function
to expect that 'view->zonetable' can be NULL, and in that case just
return ISC_R_SHUTTINGDOWN.
lib/dns/include/dns/view.h
lib/dns/view.c