Blame SOURCES/bind-9.16-CVE-2022-3736.patch

4ba560
From 1b6590eafce064cbf70f5afc2fe4d6f1bfdc3804 Mon Sep 17 00:00:00 2001
4ba560
From: Mark Andrews <marka@isc.org>
4ba560
Date: Thu, 27 Oct 2022 13:22:11 +1100
4ba560
Subject: [PATCH] Move the mapping of SIG and RRSIG to ANY
4ba560
4ba560
dns_db_findext() asserts if RRSIG is passed to it and
4ba560
query_lookup_stale() failed to map RRSIG to ANY to prevent this.  To
4ba560
avoid cases like this in the future, move the mapping of SIG and RRSIG
4ba560
to ANY for qctx->type to qctx_init().
4ba560
4ba560
(cherry picked from commit 56eae064183488bcf7ff08c3edf59f2e1742c1b6)
4ba560
---
4ba560
 lib/ns/query.c | 17 +++++++++--------
4ba560
 1 file changed, 9 insertions(+), 8 deletions(-)
4ba560
4ba560
diff --git a/lib/ns/query.c b/lib/ns/query.c
4ba560
index a450cb7..f66bab4 100644
4ba560
--- a/lib/ns/query.c
4ba560
+++ b/lib/ns/query.c
4ba560
@@ -5103,6 +5103,15 @@ qctx_init(ns_client_t *client, dns_fetchevent_t **eventp, dns_rdatatype_t qtype,
4ba560
 	qctx->result = ISC_R_SUCCESS;
4ba560
 	qctx->findcoveringnsec = qctx->view->synthfromdnssec;
4ba560
 
4ba560
+	/*
4ba560
+	 * If it's an RRSIG or SIG query, we'll iterate the node.
4ba560
+	 */
4ba560
+	if (qctx->qtype == dns_rdatatype_rrsig ||
4ba560
+	    qctx->qtype == dns_rdatatype_sig)
4ba560
+	{
4ba560
+		qctx->type = dns_rdatatype_any;
4ba560
+	}
4ba560
+
4ba560
 	CALL_HOOK_NORETURN(NS_QUERY_QCTX_INITIALIZED, qctx);
4ba560
 }
4ba560
 
4ba560
@@ -5243,14 +5252,6 @@ query_setup(ns_client_t *client, dns_rdatatype_t qtype) {
4ba560
 
4ba560
 	CALL_HOOK(NS_QUERY_SETUP, &qctx);
4ba560
 
4ba560
-	/*
4ba560
-	 * If it's a SIG query, we'll iterate the node.
4ba560
-	 */
4ba560
-	if (qctx.qtype == dns_rdatatype_rrsig ||
4ba560
-	    qctx.qtype == dns_rdatatype_sig) {
4ba560
-		qctx.type = dns_rdatatype_any;
4ba560
-	}
4ba560
-
4ba560
 	/*
4ba560
 	 * Check SERVFAIL cache
4ba560
 	 */
4ba560
-- 
4ba560
2.39.1
4ba560