Pause the dbiterator before calling dns_db_find

zone.c:integrity_checks() acquires a read lock while iterating the
zone database, and calls zone_check_mx() which acquires another
read lock. If another thread tries to acquire a write lock in the
meantime, it can deadlock. Calling dns_dbiterator_pause() to release
the first read lock prevents this.
This commit is contained in:
Mark Andrews 2021-09-17 12:55:07 +10:00 committed by Ondřej Surý
parent 214c985876
commit 4e1faa35d5

View file

@ -3326,6 +3326,8 @@ integrity_checks(dns_zone_t *zone, dns_db_t *db) {
goto next;
}
dns_dbiterator_pause(dbiterator);
/*
* Don't check the NS records at the origin.
*/