Blame SOURCES/bind-9.16-CVE-2022-3094-2.patch

4ba560
From 7fe2204a2e8952bf892e4a70fea2ef5167e1f509 Mon Sep 17 00:00:00 2001
4ba560
From: Evan Hunt <each@isc.org>
4ba560
Date: Thu, 1 Sep 2022 16:22:46 -0700
4ba560
Subject: [PATCH] add a configuration option for the update quota
4ba560
4ba560
add an "update-quota" option to configure the update quota.
4ba560
4ba560
(cherry picked from commit f57758a7303ad0034ff2ff08eaaf2ef899630f19)
4ba560
---
4ba560
 bin/named/config.c                   | 1 +
4ba560
 bin/named/named.conf.rst             | 9 +++++----
4ba560
 bin/named/server.c                   | 1 +
4ba560
 bin/tests/system/checkconf/good.conf | 1 +
4ba560
 doc/arm/reference.rst                | 7 ++++++-
4ba560
 doc/man/named.conf.5in               | 9 +++++----
4ba560
 doc/misc/master.zoneopt.rst          | 2 +-
4ba560
 doc/misc/options                     | 1 +
4ba560
 doc/misc/options.active              | 1 +
4ba560
 doc/misc/options.grammar.rst         | 3 ++-
4ba560
 doc/misc/slave.zoneopt.rst           | 2 +-
4ba560
 lib/isccfg/namedconf.c               | 1 +
4ba560
 12 files changed, 26 insertions(+), 12 deletions(-)
4ba560
4ba560
diff --git a/bin/named/config.c b/bin/named/config.c
4ba560
index 5fedee84d9..494147015f 100644
4ba560
--- a/bin/named/config.c
4ba560
+++ b/bin/named/config.c
4ba560
@@ -130,6 +130,7 @@ options {\n\
4ba560
 	transfers-out 10;\n\
4ba560
 	transfers-per-ns 2;\n\
4ba560
 	trust-anchor-telemetry yes;\n\
4ba560
+	update-quota 100;\n\
4ba560
 \n\
4ba560
 	/* view */\n\
4ba560
 	allow-new-zones no;\n\
4ba560
diff --git a/bin/named/named.conf.rst b/bin/named/named.conf.rst
4ba560
index 27eed5ca3e..4c9f9a7370 100644
4ba560
--- a/bin/named/named.conf.rst
4ba560
+++ b/bin/named/named.conf.rst
4ba560
@@ -179,7 +179,7 @@ OPTIONS
4ba560
   	answer-cookie boolean;
4ba560
   	attach-cache string;
4ba560
   	auth-nxdomain boolean; // default changed
4ba560
-  	auto-dnssec ( allow | maintain | off );
4ba560
+  	auto-dnssec ( allow | maintain | off );// deprecated
4ba560
   	automatic-interface-scan boolean;
4ba560
   	avoid-v4-udp-ports { portrange; ... };
4ba560
   	avoid-v6-udp-ports { portrange; ... };
4ba560
@@ -446,6 +446,7 @@ OPTIONS
4ba560
   	trust-anchor-telemetry boolean; // experimental
4ba560
   	try-tcp-refresh boolean;
4ba560
   	update-check-ksk boolean;
4ba560
+  	update-quota integer;
4ba560
   	use-alt-transfer-source boolean;
4ba560
   	use-v4-udp-ports { portrange; ... };
4ba560
   	use-v6-udp-ports { portrange; ... };
4ba560
@@ -584,7 +585,7 @@ VIEW
4ba560
   	    * ) ] [ dscp integer ];
4ba560
   	attach-cache string;
4ba560
   	auth-nxdomain boolean; // default changed
4ba560
-  	auto-dnssec ( allow | maintain | off );
4ba560
+  	auto-dnssec ( allow | maintain | off );// deprecated
4ba560
   	cache-file quoted_string;// deprecated
4ba560
   	catalog-zones { zone string [ default-masters [ port integer ]
4ba560
   	    [ dscp integer ] { ( remote-servers | ipv4_address [ port
4ba560
@@ -859,7 +860,7 @@ VIEW
4ba560
   		    integer | * ) ] [ dscp integer ];
4ba560
   		alt-transfer-source-v6 ( ipv6_address | * ) [ port (
4ba560
   		    integer | * ) ] [ dscp integer ];
4ba560
-  		auto-dnssec ( allow | maintain | off );
4ba560
+  		auto-dnssec ( allow | maintain | off );// deprecated
4ba560
   		check-dup-records ( fail | warn | ignore );
4ba560
   		check-integrity boolean;
4ba560
   		check-mx ( fail | warn | ignore );
4ba560
@@ -977,7 +978,7 @@ ZONE
4ba560
   	    ] [ dscp integer ];
4ba560
   	alt-transfer-source-v6 ( ipv6_address | * ) [ port ( integer |
4ba560
   	    * ) ] [ dscp integer ];
4ba560
-  	auto-dnssec ( allow | maintain | off );
4ba560
+  	auto-dnssec ( allow | maintain | off );// deprecated
4ba560
   	check-dup-records ( fail | warn | ignore );
4ba560
   	check-integrity boolean;
4ba560
   	check-mx ( fail | warn | ignore );
4ba560
diff --git a/bin/named/server.c b/bin/named/server.c
4ba560
index 20443ff8a9..78a21d62a2 100644
4ba560
--- a/bin/named/server.c
4ba560
+++ b/bin/named/server.c
4ba560
@@ -8542,6 +8542,7 @@ load_configuration(const char *filename, named_server_t *server,
4ba560
 	configure_server_quota(maps, "tcp-clients", &server->sctx->tcpquota);
4ba560
 	configure_server_quota(maps, "recursive-clients",
4ba560
 			       &server->sctx->recursionquota);
4ba560
+	configure_server_quota(maps, "update-quota", &server->sctx->updquota);
4ba560
 
4ba560
 	max = isc_quota_getmax(&server->sctx->recursionquota);
4ba560
 	if (max > 1000) {
4ba560
diff --git a/bin/tests/system/checkconf/good.conf b/bin/tests/system/checkconf/good.conf
4ba560
index b1f7059acf..0ecdb68e95 100644
4ba560
--- a/bin/tests/system/checkconf/good.conf
4ba560
+++ b/bin/tests/system/checkconf/good.conf
4ba560
@@ -75,6 +75,7 @@ options {
4ba560
 	recursive-clients 3000;
4ba560
 	serial-query-rate 100;
4ba560
 	server-id none;
4ba560
+	update-quota 200;
4ba560
 	check-names primary warn;
4ba560
 	check-names secondary ignore;
4ba560
 	max-cache-size 20000000000000;
4ba560
diff --git a/doc/arm/reference.rst b/doc/arm/reference.rst
4ba560
index 2603d60251..703663d0ba 100644
4ba560
--- a/doc/arm/reference.rst
4ba560
+++ b/doc/arm/reference.rst
4ba560
@@ -3151,6 +3151,11 @@ system.
4ba560
    value as ``tcp-keepalive-timeout``. This value can be updated at
4ba560
    runtime by using ``rndc tcp-timeouts``.
4ba560
 
4ba560
+``update-quota``
4ba560
+   This is the maximum number of simultaneous DNS UPDATE messages that
4ba560
+   the server will accept for updating local authoritiative zones or
4ba560
+   forwarding to a primary server. The default is ``100``.
4ba560
+
4ba560
 .. _intervals:
4ba560
 
4ba560
 Periodic Task Intervals
4ba560
@@ -6840,7 +6845,7 @@ Name Server Statistics Counters
4ba560
 ``UpdateQuota``
4ba560
     This indicates the number of times a dynamic update or update
4ba560
     forwarding request was rejected because the number of pending
4ba560
-    requests exceeded the update quota.
4ba560
+    requests exceeded ``update-quota``.
4ba560
 
4ba560
 ``RateDropped``
4ba560
     This indicates the number of responses dropped due to rate limits.
4ba560
diff --git a/doc/man/named.conf.5in b/doc/man/named.conf.5in
4ba560
index 4c46f47592..c87afa2881 100644
4ba560
--- a/doc/man/named.conf.5in
4ba560
+++ b/doc/man/named.conf.5in
4ba560
@@ -231,7 +231,7 @@ options {
4ba560
       answer\-cookie boolean;
4ba560
       attach\-cache string;
4ba560
       auth\-nxdomain boolean; // default changed
4ba560
-      auto\-dnssec ( allow | maintain | off );
4ba560
+      auto\-dnssec ( allow | maintain | off );// deprecated
4ba560
       automatic\-interface\-scan boolean;
4ba560
       avoid\-v4\-udp\-ports { portrange; ... };
4ba560
       avoid\-v6\-udp\-ports { portrange; ... };
4ba560
@@ -498,6 +498,7 @@ options {
4ba560
       trust\-anchor\-telemetry boolean; // experimental
4ba560
       try\-tcp\-refresh boolean;
4ba560
       update\-check\-ksk boolean;
4ba560
+      update\-quota integer;
4ba560
       use\-alt\-transfer\-source boolean;
4ba560
       use\-v4\-udp\-ports { portrange; ... };
4ba560
       use\-v6\-udp\-ports { portrange; ... };
4ba560
@@ -668,7 +669,7 @@ view string [ class ] {
4ba560
           * ) ] [ dscp integer ];
4ba560
       attach\-cache string;
4ba560
       auth\-nxdomain boolean; // default changed
4ba560
-      auto\-dnssec ( allow | maintain | off );
4ba560
+      auto\-dnssec ( allow | maintain | off );// deprecated
4ba560
       cache\-file quoted_string;// deprecated
4ba560
       catalog\-zones { zone string [ default\-masters [ port integer ]
4ba560
           [ dscp integer ] { ( remote\-servers | ipv4_address [ port
4ba560
@@ -943,7 +944,7 @@ view string [ class ] {
4ba560
                   integer | * ) ] [ dscp integer ];
4ba560
               alt\-transfer\-source\-v6 ( ipv6_address | * ) [ port (
4ba560
                   integer | * ) ] [ dscp integer ];
4ba560
-              auto\-dnssec ( allow | maintain | off );
4ba560
+              auto\-dnssec ( allow | maintain | off );// deprecated
4ba560
               check\-dup\-records ( fail | warn | ignore );
4ba560
               check\-integrity boolean;
4ba560
               check\-mx ( fail | warn | ignore );
4ba560
@@ -1065,7 +1066,7 @@ zone string [ class ] {
4ba560
           ] [ dscp integer ];
4ba560
       alt\-transfer\-source\-v6 ( ipv6_address | * ) [ port ( integer |
4ba560
           * ) ] [ dscp integer ];
4ba560
-      auto\-dnssec ( allow | maintain | off );
4ba560
+      auto\-dnssec ( allow | maintain | off );// deprecated
4ba560
       check\-dup\-records ( fail | warn | ignore );
4ba560
       check\-integrity boolean;
4ba560
       check\-mx ( fail | warn | ignore );
4ba560
diff --git a/doc/misc/master.zoneopt.rst b/doc/misc/master.zoneopt.rst
4ba560
index 8fc7e1b4f0..346d59813e 100644
4ba560
--- a/doc/misc/master.zoneopt.rst
4ba560
+++ b/doc/misc/master.zoneopt.rst
4ba560
@@ -20,7 +20,7 @@
4ba560
   	also-notify [ port <integer> ] [ dscp <integer> ] { ( <remote-servers> | <ipv4_address> [ port <integer> ] | <ipv6_address> [ port <integer> ] ) [ key <string> ]; ... };
4ba560
   	alt-transfer-source ( <ipv4_address> | * ) [ port ( <integer> | * ) ] [ dscp <integer> ];
4ba560
   	alt-transfer-source-v6 ( <ipv6_address> | * ) [ port ( <integer> | * ) ] [ dscp <integer> ];
4ba560
-  	auto-dnssec ( allow | maintain | off );
4ba560
+  	auto-dnssec ( allow | maintain | off ); // deprecated
4ba560
   	check-dup-records ( fail | warn | ignore );
4ba560
   	check-integrity <boolean>;
4ba560
   	check-mx ( fail | warn | ignore );
4ba560
diff --git a/doc/misc/options b/doc/misc/options
4ba560
index f57399499a..0dbcf101e1 100644
4ba560
--- a/doc/misc/options
4ba560
+++ b/doc/misc/options
4ba560
@@ -404,6 +404,7 @@ options {
4ba560
         trust-anchor-telemetry <boolean>; // experimental
4ba560
         try-tcp-refresh <boolean>;
4ba560
         update-check-ksk <boolean>;
4ba560
+        update-quota <integer>;
4ba560
         use-alt-transfer-source <boolean>;
4ba560
         use-id-pool <boolean>; // ancient
4ba560
         use-ixfr <boolean>; // obsolete
4ba560
diff --git a/doc/misc/options.active b/doc/misc/options.active
4ba560
index 5fc1ab29f4..eb75a86eae 100644
4ba560
--- a/doc/misc/options.active
4ba560
+++ b/doc/misc/options.active
4ba560
@@ -363,6 +363,7 @@ options {
4ba560
         trust-anchor-telemetry <boolean>; // experimental
4ba560
         try-tcp-refresh <boolean>;
4ba560
         update-check-ksk <boolean>;
4ba560
+        update-quota <integer>;
4ba560
         use-alt-transfer-source <boolean>;
4ba560
         use-v4-udp-ports { <portrange>; ... };
4ba560
         use-v6-udp-ports { <portrange>; ... };
4ba560
diff --git a/doc/misc/options.grammar.rst b/doc/misc/options.grammar.rst
4ba560
index 438072c95c..beef35341a 100644
4ba560
--- a/doc/misc/options.grammar.rst
4ba560
+++ b/doc/misc/options.grammar.rst
4ba560
@@ -33,7 +33,7 @@
4ba560
   	answer-cookie <boolean>;
4ba560
   	attach-cache <string>;
4ba560
   	auth-nxdomain <boolean>; // default changed
4ba560
-  	auto-dnssec ( allow | maintain | off );
4ba560
+  	auto-dnssec ( allow | maintain | off ); // deprecated
4ba560
   	automatic-interface-scan <boolean>;
4ba560
   	avoid-v4-udp-ports { <portrange>; ... };
4ba560
   	avoid-v6-udp-ports { <portrange>; ... };
4ba560
@@ -300,6 +300,7 @@
4ba560
   	trust-anchor-telemetry <boolean>; // experimental
4ba560
   	try-tcp-refresh <boolean>;
4ba560
   	update-check-ksk <boolean>;
4ba560
+  	update-quota <integer>;
4ba560
   	use-alt-transfer-source <boolean>;
4ba560
   	use-v4-udp-ports { <portrange>; ... };
4ba560
   	use-v6-udp-ports { <portrange>; ... };
4ba560
diff --git a/doc/misc/slave.zoneopt.rst b/doc/misc/slave.zoneopt.rst
4ba560
index cc72dcbf67..468a7f4d9a 100644
4ba560
--- a/doc/misc/slave.zoneopt.rst
4ba560
+++ b/doc/misc/slave.zoneopt.rst
4ba560
@@ -21,7 +21,7 @@
4ba560
   	also-notify [ port <integer> ] [ dscp <integer> ] { ( <remote-servers> | <ipv4_address> [ port <integer> ] | <ipv6_address> [ port <integer> ] ) [ key <string> ]; ... };
4ba560
   	alt-transfer-source ( <ipv4_address> | * ) [ port ( <integer> | * ) ] [ dscp <integer> ];
4ba560
   	alt-transfer-source-v6 ( <ipv6_address> | * ) [ port ( <integer> | * ) ] [ dscp <integer> ];
4ba560
-  	auto-dnssec ( allow | maintain | off );
4ba560
+  	auto-dnssec ( allow | maintain | off ); // deprecated
4ba560
   	check-names ( fail | warn | ignore );
4ba560
   	database <string>;
4ba560
   	dialup ( notify | notify-passive | passive | refresh | <boolean> );
4ba560
diff --git a/lib/isccfg/namedconf.c b/lib/isccfg/namedconf.c
4ba560
index 45de0196bf..6e63d86816 100644
4ba560
--- a/lib/isccfg/namedconf.c
4ba560
+++ b/lib/isccfg/namedconf.c
4ba560
@@ -1267,6 +1267,7 @@ static cfg_clausedef_t options_clauses[] = {
4ba560
 	{ "transfers-out", &cfg_type_uint32, 0 },
4ba560
 	{ "transfers-per-ns", &cfg_type_uint32, 0 },
4ba560
 	{ "treat-cr-as-space", &cfg_type_boolean, CFG_CLAUSEFLAG_ANCIENT },
4ba560
+	{ "update-quota", &cfg_type_uint32, 0 },
4ba560
 	{ "use-id-pool", &cfg_type_boolean, CFG_CLAUSEFLAG_ANCIENT },
4ba560
 	{ "use-ixfr", &cfg_type_boolean, CFG_CLAUSEFLAG_OBSOLETE },
4ba560
 	{ "use-v4-udp-ports", &cfg_type_bracketed_portlist, 0 },
4ba560
-- 
4ba560
2.39.1
4ba560