]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Only active secure data should block negative cache entries
authorOndřej Surý <ondrej@sury.org>
Mon, 20 Jul 2026 04:53:36 +0000 (06:53 +0200)
committerOndřej Surý <ondrej@isc.org>
Mon, 20 Jul 2026 05:15:23 +0000 (07:15 +0200)
Expired secure headers linger in the node's header list until they
are reaped, so the secure-data check could match a header already
past its TTL, reject the new negative entry, and hand the expired
data back to the caller. Require the matching header to be active.

lib/dns/qpcache.c

index ad0768d36f9480ad78ec64754ddb2a34833f99e9..f99989421dc82328091a3188837f35b245b9e1eb 100644 (file)
@@ -2329,7 +2329,9 @@ add(qpcache_t *qpdb, qpcnode_t *qpnode, dns_slabheader_t *newheader,
            rdtype == dns_rdatatype_any && trust < dns_trust_secure)
        {
                DNS_SLABHEADER_FOREACH(header, &qpnode->headers) {
-                       if (header_trust(header) >= dns_trust_secure) {
+                       if (ACTIVE(header, now) &&
+                           header_trust(header) >= dns_trust_secure)
+                       {
                                qpcache_hit(qpdb, header);
                                bindrdataset(qpdb, qpnode, header, now,
                                             nlocktype, tlocktype,