]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
use read lock in rdataset_getownercase()
authorEvan Hunt <each@isc.org>
Thu, 3 Aug 2023 19:51:41 +0000 (12:51 -0700)
committerEvan Hunt <each@isc.org>
Thu, 3 Aug 2023 20:26:27 +0000 (13:26 -0700)
we were incorrectly write-locking the node when retrieving
the owner case of an rdataset.

lib/dns/rdataslab.c

index b2c65e6e662bb3e512bc5bfc9df3986098b479b7..647a99fef169439580cb8338e77141eca288c0cb 100644 (file)
@@ -1476,7 +1476,7 @@ rdataset_getownercase(const dns_rdataset_t *rdataset, dns_name_t *name) {
        uint8_t mask = (1 << 7);
        uint8_t bits = 0;
 
-       dns_db_locknode(header->db, header->node, isc_rwlocktype_write);
+       dns_db_locknode(header->db, header->node, isc_rwlocktype_read);
 
        if (!CASESET(header)) {
                goto unlock;
@@ -1499,5 +1499,5 @@ rdataset_getownercase(const dns_rdataset_t *rdataset, dns_name_t *name) {
        }
 
 unlock:
-       dns_db_unlocknode(header->db, header->node, isc_rwlocktype_write);
+       dns_db_unlocknode(header->db, header->node, isc_rwlocktype_read);
 }