]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Disable lame-ttl cache
authorOndřej Surý <ondrej@sury.org>
Fri, 24 Sep 2021 07:35:11 +0000 (09:35 +0200)
committerMichał Kępień <michal@isc.org>
Thu, 28 Oct 2021 10:22:33 +0000 (12:22 +0200)
The lame-ttl cache is implemented in ADB as per-server locked
linked-list "indexed" with <qname,qtype>.  This list has to be walked
every time there's a new query or new record added into the lame cache.
Determined attacker can use this to degrade performance of the resolver.

Resolver testing has shown that disabling the lame cache has little
impact on the resolver performance and it's a minimal viable defense
against this kind of attack.

bin/named/config.c
bin/named/server.c
doc/arm/reference.rst

index e0b3b5ca8c807af66b92751dc863e0060f02a59f..4f0c52309f75e1b69a90152559203c2223e22b8f 100644 (file)
@@ -146,7 +146,7 @@ options {\n\
        fetches-per-server 0;\n\
        fetches-per-zone 0;\n\
        glue-cache yes;\n\
-       lame-ttl 600;\n"
+       lame-ttl 0;\n"
 #ifdef HAVE_LMDB
                            "   lmdb-mapsize 32M;\n"
 #endif /* ifdef HAVE_LMDB */
index da5eed45b65e9fe929a9d8eebd007da0fd733892..860ccae8a1ac00474c9d57e4733c60c744c45042 100644 (file)
@@ -4759,8 +4759,11 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
        result = named_config_get(maps, "lame-ttl", &obj);
        INSIST(result == ISC_R_SUCCESS);
        lame_ttl = cfg_obj_asduration(obj);
-       if (lame_ttl > 1800) {
-               lame_ttl = 1800;
+       if (lame_ttl > 0) {
+               cfg_obj_log(obj, named_g_lctx, ISC_LOG_WARNING,
+                           "disabling lame cache despite lame-ttl > 0 as it "
+                           "may cause performance issues");
+               lame_ttl = 0;
        }
        dns_resolver_setlamettl(view->resolver, lame_ttl);
 
index 279bcf9ef40c1a4d32318157a1cf3930e1873b54..2d05aec1af755330695396f2591bf3bc21b288b6 100644 (file)
@@ -3340,9 +3340,9 @@ Tuning
 ^^^^^^
 
 ``lame-ttl``
-   This sets the number of seconds to cache a lame server indication. 0
-   disables caching. (This is **NOT** recommended.) The default is
-   ``600`` (10 minutes) and the maximum value is ``1800`` (30 minutes).
+   This is always set to 0. More information is available in the
+   `security advisory for CVE-2021-25219
+   <https://kb.isc.org/docs/cve-2021-25219>`_.
 
 ``servfail-ttl``
    This sets the number of seconds to cache a SERVFAIL response due to DNSSEC