mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 22:15:20 +00:00
Fix deadlock issue with key-directory and in-view
When locking key files for a zone, we iterate over all the views and lock a mutex inside the zone structure. However, if we envounter an in-view zone, we will try to lock the key files twice, one time for the home view and one time for the in-view view. This will lead to a deadlock because one thread is trying to get the same lock twice.
This commit is contained in:
@@ -6395,6 +6395,17 @@ dns__zone_lockunlock_keyfiles(dns_zone_t *zone, bool lock) {
|
|||||||
if (ret == ISC_R_SUCCESS) {
|
if (ret == ISC_R_SUCCESS) {
|
||||||
INSIST(DNS_ZONE_VALID(z));
|
INSIST(DNS_ZONE_VALID(z));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Skip in-view zones, in other words if the view
|
||||||
|
* pointer is not the same as the zone view pointer:
|
||||||
|
* 'in-view' zones can be part of another view,
|
||||||
|
* while they also have their own home view.
|
||||||
|
*/
|
||||||
|
if (v != z->view) {
|
||||||
|
dns_zone_detach(&z);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* WMM check if policy is the same? */
|
/* WMM check if policy is the same? */
|
||||||
if (lock) {
|
if (lock) {
|
||||||
LOCK_KEYFILES(z);
|
LOCK_KEYFILES(z);
|
||||||
|
Reference in New Issue
Block a user