]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
INSIST that active quota is 0 in destroy_adbentry()
authorAram Sargsyan <aram@isc.org>
Thu, 22 Dec 2022 13:43:47 +0000 (13:43 +0000)
committerArаm Sаrgsyаn <aram@isc.org>
Fri, 23 Dec 2022 10:08:00 +0000 (10:08 +0000)
This should catch ADB quota management errors in the resolver.

(cherry picked from commit c7ba26c3d6f3cd159593c8f3ec19a2f1c3d50dd6)

lib/dns/adb.c

index 208c659187aaf685d7d2b3428a66cde78c4aef1a..8bd1855bf77c80ef22eacef89e0779e0068406e9 100644 (file)
@@ -1874,11 +1874,14 @@ static void
 free_adbentry(dns_adb_t *adb, dns_adbentry_t **entry) {
        dns_adbentry_t *e;
        dns_adblameinfo_t *li;
+       uint_fast32_t active;
 
        INSIST(entry != NULL && DNS_ADBENTRY_VALID(*entry));
        e = *entry;
        *entry = NULL;
 
+       active = atomic_load_acquire(&e->active);
+       INSIST(active == 0);
        INSIST(e->lock_bucket == DNS_ADB_INVALIDBUCKET);
        INSIST(e->refcnt == 0);
        INSIST(!ISC_LINK_LINKED(e, plink));