86 lines
3.1 KiB
Diff
86 lines
3.1 KiB
Diff
From b1c1ef37ed8defdf49213be66fffc03eed23872b Mon Sep 17 00:00:00 2001
|
|
From: Mark Andrews <marka@isc.org>
|
|
Date: Fri, 10 Apr 2026 10:26:14 +1000
|
|
Subject: [PATCH 1/2] Properly handle rpz name to long wildcard expansion
|
|
|
|
Previously a self referential CNAME and the original address
|
|
record were returned. We now return a YXDOMAIN response.
|
|
|
|
(cherry picked from commit cfc4c4f69870ce492deaaa429453563d1621ded3)
|
|
---
|
|
lib/ns/query.c | 3 ++-
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/lib/ns/query.c b/lib/ns/query.c
|
|
index 6413863..72f21a0 100644
|
|
--- a/lib/ns/query.c
|
|
+++ b/lib/ns/query.c
|
|
@@ -7506,7 +7506,8 @@ query_rpzcname(query_ctx_t *qctx, dns_name_t *cname) {
|
|
qctx->fname, NULL);
|
|
if (result == DNS_R_NAMETOOLONG) {
|
|
client->message->rcode = dns_rcode_yxdomain;
|
|
- } else if (result != ISC_R_SUCCESS) {
|
|
+ }
|
|
+ if (result != ISC_R_SUCCESS) {
|
|
return (result);
|
|
}
|
|
} else {
|
|
--
|
|
2.55.0
|
|
|
|
|
|
From 4094e9cd2b9870089b6628e49d820cbc904cbcde Mon Sep 17 00:00:00 2001
|
|
From: Mark Andrews <marka@isc.org>
|
|
Date: Fri, 10 Apr 2026 10:24:40 +1000
|
|
Subject: [PATCH 2/2] Check rpz name too long wildcard CNAME expansion handling
|
|
|
|
(cherry picked from commit 9345394e2097031b55b3ef34ceaadf5a7ebbeef2)
|
|
---
|
|
bin/tests/system/rpz/ns2/tld2.db | 2 ++
|
|
bin/tests/system/rpz/ns4/tld4.db | 2 ++
|
|
bin/tests/system/rpz/tests.sh | 5 ++++-
|
|
3 files changed, 8 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/bin/tests/system/rpz/ns2/tld2.db b/bin/tests/system/rpz/ns2/tld2.db
|
|
index c6f2556..c091ee2 100644
|
|
--- a/bin/tests/system/rpz/ns2/tld2.db
|
|
+++ b/bin/tests/system/rpz/ns2/tld2.db
|
|
@@ -123,3 +123,5 @@ a7-1 A 192.168.7.1
|
|
|
|
a7-2 A 192.168.7.2
|
|
TXT "a7-2 tld2 text"
|
|
+
|
|
+*.wild A 192.168.9.1
|
|
diff --git a/bin/tests/system/rpz/ns4/tld4.db b/bin/tests/system/rpz/ns4/tld4.db
|
|
index fca419c..8accd76 100644
|
|
--- a/bin/tests/system/rpz/ns4/tld4.db
|
|
+++ b/bin/tests/system/rpz/ns4/tld4.db
|
|
@@ -59,6 +59,8 @@ a3-6.tld2 A 56.56.56.56
|
|
|
|
a3-7.sub1.tld2 A 57.57.57.57
|
|
|
|
+*.wild.sub1.tld2 A 57.57.57.57
|
|
+
|
|
a3-8.tld2 A 58.58.58.58
|
|
|
|
a3-9.sub9.tld2 A 59.59.59.59
|
|
diff --git a/bin/tests/system/rpz/tests.sh b/bin/tests/system/rpz/tests.sh
|
|
index 2404c9f..720d8b4 100644
|
|
--- a/bin/tests/system/rpz/tests.sh
|
|
+++ b/bin/tests/system/rpz/tests.sh
|
|
@@ -516,7 +516,10 @@ nochange TCP a3-9.tld2 # 33 tcp-only
|
|
here x.servfail <<'EOF' # 34 qname-wait-recurse yes
|
|
;; status: SERVFAIL, x
|
|
EOF
|
|
-addr 35.35.35.35 "x.servfail @$ns5" # 35 qname-wait-recurse no
|
|
+addr 35.35.35.35 "x.servfail @$ns5" # 35 qname-wait-recurse no
|
|
+here aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.wild.sub1.tld2 <<'EOF' # 36 wildcard CNAME name to long
|
|
+ ;; status: YXDOMAIN, x
|
|
+EOF
|
|
end_group
|
|
ckstats $ns3 test1 ns3 22
|
|
ckstats $ns5 test1 ns5 1
|
|
--
|
|
2.55.0
|
|
|