Commit Graph

35816 Commits

Author SHA1 Message Date
Mark Andrews
b597ea863e Check that pending negative cache entries for DS can be used successfully
Prime the cache with a negative cache DS entry then make a query for
name beneath that entry. This will cause the DS entry to be retieved
as part of the validation process.  Each RRset in the ncache entry
will be validated and the trust level for each will be updated.

(cherry picked from commit d2d9910da2)
2022-04-19 09:44:09 +10:00
Evan Hunt
230b2b8c56 Merge branch '3235-dig-exitcode-v9_18' into 'v9_18'
ensure dig sets exitcode after local UDP connection failure

See merge request isc-projects/bind9!6134
2022-04-15 18:10:08 +00:00
Evan Hunt
5739f13063 CHANGES for [GL #3235]
(cherry picked from commit d646aca282)
2022-04-15 11:08:46 -07:00
Evan Hunt
50dc4f1587 ensure dig sets exitcode after local UDP connection failure
dig previously set an exit code of 9 when a TCP connection failed
or when a UDP connection timed out, but when the server address is
localhost it's possible for a UDP query to fail with ISC_R_CONNREFUSED.
that code path didn't update the exit code, causing dig to exit with
status 0. we now set the exit code to 9 in this failure case.

(cherry picked from commit 4eee6460ff)
2022-04-15 11:08:46 -07:00
Arаm Sаrgsyаn
94d2d349d2 Merge branch '3223-catz-change-of-ownership-aka-coo-support-v9_18' into 'v9_18'
[v9_18] [3/5] Implement catalog zones change of ownership (coo) support

See merge request isc-projects/bind9!6133
2022-04-14 22:48:48 +00:00
Aram Sargsyan
546732546f Do not use REQUIRE in dns_catz_entry_detach() after other code
The REQUIRE checks should be at the top of the function before
any assignments or code.

Move the REQUIRE check to the top.

(cherry picked from commit 99d1ec6c4b)
2022-04-14 20:53:59 +00:00
Aram Sargsyan
5037aeb5d2 Replace CATZ_OPT_MASTERS with CATZ_OPT_PRIMARIES
Update the enum entry in the continued effort of replacing some
DNS terminology.

(cherry picked from commit 59c486391d)
2022-04-14 20:53:53 +00:00
Aram Sargsyan
c5d523d8e9 Add CHANGES note for [GL #3223]
(cherry picked from commit 1c33dbd27d)
2022-04-14 20:53:46 +00:00
Aram Sargsyan
c37a75df5d Implement catalog zones change of ownership (coo) support
Catalog zones change of ownership is special mechanism to facilitate
controlled migration of a member zone from one catalog to another.

It is implemented using catalog zones property named "coo" and is
documented in DNS catalog zones draft version 5 document.

Implement the feature using a new hash table in the catalog zone
structure, which holds the added "coo" properties for the catalog zone
(containing the target catalog zone's name), and the key for the hash
table being the member zone's name for which the "coo" property is being
created.

Change some log messages to have consistent zone name quoting types.

Update the ARM with change of ownership documentation and usage
examples.

Add tests which check newly the added features.

(cherry picked from commit bb837db4ee)
2022-04-14 20:53:31 +00:00
Arаm Sаrgsyаn
1a9dc2fcad Merge branch '3222-catz-options-new-syntax-based-on-custom-properties-v9_18' into 'v9_18'
[v9_18] [2/5] Implement catalog zones options new syntax based on custom properties

See merge request isc-projects/bind9!6132
2022-04-14 20:27:54 +00:00
Aram Sargsyan
581d7bece0 Do not cancel processing record datasets in catalog zone after an error
When there are multiple record datasets in a database node of a catalog
zone, and BIND encounters a soft error during processing of a dataset,
it breaks from the loop and doesn't process the other datasets in the
node.

There are cases when this is not desired. For example, the catalog zones
draft version 5 states that there must be a TXT RRset named
`version.$CATZ` with exactly one RR, but it doesn't set a limitation
on possible non-TXT RRsets named `version.$CATZ` existing alongside
with the TXT one. In case when one exists, we will get a processing
error and will not continue the loop to process the TXT RRset coming
next.

Remove the "break" statement to continue processing all record datasets.

(cherry picked from commit 0b2d5490cd)
2022-04-14 19:51:45 +00:00
Aram Sargsyan
d8e1f51a04 Process the 'version' record of the catalog zone first
When processing a new or updated catalog zone, the record datasets
from the database are being processed in order. This creates a
problem because we need to know the version of the catalog zone
schema to process some of the records differently, but we do not
know the version until the 'version' record gets processed.

Find the 'version' record and process it first, only then iterate over
the database to process the rest, making sure not to process the
'version' record twice.

(cherry picked from commit 6035980bb1)
2022-04-14 19:51:37 +00:00
Aram Sargsyan
3e07e505b0 Add CHANGES note for [GL #3222]
(cherry picked from commit 321c93c05d)
2022-04-14 19:51:30 +00:00
Aram Sargsyan
f75c39811d Implement catalog zones options new syntax based on custom properties
According to DNS catalog zones draft version 5 document, catalog
zone custom properties must be placed under the "ext" label.

Make necessary changes to support the new custom properties syntax in
catalog zones with version "2" of the schema.

Change the default catalog zones schema version from "1" to "2" in
ARM to prepare for the new features and changes which come starting
from this commit in order to support the latest DNS catalog zones draft
document.

Make some restructuring in ARM and rename the term catalog zone "option"
to "custom property" to better reflect the terms used in the draft.

Change the version of 'catalog1.zone.' catalog zone in the "catz" system
test to "2", and leave the version of 'catalog2.zone.' catalog zone at
version "1" to test both versions.

Add tests to check that the new syntax works only with the new schema
version, and that the old syntax works only with the legacy schema
version catalog zones.

(cherry picked from commit cedfebc64a)
2022-04-14 19:51:22 +00:00
Arаm Sаrgsyаn
55dd09098f Merge branch '3144-dig-+trace-or-+nssearch-with-+tcp-always-crashes-v9_18' into 'v9_18'
[v9_18] Unify dig +nssearch next query starting code for TCP and UDP protocols

See merge request isc-projects/bind9!6130
2022-04-14 11:30:43 +00:00
Aram Sargsyan
c97b23a152 Add CHANGES note for [GL #3144]
(cherry picked from commit 2a9867d512)
2022-04-14 09:40:59 +00:00
Evan Hunt
7c0ef393d8 detach unfinished query when canceling
when a query was canceled while still in the process of connecting,
tcp_connected() and udp_ready() didn't detach the query object.

(cherry picked from commit 6bf8535542)
2022-04-14 09:40:50 +00:00
Aram Sargsyan
7683d6ce69 Unify dig +nssearch next query starting code for TCP and UDP protocols
In `+nssearch` mode `dig` starts the next query of the followup lookup
using `start_udp()` or `start_tcp()` calls without waiting for the
previous query to complete.

In UDP mode that happens in the `send_done()` callback of the previous
query, but in TCP mode that happens in the `start_tcp()` call of the
previous query (recursion) which doesn't work because `start_tcp()`
attaches the `lookup->current_query` to the query it is starting, so a
recursive call will result in an assertion failure.

Make the TCP mode to start the next query in `send_done()`, just like in
the UDP mode. During that time the `lookup->current_query` is already
detached by the `tcp_connected()`/`udp_ready()` callbacks.

(cherry picked from commit b944bf4120)
2022-04-14 09:40:37 +00:00
Matthijs Mekking
da30a638a2 Merge branch '2931-cds-delete-removed-on-signing-v9_18' into 'v9_18'
[v9_18] Don't delete CDS DELETE after zone sign

See merge request isc-projects/bind9!6126
2022-04-13 13:12:04 +00:00
Matthijs Mekking
bff9a568c8 Add CDS/CDNSKEY DELETE documentation
Mention in the DNSSEC guide in the "revert to unsigned" recipe that you
can publish CDS and CDNSKEY DELETE records to remove the corresponding
DS records from the parent zone.

(cherry picked from commit f088657eb1)
2022-04-13 14:44:25 +02:00
Matthijs Mekking
c678065eaa Add CHANGE and release note for #2931
Release note worthy.

(cherry picked from commit ebbcf4c34f)
2022-04-13 14:44:18 +02:00
Matthijs Mekking
c3ab09deb5 Update dns_dnssec_syncdelete() function
Update the function that synchronizes the CDS and CDNSKEY DELETE
records. It now allows for the possibility that the CDS DELETE record
is published and the CDNSKEY DELETE record is not, and vice versa.

Also update the code in zone.c how 'dns_dnssec_syncdelete()' is called.

With KASP, we still maintain the DELETE records our self. Otherwise,
we publish the CDS and CDNSKEY DELETE record only if they are added
to the zone. We do still check if these records can be signed by a KSK.

This change will allow users to add a CDS and/or CDNSKEY DELETE record
manually, without BIND removing them on the next zone sign.

Note that this commit removes the check whether the key is a KSK, this
check is redundant because this check is also made in
'dst_key_is_signing()' when the role is set to DST_BOOL_KSK.

(cherry picked from commit 3d05c99abb)
2022-04-13 14:43:40 +02:00
Matthijs Mekking
d975d07155 Test CDS DELETE persists after zone sign
Add a test case for a dynamically added CDS DELETE record and make
sure it is not removed when signing the zone. This happens because
BIND maintains CDS and CDNSKEY publishing and it will only allow
CDS DELETE records if the zone is transitioning to insecure. This is
a state that can be identified when using KASP through 'dnssec-policy',
but not when using 'auto-dnssec'.

(cherry picked from commit f08277f9fb)
2022-04-13 14:43:34 +02:00
Michał Kępień
4a622db88d Merge branch 'michal/fix-forward-system-test-requirements-v9_18' into 'v9_18'
[v9_18] Fix "forward" system test requirements

See merge request isc-projects/bind9!6123
2022-04-12 13:32:25 +00:00
Michał Kępień
80089f52e5 Fix "forward" system test requirements
Commit 3b3495a631 added a Python-based
name server (bin/tests/system/forward/ans11/ans.py) to the "forward"
system test, but did not update bin/tests/system/Makefile.am to ensure
Python is present in the test environment before the "forward" system
test is run.  Update bin/tests/system/Makefile.am to enforce that
requirement.

(cherry picked from commit 806f457147)
2022-04-12 15:30:31 +02:00
Michał Kępień
41ddf9ce8c Merge branch 'michal/set-up-release-notes-for-bind-9.18.3' into 'v9_18'
Set up release notes for BIND 9.18.3

See merge request isc-projects/bind9!6119
2022-04-12 12:15:07 +00:00
Michał Kępień
55221e61c0 Set up release notes for BIND 9.18.3 2022-04-12 14:13:32 +02:00
Michał Kępień
4360b7532c Merge branch 'michal/update-bind-version-to-9.18.3-dev' into 'v9_18'
Update BIND version to 9.18.3-dev

See merge request isc-projects/bind9!6115
2022-04-12 11:12:20 +00:00
Michał Kępień
09ffa6cdd2 Update BIND version to 9.18.3-dev 2022-04-12 13:11:12 +02:00
Michal Nowak
cb17d68ae7 Merge branch '3129-test-check-fetch-shutting-down-in-resume_dslookup-v9_18' into 'v9_18'
[v9_18] [CVE-2022-0667] Add a hung fetch check while chasing DS in the forward system test

See merge request isc-projects/bind9!6110
2022-04-08 10:49:59 +00:00
Aram Sargsyan
db3ab0b46e Add a hung fetch check while chasing DS in the forward system test
Implement TCP support in the `ans11` Python-based DNS server.

Implement a control command channel in `ans11` to support an optional
silent mode of operation, which, when enabled, will ignore incoming
queries.

In the added check, make the `ans11` the NS server of
"a.root-servers.nil." for `ns3`, so it uses `ans11` (in silent mode)
for the regular (non-forwarded) name resolutions.

This will trigger the "hung fetch" scenario, which was causing `named`
to crash.

(cherry picked from commit 848094d6f7)
2022-04-08 12:19:04 +02:00
Petr Špaček
d9da0a55b9 Merge branch '2950-cache-acceptance-rules-test-v9_18' into 'v9_18'
[CVE-2021-25220] Add tests for forwarder cache poisoning scenarios [v9_18]

See merge request isc-projects/bind9!6105
2022-04-07 18:00:03 +00:00
Mark Andrews
3b3495a631 Add tests for forwarder cache poisoning scenarios
- Check that an NS in an authority section returned from a forwarder
  which is above the name in a configured "forward first" or "forward
  only" zone (i.e., net/NS in a response from a forwarder configured for
  local.net) is not cached.
- Test that a DNAME for a parent domain will not be cached when sent
  in a response from a forwarder configured to answer for a child.
- Check that glue is rejected if its name falls below that of zone
  configured locally.
- Check that an extra out-of-bailiwick data in the answer section is
  not cached (this was already working correctly, but was not explicitly
  tested before).

(cherry picked from commit bf3fffff67)
2022-04-07 19:30:43 +02:00
Michal Nowak
4f44fe804d Merge branch '3112-test-lingering-tcp-sockets-in-closewait-v9_18' into 'v9_18'
[v9_18] Add system test lingering CLOSE_WAIT TCP sockets

See merge request isc-projects/bind9!6103
2022-04-07 16:44:16 +00:00
Ondřej Surý
f1d1594e0a Add system test **/named.* modifier files to .reuse/dep5
There's couple of files that modify behaviour of named when started via
bin/tests/system/start.pl.  Add those files as CC-1.0 to .reuse/dep5 as
they are just empty placeholders.

(cherry picked from commit b6eb31a0e3)
2022-04-07 18:07:14 +02:00
Matthijs Mekking
b79c04d5f6 Add system test lingering CLOSE_WAIT TCP sockets
Add a test case to check for lingering TCP sockets stuck in the
CLOSE_WAIT state. This can happen if a client sends some garbage after
its first query.

The system test runs the reproducer script and then sends another TCP
query to the resolver. The resolver is configured to allow one TCP
client only. If BIND has its TCP socket stuck in CLOSE_WAIT, it does
not have the resources available to answer the second query.

Note: A better test would be to check if the named daemon does not
have a TCP socket stuck in CLOSE_WAIT for example with netstat. When
running this test locally you can examine named with netstat manually.
But since netstat is platform specific it is not a good candidate to do
this as a system test.

If you, if you could return, don't let it burn.
Do you have to let it linger?
- Cranberries

(cherry picked from commit b9ebde705b)
2022-04-07 18:07:08 +02:00
Michał Kępień
24f8670e3a Merge branch '3208-add-CHANGES-entry-v9_18' into 'v9_18'
[v9_18] Add CHANGES entry for GL #3208

See merge request isc-projects/bind9!6100
2022-04-07 13:08:01 +00:00
Michał Kępień
3008142393 Add CHANGES entry for GL #3208
(cherry picked from commit 059a602551)
2022-04-07 15:04:19 +02:00
Petr Špaček
a7c8c41172 Merge branch 'pspacek/junit-report-v9_18' into 'v9_18'
Generate JUnit reports for unit & system tests [v9_18]

See merge request isc-projects/bind9!6097
2022-04-06 19:39:59 +00:00
Petr Špaček
8961dc452e Generate JUnit reports for unit & system tests
This allows Gitlab to show nice summary for individual tests/test
directories and to expose the results in Gitlab API for consumption
elsewhere.

A catch: As of Gitlab 14.7.7, the detailed results are stored
only in artifacts and thus expire. All consumers (including API) need
to be "fast enough" to get the data before they disappear.
This also forces us to always store the artifacts intead of storing them
only on failure.

(cherry picked from commit d26d4f289f)
2022-04-06 21:16:00 +02:00
Tony Finch
b6f13cd43d Merge branch '3242-notify-notimeout-v9_18' into 'v9_18'
Ensure that zone maintenance queries have a retry limit (backport to 9.18)

See merge request isc-projects/bind9!6096
2022-04-06 17:36:16 +00:00
Tony Finch
4191fd01be Ensure that dns_request_createvia() has a retry limit
There are a couple of problems with dns_request_createvia(): a UDP
retry count of zero means unlimited retries (it should mean no
retries), and the overall request timeout is not enforced. The
combination of these bugs means that requests can be retried forever.

This change alters calls to dns_request_createvia() to avoid the
infinite retry bug by providing an explicit retry count. Previously,
the calls specified infinite retries and relied on the limit implied
by the overall request timeout and the UDP timeout (which did not work
because the overall timeout is not enforced). The `udpretries`
argument is also changed to be the number of retries; previously, zero
was interpreted as infinity because of an underflow to UINT_MAX, which
appeared to be a mistake. And `mdig` is updated to match the change in
retry accounting.

The bug could be triggered by zone maintenance queries, including
NOTIFY messages, DS parental checks, refresh SOA queries and stub zone
nameserver lookups. It could also occur with `nsupdate -r 0`.
(But `mdig` had its own code to avoid the bug.)

(cherry picked from commit 71ce8b0a51)
2022-04-06 18:17:55 +01:00
Tony Finch
9bcc537882 Make notify test shellcheck clean
Use POSIX shell syntax, and use functions to reduce repetition.

(cherry picked from commit 5867c1b727)
2022-04-06 18:16:44 +01:00
Ondřej Surý
8fef3e0efd Merge branch '3249-rename-configuration-option-to-reuseport-v9_18' into 'v9_18'
Rename the configuration option to load balance sockets to reuseport [v9.18]

See merge request isc-projects/bind9!6094
2022-04-06 15:42:08 +00:00
Ondřej Surý
a1f3ff0dd1 Rename the configuration option to load balance sockets to reuseport
After some back and forth, it was decidede to match the configuration
option with unbound ("so-reuseport"), PowerDNS ("reuseport") and/or
nginx ("reuseport").

(cherry picked from commit 7e71c4d0cc)
2022-04-06 17:24:13 +02:00
Ondřej Surý
fd9a2fc0ba Merge branch '3190-offload-rpz-updates-revert-v9_18' into 'v9_18'
Revert "Run the RPZ update as offloaded work" [v9.18]

See merge request isc-projects/bind9!6091
2022-04-06 11:49:11 +00:00
Ondřej Surý
25bc461446 Revert "General cleanup of dns_rpz implementation"
This reverts commit bfee462403.
2022-04-06 10:42:29 +02:00
Ondřej Surý
242500909a Revert "Refactor the dns_rpz_add/delete to use local rpz copy"
This reverts commit f4cba0784e.
2022-04-06 10:42:22 +02:00
Ondřej Surý
9b78612e7d Revert "Run the RPZ update as offloaded work"
This reverts commit e128b6a951.
2022-04-06 10:30:06 +02:00
Ondřej Surý
c8a0899ddd Revert "Add CHANGES and release note for [GL #3190]"
This reverts commit f3ae14d8c3.
2022-04-06 10:30:04 +02:00