]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix rwlock type mismatch in delete_ds() error path
authorOndřej Surý <ondrej@isc.org>
Tue, 10 Mar 2026 09:19:42 +0000 (10:19 +0100)
committerOndřej Surý <ondrej@sury.org>
Tue, 17 Mar 2026 22:25:21 +0000 (23:25 +0100)
The lock is acquired for reading but the error path from
dns_rdata_fromstruct() incorrectly unlocks it as a write lock.

(cherry picked from commit 96a22451d766e1c4d3ec4882d55e598417e4e796)

lib/dns/keytable.c

index 159740aa746f1ccc4b2166fab664e76b29fac0c8..b8a2e102954a4934a3d5c45586e809248c563e67 100644 (file)
@@ -247,7 +247,7 @@ delete_ds(dns_qp_t *qp, dns_keytable_t *keytable, dns_keynode_t *knode,
        result = dns_rdata_fromstruct(&dsrdata, dns_rdataclass_in,
                                      dns_rdatatype_ds, ds, &b);
        if (result != ISC_R_SUCCESS) {
-               RWUNLOCK(&knode->rwlock, isc_rwlocktype_write);
+               RWUNLOCK(&knode->rwlock, isc_rwlocktype_read);
                return result;
        }