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

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