]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Pause the dbiterator before calling dns_db_find
authorMark Andrews <marka@isc.org>
Fri, 17 Sep 2021 02:55:07 +0000 (12:55 +1000)
committerOndřej Surý <ondrej@sury.org>
Wed, 29 Sep 2021 15:35:57 +0000 (17:35 +0200)
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.

lib/dns/zone.c

index 5235e1b610d74edf109aea165e35060cc5c7ed49..7bd8c05c9b6a7c405ffd6c9a4915c21a37a37b3a 100644 (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.
                 */