]> git.ipfire.org Git - thirdparty/bind9.git/commit
prevent a deadlock in the shutdown system test
authorEvan Hunt <each@isc.org>
Thu, 28 Apr 2022 05:12:01 +0000 (22:12 -0700)
committerEvan Hunt <each@isc.org>
Thu, 28 Apr 2022 06:25:57 +0000 (23:25 -0700)
commit5c4cf3fcc43a481d77c22cf3c70c736467651cd3
treeb3a28dc1e0b3ff58ee0196ca968f929d6e3997c2
parentdbafb3bdd0f4a71b89b305eb6325a8134de061c9
prevent a deadlock in the shutdown system test

The shutdown test sends 'rdnc status' commands in parallel with
'rndc stop' A new rndc connection arriving will reference the ACL
environment to see whether the client is allowed to connect.
Commit c0995bc380 added a mutex lock to ns_interfacemgr_getaclenv(),
but if the new connection arrives while the interfaces are being
purged during shutdown, that lock is already being held. If the
the connection event slips in ahead of one of the netmgr's "stop
listening" events on a worker thread, a deadlock can occur.

The fix is not to hold the interfacemgr lock while shutting down
interfaces; only while actually traversing the interface list to
identify interfaces needing shutdown.
lib/ns/interfacemgr.c