]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
3 years agosilence coverity warnings
Evan Hunt [Mon, 3 Apr 2023 19:18:11 +0000 (12:18 -0700)] 
silence coverity warnings

silence coverity warnings in the DNSPRS code:
- CID 451097, failure to check return value of rpz_ready()
- CID 451099, resource leak

3 years agoMerge branch '3996-pairwise-skip-fips-mode' into 'main'
Michal Nowak [Wed, 5 Apr 2023 07:22:36 +0000 (07:22 +0000)] 
Merge branch '3996-pairwise-skip-fips-mode' into 'main'

Revert "Enable FIPS testing in Pairwise"

See merge request isc-projects/bind9!7790

3 years agoRevert "Enable FIPS testing in Pairwise"
Michal Nowak [Tue, 4 Apr 2023 11:55:03 +0000 (13:55 +0200)] 
Revert "Enable FIPS testing in Pairwise"

This reverts commit e987a0c249882af0395409310b32fce7fc997015.

--enable-fips-mode ./configure option does not work on platforms without
FIPS-enabled OpenSSL.

3 years agoMerge branch '3994-unnecessary-null-check' into 'main'
Mark Andrews [Wed, 5 Apr 2023 00:25:15 +0000 (00:25 +0000)] 
Merge branch '3994-unnecessary-null-check' into 'main'

Resolve "Unnecessary NULL check"

Closes #3994

See merge request isc-projects/bind9!7783

3 years agoRemove 'inst != NULL' from cleanup check in plugin_register
Mark Andrews [Tue, 4 Apr 2023 01:01:36 +0000 (11:01 +1000)] 
Remove 'inst != NULL' from cleanup check in plugin_register

'inst' is guarenteed to be non NULL at this point.

    358        *instp = inst;
    359
    360cleanup:

    CID 281450 (#2 of 2): Dereference before null check (REVERSE_INULL)
    check_after_deref: Null-checking inst suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
    361        if (result != ISC_R_SUCCESS && inst != NULL) {
    362                plugin_destroy((void **)&inst);
    363        }
    364
    365        return (result);

3 years agoMerge branch 'ondrej/require-dnspyton-2.0.0-in-shutdown-system-test' into 'main'
Ondřej Surý [Tue, 4 Apr 2023 19:58:31 +0000 (19:58 +0000)] 
Merge branch 'ondrej/require-dnspyton-2.0.0-in-shutdown-system-test' into 'main'

Bump the requirement in the shutdown test to dnspython 2.0.0

See merge request isc-projects/bind9!7796

3 years agoBump the requirement in the shutdown test to dnspython 2.0.0
Ondřej Surý [Tue, 4 Apr 2023 19:31:58 +0000 (21:31 +0200)] 
Bump the requirement in the shutdown test to dnspython 2.0.0

The dnspython.Resolve.resolve() requires at least dnspython >= 2.0.0,
this wasn't enforced in the shutdown system test leading to infinite
loop waiting for the server start due to failing resolve() call.

3 years agoMerge branch 'ondrej/require-dnspyton-2.0.0-in-dnstap-system-test' into 'main'
Ondřej Surý [Tue, 4 Apr 2023 16:44:01 +0000 (16:44 +0000)] 
Merge branch 'ondrej/require-dnspyton-2.0.0-in-dnstap-system-test' into 'main'

Bump the requirement in dnstap test to dnspython 2.0.0

See merge request isc-projects/bind9!7793

3 years agoBump the requirement in dnstap test to dnspython 2.0.0
Ondřej Surý [Tue, 4 Apr 2023 15:21:07 +0000 (17:21 +0200)] 
Bump the requirement in dnstap test to dnspython 2.0.0

The dnspython.Resolve.resolve() requires at least dnspython >= 2.0.0,
this wasn't enforced in the dnstap system test.

3 years agoMerge branch 'ondrej/add-tests-for-rpz-in-multiple-views' into 'main'
Ondřej Surý [Tue, 4 Apr 2023 14:27:24 +0000 (14:27 +0000)] 
Merge branch 'ondrej/add-tests-for-rpz-in-multiple-views' into 'main'

Add test for RPZ in multiple views

See merge request isc-projects/bind9!7711

3 years agoSquash both rpzextra tests into tests_rpzextra.py
Ondřej Surý [Mon, 3 Apr 2023 09:11:25 +0000 (11:11 +0200)] 
Squash both rpzextra tests into tests_rpzextra.py

We don't need a separate module/file for every test. Both the rpz tests
could live in the same file.

The setup/teardown of servers if performed separately for each module --
unless there is a need to do that, it's better to avoid it.

3 years agoUse more concise syntax to check responses in rpzextra tests
Tom Krizek [Thu, 23 Mar 2023 13:41:05 +0000 (14:41 +0100)] 
Use more concise syntax to check responses in rpzextra tests

All the answers are expected to have exactly one resource record. Check
it directly instead of iterating over all (possible) records.

3 years agoAdd test for RPZ in multiple views
Ondřej Surý [Wed, 22 Mar 2023 14:11:17 +0000 (15:11 +0100)] 
Add test for RPZ in multiple views

This adds rudimentary test for response-policy zones in multiple
views.  Different combinations are tested:

- two views with response-policy inherited from options {};
- two views view explicit response-policy using same RPZ zone name
- two views view explicit response-policy using secondary RPZ zone

3 years agoReplace dnspython resolver.query() with resolver.resolve()
Ondřej Surý [Wed, 22 Mar 2023 14:11:59 +0000 (15:11 +0100)] 
Replace dnspython resolver.query() with resolver.resolve()

The resolver.query() has been deprecated in favor of resolver.resolve();
used that.

3 years agoMerge branch 'ondrej/change-dns_adbentry_overquota-to-dns_adb_overquota' into 'main'
Ondřej Surý [Tue, 4 Apr 2023 14:22:20 +0000 (14:22 +0000)] 
Merge branch 'ondrej/change-dns_adbentry_overquota-to-dns_adb_overquota' into 'main'

Change dns_adbentry_overquota() to dns_adb_overquota()

See merge request isc-projects/bind9!7758

3 years agoChange dns_adbentry_overquota() to dns_adb_overquota()
Ondřej Surý [Thu, 30 Mar 2023 19:19:17 +0000 (21:19 +0200)] 
Change dns_adbentry_overquota() to dns_adb_overquota()

The dns_adbentry_overquota() was violating the layers accessing the
adbentry struct members directly.  Change it to dns_adb_overquota() to
match the dns_adb API.

3 years agoMerge branch '3997-catz-shutdown-crash-in-dns_catz_zones_unref' into 'main'
Arаm Sаrgsyаn [Tue, 4 Apr 2023 11:09:33 +0000 (11:09 +0000)] 
Merge branch '3997-catz-shutdown-crash-in-dns_catz_zones_unref' into 'main'

Resolve "Catalog zone shutdown crash in dns_catz_zones_unref"

Closes #3997

See merge request isc-projects/bind9!7786

3 years agoAdd a CHANGES note for [GL #3997]
Aram Sargsyan [Tue, 4 Apr 2023 08:24:15 +0000 (08:24 +0000)] 
Add a CHANGES note for [GL #3997]

3 years agoAttach catzs to catz instead of doing this explicitly
Ondřej Surý [Tue, 4 Apr 2023 08:17:45 +0000 (08:17 +0000)] 
Attach catzs to catz instead of doing this explicitly

Instead of explicitly adding a reference to catzs (catalog zones) when
calling the update callback, attach the catzs to the catz (catalog zone)
object to keep it referenced for the whole time the catz exists.

3 years agoMerge branch '3984-fix-double-unref-when-shutting-down-dns_xfrin' into 'main'
Ondřej Surý [Tue, 4 Apr 2023 10:26:10 +0000 (10:26 +0000)] 
Merge branch '3984-fix-double-unref-when-shutting-down-dns_xfrin' into 'main'

Don't detach xfr in dns_xfrin_shutdown()

Closes #3984

See merge request isc-projects/bind9!7787

3 years agoAdd CHANGES note for [GL #3984]
Ondřej Surý [Tue, 4 Apr 2023 08:32:41 +0000 (10:32 +0200)] 
Add CHANGES note for [GL #3984]

3 years agoDon't detach xfr in dns_xfrin_shutdown()
Ondřej Surý [Tue, 4 Apr 2023 08:26:41 +0000 (10:26 +0200)] 
Don't detach xfr in dns_xfrin_shutdown()

As we are now using dispatch instead of netmgr for XFR TCP connection,
the xfrin_recv_done() will be called when cancelling the dispatch with
ISC_R_CANCELED.  This could lead to double detach from the dns_xfrin_t,
one in the xfrin_recv_done() and one in the dns_xfrin_shutdown().

Remove the extra detach from the dns_xfrin_shutdown() and rely on the
dispatch read callback to be always called.

3 years agoMerge branch '3989-remove-dead-code-from-dns_xfrin' into 'main'
Ondřej Surý [Tue, 4 Apr 2023 07:40:59 +0000 (07:40 +0000)] 
Merge branch '3989-remove-dead-code-from-dns_xfrin' into 'main'

Fix xfrin_connect_done() error paths

Closes #3989

See merge request isc-projects/bind9!7774

3 years agoAdd CHANGES note for [GL #3989]
Ondřej Surý [Mon, 3 Apr 2023 13:07:45 +0000 (15:07 +0200)] 
Add CHANGES note for [GL #3989]

3 years agoFix xfrin_connect_done() error paths
Ondřej Surý [Mon, 3 Apr 2023 12:56:17 +0000 (14:56 +0200)] 
Fix xfrin_connect_done() error paths

The xfrin_connect_done() had several problems:

- it would not add the server to unreachable table in case of the
  failure coming from the dispatch [GL #3989]

- if dns_dispatch_checkperm() disallowed the connection, the xfr would
  be left undetached

- if xfrin_send_request() failed to send the request, the xfr would be
  left undetached

All of these have been fixed in this commit.

3 years agoMerge branch 'each-zone-refcount' into 'main'
Evan Hunt [Tue, 4 Apr 2023 07:08:11 +0000 (07:08 +0000)] 
Merge branch 'each-zone-refcount' into 'main'

use ISC_REFCOUNT_IMPL for external dns_zone references

See merge request isc-projects/bind9!7784

3 years agouse ISC_REFCOUNT_IMPL for external dns_zone references
Evan Hunt [Mon, 3 Apr 2023 22:48:44 +0000 (15:48 -0700)] 
use ISC_REFCOUNT_IMPL for external dns_zone references

use the ISC_REFCOUNT implementation for dns_zone_attach() and
_detach(). (this applies only to external zone references, not
to dns_zone_iattach() and dns_zone_idetach().)

use dns_zone_ref() where previously a dummy zone object had been
used to increment the reference count.

3 years agoMerge branch '3975-libdummy-tsan' into 'main'
Evan Hunt [Tue, 4 Apr 2023 07:07:09 +0000 (07:07 +0000)] 
Merge branch '3975-libdummy-tsan' into 'main'

suppress TSAN reports from dummy DNSRPS library

Closes #3975

See merge request isc-projects/bind9!7782

3 years agosuppress TSAN reports from dummy DNSRPS library
Evan Hunt [Mon, 3 Apr 2023 20:24:09 +0000 (13:24 -0700)] 
suppress TSAN reports from dummy DNSRPS library

this is a test-only library that will never be used in production.
making it thread safe doesn't need to be a high priority.

3 years agoMerge branch '3981-reduce-dnssec-verify-calls' into 'main'
Petr Špaček [Mon, 3 Apr 2023 15:45:33 +0000 (15:45 +0000)] 
Merge branch '3981-reduce-dnssec-verify-calls' into 'main'

Reduce dns_dnssec_verify calls made checking for revoked trust anchor

Closes #3981

See merge request isc-projects/bind9!7763

3 years agoAdd release note for [GL #3981]
Petr Špaček [Mon, 3 Apr 2023 14:57:32 +0000 (16:57 +0200)] 
Add release note for [GL #3981]

3 years agoAdd CHANGES for [GL #3981]
Mark Andrews [Fri, 31 Mar 2023 07:19:30 +0000 (18:19 +1100)] 
Add CHANGES for [GL #3981]

3 years agodns_view_untrust modifies dnskey->flags when it shouldn't
Mark Andrews [Tue, 29 Nov 2022 05:11:51 +0000 (16:11 +1100)] 
dns_view_untrust modifies dnskey->flags when it shouldn't

Copy the structure and declare dnskey as const.

3 years agoHandle dns_rdata_fromstruct failure dns_keytable_deletekey
Mark Andrews [Tue, 29 Nov 2022 05:07:39 +0000 (16:07 +1100)] 
Handle dns_rdata_fromstruct failure dns_keytable_deletekey

dns_rdata_fromstruct in dns_keytable_deletekey can potentially
fail with ISC_R_NOSPACE.  Handle the error condition.

3 years agoReduce the number of verifiations required
Mark Andrews [Thu, 24 Nov 2022 03:18:20 +0000 (14:18 +1100)] 
Reduce the number of verifiations required

In selfsigned_dnskey only call dns_dnssec_verify if the signature's
key id matches a revoked key, the trust is pending and the key
matches a trust anchor.  Previously named was calling dns_dnssec_verify
unconditionally resulted in busy work.

3 years agoAdd new view method dns_view_istrusted
Mark Andrews [Tue, 29 Nov 2022 05:17:13 +0000 (16:17 +1100)] 
Add new view method dns_view_istrusted

dns_view_istrusted determines if the given key is treated as
being trusted by the view.

3 years agoMerge branch '3674-nsupdate--t-timeout-does-not-work' into 'main'
Arаm Sаrgsyаn [Mon, 3 Apr 2023 15:22:25 +0000 (15:22 +0000)] 
Merge branch '3674-nsupdate--t-timeout-does-not-work' into 'main'

Resolve "nsupdate -t timeout does not work"

Closes #3674

See merge request isc-projects/bind9!7279

3 years agonsupdate: set network manager default timeout values
Aram Sargsyan [Fri, 31 Mar 2023 12:25:01 +0000 (12:25 +0000)] 
nsupdate: set network manager default timeout values

The default values are currently set to 30 seconds, use nsupdate
default (or overriden using the -t option) timeout value instead.

3 years agoAdd a CHANGES note for [GL #3674]
Aram Sargsyan [Wed, 28 Dec 2022 16:29:26 +0000 (16:29 +0000)] 
Add a CHANGES note for [GL #3674]

3 years agonsupdate: use the configurable timeout and retry values for all queries
Aram Sargsyan [Wed, 28 Dec 2022 10:20:37 +0000 (10:20 +0000)] 
nsupdate: use the configurable timeout and retry values for all queries

The 'nsupdate' tool, when sending SOA queries, uses a hard-coded value
3 UDP retries and of 5 seconds of timeout for UDP queries, and 100
seconds of timeout for TCP queries.

Use the timeout and retry values which can be configured using the
-t, -u, -r command line options, and which are already used for
sending the update query.

3 years agoUpdate nsupdate -t option's documentation
Aram Sargsyan [Wed, 28 Dec 2022 10:12:12 +0000 (10:12 +0000)] 
Update nsupdate -t option's documentation

Add some clarifications about the -t option's behavior differences
in TCP and UDP modes.

3 years agoDo not resend TCP requests
Aram Sargsyan [Mon, 12 Dec 2022 12:12:13 +0000 (12:12 +0000)] 
Do not resend TCP requests

The req_response() function is using 'udpcount' variable to resend
the request 'udpcount' times on timeout even for TCP requests,
which does not make sense, as it would use the same connection.

Add a condition to use the resend logic only for UDP requests.

3 years agoPerform request validation in req_response() before using the pointer
Aram Sargsyan [Mon, 12 Dec 2022 12:08:16 +0000 (12:08 +0000)] 
Perform request validation in req_response() before using the pointer

The 'request' pointer is used before it is checked. Perform the check
before using the pointer.

3 years agoSynchronize dns_request_createraw() and dns_request_create() UDP timeout
Aram Sargsyan [Mon, 12 Dec 2022 11:55:09 +0000 (11:55 +0000)] 
Synchronize dns_request_createraw() and dns_request_create() UDP timeout

The dns_request_createraw() function, unlike dns_request_create(), when
calculating the UDP timeout value, doesn't check that 'udpretries' is
not zero, and that is the more logical behavior, because the calculation
formula uses division to 'udpretries + 1', where '1' is the first try.

Change the dns_request_create() function to remove the 'udpretries != 0'
condition.

Add a 'REQUIRE(udpretries != UINT_MAX)' check to protect from a division
by zero.

Make the 'request->udpcount' field to represent the number of tries,
instead of the number of retries.

3 years agonsupdate: when set to 0, UDP timeout should be calculated by dns_request
Aram Sargsyan [Mon, 12 Dec 2022 11:36:42 +0000 (11:36 +0000)] 
nsupdate: when set to 0, UDP timeout should be calculated by dns_request

The manual page of nsupdate's '-u udptimeout' option states that, quote:

> If zero, the interval is computed from the timeout interval and number
> of UDP retries.

However, nsupdate sets the UDP timeout value to UINT_MAX when it is 0,
thus, not behaving as documented.

Let dns_request_create() calculate the UDP timeout, if it was set to 0.

3 years agoAdd nsupdate timeout tests
Aram Sargsyan [Wed, 28 Dec 2022 15:55:43 +0000 (15:55 +0000)] 
Add nsupdate timeout tests

* nsupdate should take 12 seconds (one try and three retries with
  3 second timeout for each), UDP mode
* nsupdate -u 4 -r 1 should take 8 seconds (one try and one retry with
  4 second timeout for each), UDP mode
* nsupdate -u 0 -t 8 -r 1 should also take 8 seconds, UDP mode
* nsupdate -u 4 -t 30 -r 1 should also take 8 seconds, as -u takes
  precedence over -t, UDP mode
* nsupdate -t 8 -v should also take 8 seconds, TCP mode

3 years agoMerge branch '3910-coverity-qp-tests' into 'main'
Tony Finch [Mon, 3 Apr 2023 15:11:03 +0000 (15:11 +0000)] 
Merge branch '3910-coverity-qp-tests' into 'main'

Fix Coverity complaints in the qp-trie tests

Closes #3910

See merge request isc-projects/bind9!7630

3 years agoMore dns_qpkey_t safety checks
Tony Finch [Mon, 3 Apr 2023 13:20:20 +0000 (14:20 +0100)] 
More dns_qpkey_t safety checks

My original idea had been that the core qp-trie code would be mostly
independent of the storage for keys, so I did not make it check at run
time that key lengths are sensible. However, the qp-trie search
routines need to get keys out of leaf objects, for which they provide
storage on the stack, which is particularly dangerous for unchecked
buffer overflows. So this change checks that key lengths are in bounds
at the API boundary between the qp-trie code and the rest of BIND, and
there is no more pretence that keys might be longer.

3 years agoFix Coverity complaints in the qp-trie tests
Tony Finch [Wed, 1 Mar 2023 09:53:35 +0000 (09:53 +0000)] 
Fix Coverity complaints in the qp-trie tests

The main problem was `qp_test_keytoname()` not using `qpkey_bit()`
to do bounds checking.

3 years agoMerge branch 'bug/main/rndc-dnstap-roll' into 'main'
Petr Špaček [Mon, 3 Apr 2023 14:43:55 +0000 (14:43 +0000)] 
Merge branch 'bug/main/rndc-dnstap-roll' into 'main'

Document that rndc dnstap -roll number is optional

See merge request isc-projects/bind9!7755

3 years agoMake it obvious -roll number is optional
Petr Menšík [Thu, 30 Mar 2023 16:30:50 +0000 (18:30 +0200)] 
Make it obvious -roll number is optional

Manual page were updated to indicate it, but rndc -h still displays it
as required parameter. Make it look like optional.

3 years agoMerge branch '3901-parental-agents-auto' into 'main'
Matthijs Mekking [Mon, 3 Apr 2023 14:01:35 +0000 (14:01 +0000)] 
Merge branch '3901-parental-agents-auto' into 'main'

Automatic parental-agents (checkds yes)

Closes #3901

See merge request isc-projects/bind9!7742

3 years agoMake checkds system test more resilient
Matthijs Mekking [Wed, 29 Mar 2023 09:26:22 +0000 (11:26 +0200)] 
Make checkds system test more resilient

The checkds system test could fail if some parent secondary servers did
not yet loaded all the zones before ns9 started sending DS queries. This
leads to SERVFAIL responses, while the test case expects good DS
responses. In order to mitigate against this issue, call 'rndc loadkeys'
to quickly restart the checkds procedure again.

Also refactor the checkds system test, to get rid of the many zone
name duplications. Update the functions 'zone_check' and
'keystate_check' to make the zone name an FQDN so we can just pass
the 'zone' variable into the function.

3 years agoDetermine checkds default from config
Matthijs Mekking [Tue, 28 Mar 2023 14:57:58 +0000 (16:57 +0200)] 
Determine checkds default from config

If the 'checkds' option is not explicitly set, check if there are
'parental-agents' for the zone configured. If so, default to "explicit",
otherwise default to "yes".

3 years agoMake checkds yes the default
Matthijs Mekking [Tue, 28 Mar 2023 14:54:47 +0000 (16:54 +0200)] 
Make checkds yes the default

This seems to be the more common case.

3 years agoAdd two checkds test servers
Matthijs Mekking [Tue, 28 Mar 2023 14:47:16 +0000 (16:47 +0200)] 
Add two checkds test servers

Add two new checkds test servers, that are hidden secondaries (hidden
as in not published in the NS RRset), that can be used specifically
for testing explicitly configured parental-agents.

3 years agoRemove obsoleted checkds test name servers
Matthijs Mekking [Tue, 28 Mar 2023 14:10:51 +0000 (16:10 +0200)] 
Remove obsoleted checkds test name servers

These resolver based parental-agents have been replaced by ns3.

3 years agoAdd CHANGES and release notes for #3901
Matthijs Mekking [Tue, 28 Mar 2023 14:05:20 +0000 (16:05 +0200)] 
Add CHANGES and release notes for #3901

This is a new feature that deserves attention.

3 years agoImplement auto parental-agents (checkds yes)
Matthijs Mekking [Tue, 28 Mar 2023 13:55:51 +0000 (15:55 +0200)] 
Implement auto parental-agents (checkds yes)

Implement the new feature, automatic parental-agents. This is enabled
with 'checkds yes'.

When set to 'yes', instead of querying the explicit configured
parental agents, look up the parental agents by resolving the parent
NS records. The found parent NS RRset is considered to be the list
of parental agents that should be queried during a KSK rollover,
looking up the DS RRset corresponding to the key signing keys.

For each NS record, look up the addresses in the ADB. These addresses
will be used to send the DS requests. Count the number of servers and
keep track of how many good DS responses were seen.

3 years agoAdd test case with no empty non-terminals
Matthijs Mekking [Tue, 28 Mar 2023 13:17:52 +0000 (15:17 +0200)] 
Add test case with no empty non-terminals

The previous test cases already test the more complex case where there
are empty non-terminals between the child apex and the parent domain.

Add a test case where this is not the case, to execute the other code
path.

3 years agoAdd test cases for 'checkds no'
Matthijs Mekking [Tue, 28 Mar 2023 12:35:57 +0000 (14:35 +0200)] 
Add test cases for 'checkds no'

Add test cases for when checkds is disabled. Copy the test cases that
would have resulted in a DSPublish or DSRemoved and make sure that
with 'checkds no' the metadata is not set.

3 years agoAdd test cases for 'checkds yes'
Matthijs Mekking [Tue, 28 Mar 2023 10:00:56 +0000 (12:00 +0200)] 
Add test cases for 'checkds yes'

Add the test cases for automatic parental-agents, i.e. when 'checkds'
is set to 'yes'. Split out the special cases that use a reference
or a resolver as parental-agent so that the common use cases can be
tested with the same function.

3 years agoUpdate checkds system test
Matthijs Mekking [Fri, 24 Mar 2023 16:22:24 +0000 (17:22 +0100)] 
Update checkds system test

Make the checkds system test more structured with the many more test
cases to come. Add a README for clarity.

Update the 'has_signed_apex_nsec' helper function so it can take any
domain name regardless of the number of labels.

Change the DNS tree structure such that we have different TLD names
for the various test scenarios, because we need servers that respond
differently to DS queries. Note that this isn't applicable to the
existing "checkds explicit" test cases, but is preparation work for
testing "checkds yes" (automatic parental agents).

Add a trust-anchor to the server that will be querying for parent
NS records.

3 years agoUpdate documenation for 'checkds' option
Matthijs Mekking [Wed, 8 Mar 2023 14:14:11 +0000 (15:14 +0100)] 
Update documenation for 'checkds' option

Add text about the 'checkds' option in the ARM reference and
DNSSEC guide.

3 years agoAdd new 'checkds' configuration option
Matthijs Mekking [Wed, 8 Mar 2023 13:56:08 +0000 (14:56 +0100)] 
Add new 'checkds' configuration option

Add a new configuration option to set how the checkds method should
work. Acceptable values are 'yes', 'no', and 'explicit'.

When set to 'yes', the checkds method is to lookup the parental agents
by querying the NS records of the parent zone.

When set to 'no', no checkds method is enabled. Users should run
the 'rndc checkds' command to signal that DS records are published and
withdrawn.

When set to 'explicit', the parental agents are explicitly configured
with the 'parental-agents' configuration option.

3 years agoMerge branch '3930-gcc-12-static-analyzer-warning-dereference-of-null-in-in-siphash...
Ondřej Surý [Mon, 3 Apr 2023 13:32:53 +0000 (13:32 +0000)] 
Merge branch '3930-gcc-12-static-analyzer-warning-dereference-of-null-in-in-siphash-c' into 'main'

Resolve "GCC 12 static analyzer: warning: dereference of NULL 'in' in siphash.c"

Closes #3930

See merge request isc-projects/bind9!7656

3 years agoSilence NULL pointer dereferene false positive
Mark Andrews [Wed, 8 Mar 2023 05:05:03 +0000 (16:05 +1100)] 
Silence NULL pointer dereferene false positive

Only attempt to digest 'in' if it is non NULL.  This will prevent
false positives about NULL pointer dereferences against 'in' and
should also speed up the processing.

3 years agoMerge branch '3974-rpz-testlib-test-data-c-compilation-fails-on-openbsd' into 'main'
Ondřej Surý [Mon, 3 Apr 2023 13:32:32 +0000 (13:32 +0000)] 
Merge branch '3974-rpz-testlib-test-data-c-compilation-fails-on-openbsd' into 'main'

Resolve "rpz/testlib/test-data.c compilation fails on OpenBSD"

Closes #3974

See merge request isc-projects/bind9!7748

3 years agoDefine and use DLOPEN_LIBS
Mark Andrews [Mon, 3 Apr 2023 06:12:08 +0000 (16:12 +1000)] 
Define and use DLOPEN_LIBS

3 years agoHandle old <arpa/nameser.h> with old API
Mark Andrews [Wed, 29 Mar 2023 23:49:13 +0000 (10:49 +1100)] 
Handle old <arpa/nameser.h> with old API

Define the types and classes we use from the new API.

3 years agoMerge branch 'artem-streamdns-avoid-copying-on-reading' into 'main'
Ondřej Surý [Mon, 3 Apr 2023 13:31:51 +0000 (13:31 +0000)] 
Merge branch 'artem-streamdns-avoid-copying-on-reading' into 'main'

Stream DNS: try to handle incoming data directly - avoid memory copying/buffer resizing when reading data

See merge request isc-projects/bind9!7280

3 years agoStream DNS: avoid memory copying/buffer resizing when reading data
Artem Boldariev [Mon, 26 Dec 2022 15:42:49 +0000 (17:42 +0200)] 
Stream DNS: avoid memory copying/buffer resizing when reading data

This commit optimises isc_dnsstream_assembler_t in such a way that
memory copying and reallocation are avoided when receiving one or more
complete DNS messages at once. We try to handle the data from the
messages directly, without storing them in an intermediate memory
buffer.

3 years agoMerge branch '3990-remove-dead-code-from-dst_api' into 'main'
Ondřej Surý [Mon, 3 Apr 2023 13:29:52 +0000 (13:29 +0000)] 
Merge branch '3990-remove-dead-code-from-dst_api' into 'main'

Eliminate the dead code in dst_api.c

Closes #3990

See merge request isc-projects/bind9!7773

3 years agoEliminate the dead code in dst_api.c
Ondřej Surý [Mon, 3 Apr 2023 12:09:13 +0000 (14:09 +0200)] 
Eliminate the dead code in dst_api.c

In write_public_key() and write_key_state(), there were left-over checks
for result, that were effectively dead code after the last refactoring.
Remove those.

3 years agoMerge branch 'fanf-histo' into 'main'
Tony Finch [Mon, 3 Apr 2023 11:41:25 +0000 (11:41 +0000)] 
Merge branch 'fanf-histo' into 'main'

Add isc_histo histograms, and use it for message size statistics

Closes #3464

See merge request isc-projects/bind9!7696

3 years agoCHANGES note for [GL !7696]
Tony Finch [Fri, 17 Mar 2023 12:05:59 +0000 (12:05 +0000)] 
CHANGES note for [GL !7696]

[func] Add isc_histo_t general-purpose log-linear histograms,
and use them for message size statistics.

3 years agoUse isc_histo for the message size statistics
Tony Finch [Thu, 16 Mar 2023 14:31:46 +0000 (14:31 +0000)] 
Use isc_histo for the message size statistics

This should have no functional effects.

The message size stats are specified by RSSAC002 so it's best not
to mess around with how they appear in the statschannel. But it's
worth changing the implementation to use general-purpose histograms,
to reduce code size and benefit from sharded counters.

3 years agoRemove obsolete code from dns_stats
Tony Finch [Thu, 16 Mar 2023 10:51:22 +0000 (10:51 +0000)] 
Remove obsolete code from dns_stats

It became obsolete in 2008

3 years agoSimplify histogram quantiles
Tony Finch [Mon, 20 Mar 2023 15:05:36 +0000 (15:05 +0000)] 
Simplify histogram quantiles

The `isc_histosummary_t` functions were written in the early days of
`hg64` and carried over when I brought `hg64` into BIND. They were
intended to be useful for graphing cumulative frequency distributions
and the like, but in practice whatever draws charts is better off with
a raw histogram export. Especially because of the poor performance of
the old functions.

The replacement `isc_histo_quantiles()` function is intended for
providing a few quantile values in BIND's stats channel, when the user
does not want the full histogram. Unlike the old functions, the caller
provides all the query fractions up-front, so that the values can be
found in a single scan instead of a scan per value. The scan is from
larger values to smaller, since larger quantiles are usually more
interesting, so the scan can bail out early.

3 years agoAdd per-thread sharded histograms for heavy loads
Tony Finch [Thu, 16 Mar 2023 09:46:15 +0000 (09:46 +0000)] 
Add per-thread sharded histograms for heavy loads

Although an `isc_histo_t` is thread-safe, it can suffer
from cache contention under heavy load. To avoid this,
an `isc_histomulti_t` contains a histogram per thread,
so updates are local and low-contention.

3 years agoAdd isc_histo for histogram statistics
Tony Finch [Wed, 8 Mar 2023 09:55:42 +0000 (09:55 +0000)] 
Add isc_histo for histogram statistics

This is an adaptation of my `hg64` experiments for use in BIND.

As well as renaming everything according to ISC style, I have
written some more extensive tests that ensure the edge cases are
correct and the fenceposts are in the right places.

I have added utility functions for working with precision in terms of
decimal significant figures as well as this code's native binary.

3 years agoMerge branch '3710-properly-document-DF-flag-on-outbound-UDP' into 'main'
Ondřej Surý [Mon, 3 Apr 2023 10:28:47 +0000 (10:28 +0000)] 
Merge branch '3710-properly-document-DF-flag-on-outbound-UDP' into 'main'

Clarify the documentation about DF-flag

Closes #3710

See merge request isc-projects/bind9!7770

3 years agoAdd CHANGES note for [GL #3710]
Ondřej Surý [Mon, 3 Apr 2023 09:42:52 +0000 (11:42 +0200)] 
Add CHANGES note for [GL #3710]

3 years agoClarify the documentation about DF-flag
Ondřej Surý [Mon, 3 Apr 2023 09:40:34 +0000 (11:40 +0200)] 
Clarify the documentation about DF-flag

Remove the reference to setting the DF-flag as we don't do that right
now.  Rephrase the paragraph that the default value should not be
causing fragmentation.

3 years agoMerge branch 'ondrej/replace-DE_CONST-with-simpler-UNCONST' into 'main'
Ondřej Surý [Mon, 3 Apr 2023 10:26:02 +0000 (10:26 +0000)] 
Merge branch 'ondrej/replace-DE_CONST-with-simpler-UNCONST' into 'main'

Replace DE_CONST(k, v) with v = UNCONST(k) macro

See merge request isc-projects/bind9!7760

3 years agoReplace DE_CONST(k, v) with v = UNCONST(k) macro
Ondřej Surý [Thu, 30 Mar 2023 20:34:12 +0000 (22:34 +0200)] 
Replace DE_CONST(k, v) with v = UNCONST(k) macro

Replace the complicated DE_CONST macro that required union with much
simple reference-dereference trick in the UNCONST() macro.

3 years agoMerge branch 'ondrej/cleanup-windows-bits' into 'main'
Ondřej Surý [Mon, 3 Apr 2023 09:06:27 +0000 (09:06 +0000)] 
Merge branch 'ondrej/cleanup-windows-bits' into 'main'

Cleanup the last Windows / MSC ifdefs and comments

See merge request isc-projects/bind9!7754

3 years agoCleanup the last Windows / MSC ifdefs and comments
Ondřej Surý [Thu, 30 Mar 2023 15:35:00 +0000 (17:35 +0200)] 
Cleanup the last Windows / MSC ifdefs and comments

Cleanup the remnants of MS Compiler bits from <isc/refcount.h>, printing
the information in named/main.c, and cleanup some comments about Windows
that no longer apply.

The bits in picohttpparser.{h,c} were left out, because it's not our
code.

3 years agoMerge branch '3915-check-dig-output-for-errors' into 'main'
Tom Krizek [Mon, 3 Apr 2023 08:50:01 +0000 (08:50 +0000)] 
Merge branch '3915-check-dig-output-for-errors' into 'main'

Find errors in dig output in system tests

Closes #3915

See merge request isc-projects/bind9!7679

3 years agoFind errors in dig output in system tests
Tom Krizek [Mon, 13 Mar 2023 12:36:24 +0000 (13:36 +0100)] 
Find errors in dig output in system tests

Facilitate faster system test failure identification and debugging by
checking any dig outputs for errors, which are typically indicative of
CI runner network / load issues.

3 years agoMerge branch 'mnowak/fix-fips-in-tests' into 'main'
Mark Andrews [Mon, 3 Apr 2023 04:30:43 +0000 (04:30 +0000)] 
Merge branch 'mnowak/fix-fips-in-tests' into 'main'

FIPS fixes and enhancements

See merge request isc-projects/bind9!4281

3 years agoDisable leak detection in FIPS mode
Mark Andrews [Wed, 22 Mar 2023 01:43:49 +0000 (12:43 +1100)] 
Disable leak detection in FIPS mode

3 years agoHandle MD5 not being supported by lib crypto
Mark Andrews [Wed, 22 Mar 2023 00:14:11 +0000 (11:14 +1100)] 
Handle MD5 not being supported by lib crypto

When initialising the message digests in lib/isc/md.c no
longer assume that the initialisation cannot fail.

3 years agoforward: Check if TLS is working in FIPS mode
Mark Andrews [Wed, 22 Mar 2023 00:02:02 +0000 (11:02 +1100)] 
forward: Check if TLS is working in FIPS mode

Skip test that depend on TLS working in FIPS mode

3 years agoDon't check for OPENSSL_cleanup failures by default
Mark Andrews [Tue, 21 Mar 2023 03:29:46 +0000 (14:29 +1100)] 
Don't check for OPENSSL_cleanup failures by default

OPENSSL_cleanup is supposed to free all remaining memory in use
provided the application has cleaned up properly.  This is not the
case on some operating systems.  Silently ignore memory that is
freed after OPENSSL_cleanup has been called.

3 years agoTest whether the crypto library supports the HMAC algorithm
Mark Andrews [Fri, 24 Feb 2023 01:59:18 +0000 (12:59 +1100)] 
Test whether the crypto library supports the HMAC algorithm

When initialising HMAC support check that the crypto library
supports the algorithm rather than just assuming it is supported.

3 years agomake feature-test --md5 --with-fips aware
Mark Andrews [Fri, 24 Feb 2023 01:21:04 +0000 (12:21 +1100)] 
make feature-test --md5 --with-fips aware

3 years agoCleanup on error paths
Mark Andrews [Mon, 30 Jan 2023 01:55:59 +0000 (12:55 +1100)] 
Cleanup on error paths

Rather that call 'exit' cleanup on error paths as that allows OpenSSL
to cleanup properly in its exit handlers.

3 years agoHandle fatal and FIPS provider interactions
Mark Andrews [Fri, 27 Jan 2023 05:52:59 +0000 (16:52 +1100)] 
Handle fatal and FIPS provider interactions

When fatal is called we may be holding memory allocated by OpenSSL.
This may result in the reference count for the FIPS provider not
going to zero and the shared library not being unloaded during
OPENSSL_cleanup.  When the shared library is ultimately unloaded,
when all remaining dynamically loaded libraries are freed, we have
already destroyed the memory context we where using to track memory
leaks / late frees resulting in INSIST being called.

Disable triggering the INSIST when fatal has being called.

3 years agoget_algorithms.py: use FIPS compatible bit size
Mark Andrews [Thu, 12 Jan 2023 22:48:53 +0000 (09:48 +1100)] 
get_algorithms.py: use FIPS compatible bit size

The minimum RSA key size that can be used in FIPS mode is 2048 bits.