]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix a data race in dns__catz_update_cb()
authorAram Sargsyan <aram@isc.org>
Mon, 27 Mar 2023 10:56:22 +0000 (10:56 +0000)
committerAram Sargsyan <aram@isc.org>
Mon, 27 Mar 2023 11:39:19 +0000 (11:39 +0000)
The dns__catz_update_cb() function was earlier updated (see
d2ecff3c4a0d961041b860515858d258d40462d7) to use a separate
'dns_db_t' object ('catz->updb' instead of 'catz->db') to
avoid a race between the 'dns__catz_update_cb()' and
'dns_catz_dbupdate_callback()' functions, but the 'REQUIRE'
check there still checks the validity of the 'catz->db' object.

Fix the omission.

(cherry picked from commit a2817541b3f619fd6ad55f34e65b81bd9f46e913)

lib/dns/catz.c

index f9397645e54bd7631f5fc1bcb2945d142c30659a..64d5f08027f32b4b7a8f9677192d36b2dd756c42 100644 (file)
@@ -2254,7 +2254,7 @@ dns__catz_update_cb(void *data) {
        uint32_t catz_vers;
 
        REQUIRE(DNS_CATZ_ZONE_VALID(catz));
-       REQUIRE(DNS_DB_VALID(catz->db));
+       REQUIRE(DNS_DB_VALID(catz->updb));
        REQUIRE(DNS_CATZ_ZONES_VALID(catz->catzs));
 
        updb = catz->updb;