]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
3 years agoRemove unused netmgr->worker->sendbuf
Ondřej Surý [Fri, 14 Apr 2023 11:38:41 +0000 (13:38 +0200)] 
Remove unused netmgr->worker->sendbuf

By inspecting the code, it was discovered that .sendbuf member of the
isc__nm_networker_t was unused and just consuming ~64k per worker.
Remove the member and the association allocation/deallocation.

3 years agoMerge branch '4000-openssl-attr-malloc-vs-cmocka-define-malloc' into 'main'
Arаm Sаrgsyаn [Fri, 14 Apr 2023 12:12:13 +0000 (12:12 +0000)] 
Merge branch '4000-openssl-attr-malloc-vs-cmocka-define-malloc' into 'main'

unit tests: include an OpenSSL header before including cmocka.h

Closes #4000

See merge request isc-projects/bind9!7820

3 years agoAdd a CHANGES note for [GL #4000]
Aram Sargsyan [Thu, 6 Apr 2023 13:22:46 +0000 (13:22 +0000)] 
Add a CHANGES note for [GL #4000]

3 years agounit tests: include an OpenSSL header before including cmocka.h
Aram Sargsyan [Thu, 6 Apr 2023 13:18:04 +0000 (13:18 +0000)] 
unit tests: include an OpenSSL header before including cmocka.h

OpenSSL 3.1.0 uses __attribute__(malloc), conflicting with a redefined
malloc in cmocka.h.

As a workaround, include an OpenSSL header file before including
cmocka.h in the unit tests where OpenSSL is used.

3 years agoMerge branch 'pspacek/set-up-version-and-release-notes-for-bind-9.19.13' into 'main'
Petr Špaček [Fri, 14 Apr 2023 09:03:19 +0000 (09:03 +0000)] 
Merge branch 'pspacek/set-up-version-and-release-notes-for-bind-9.19.13' into 'main'

Set up version and release notes for BIND 9.19.13

See merge request isc-projects/bind9!7839

3 years agoUpdate BIND version to 9.19.13-dev
Petr Špaček [Fri, 14 Apr 2023 08:51:44 +0000 (10:51 +0200)] 
Update BIND version to 9.19.13-dev

3 years agoSet up release notes for BIND 9.19.13
Petr Špaček [Fri, 14 Apr 2023 08:51:23 +0000 (10:51 +0200)] 
Set up release notes for BIND 9.19.13

3 years agoMerge branch 'aram/dns_xfrin_create-use-after-free' into 'main'
Arаm Sаrgsyаn [Fri, 14 Apr 2023 07:40:01 +0000 (07:40 +0000)] 
Merge branch 'aram/dns_xfrin_create-use-after-free' into 'main'

Fix a use-after-free bug in dns_xfrin_create()

See merge request isc-projects/bind9!7832

3 years agoAdd a CHANGES note for [GL !7832]
Aram Sargsyan [Thu, 13 Apr 2023 14:46:32 +0000 (14:46 +0000)] 
Add a CHANGES note for [GL !7832]

3 years agoFix a use-after-free bug in dns_xfrin_create()
Aram Sargsyan [Thu, 13 Apr 2023 14:42:29 +0000 (14:42 +0000)] 
Fix a use-after-free bug in dns_xfrin_create()

'xfr' is used after detaching the only reference, which would
have destroyed the object.

Call dns_xfrin_detach() only after the final use of 'xfr'.

3 years agoMerge branch '3980-add-timeouts-to-unit-tests' into 'main'
Mark Andrews [Fri, 14 Apr 2023 06:34:36 +0000 (06:34 +0000)] 
Merge branch '3980-add-timeouts-to-unit-tests' into 'main'

Draft: Resolve "Add timeouts to unit tests."

Closes #3980

See merge request isc-projects/bind9!7837

3 years agoUse SIGABRT rather than SIGKILL for long running unit test
Mark Andrews [Fri, 14 Apr 2023 05:40:02 +0000 (15:40 +1000)] 
Use SIGABRT rather than SIGKILL for long running unit test

SIGABRT will produce a core dump which will allow for forensic
analysis of the unit test

3 years agoMerge branch '3980-revert-unit-test-forking' into 'main'
Ondřej Surý [Fri, 14 Apr 2023 04:19:40 +0000 (04:19 +0000)] 
Merge branch '3980-revert-unit-test-forking' into 'main'

Revert "Kill unit tests that run more than 1200 seconds"

Closes #3980

See merge request isc-projects/bind9!7833

3 years agoRevert "Kill unit tests that run more than 1200 seconds"
Ondřej Surý [Fri, 14 Apr 2023 04:14:19 +0000 (06:14 +0200)] 
Revert "Kill unit tests that run more than 1200 seconds"

This reverts commit 3d5c7cd46c60e0a534dce0640c4e47b699e7003e which
added wrapper around all the unit tests that would run the unit test in
the forked process.

This makes any debugging of the unit tests too hard.  Futures attempts
to fix #3980 should add a custom automake test harness (log driver) that
would kill the unit test after configured timeout.

3 years agoMerge branch '4003-dump_histo-defined-but-not-used-on-fips-in-bin-named-statschannel...
Mark Andrews [Wed, 12 Apr 2023 23:49:55 +0000 (23:49 +0000)] 
Merge branch '4003-dump_histo-defined-but-not-used-on-fips-in-bin-named-statschannel-c' into 'main'

Resolve "'dump_histo' defined but not used on FIPS in bin/named/statschannel.c"

Closes #4003

See merge request isc-projects/bind9!7826

3 years agodump_histo is only used with extended stats
Mark Andrews [Wed, 12 Apr 2023 06:00:39 +0000 (16:00 +1000)] 
dump_histo is only used with extended stats

Wrap dump_histo with #if defined(EXTENDED_STATS)/#endif.  Reproduce
build failure with "configure --without-libxml2 --without-json-c"

3 years agoMerge branch '3985-make-TCP-accept-a-tad-bit-faster' into 'main'
Ondřej Surý [Wed, 12 Apr 2023 12:12:33 +0000 (12:12 +0000)] 
Merge branch '3985-make-TCP-accept-a-tad-bit-faster' into 'main'

Fix the TCP accept quota code

Closes #3985

See merge request isc-projects/bind9!7823

3 years agoAdd CHANGES note for [GL #3985]
Ondřej Surý [Sun, 9 Apr 2023 06:50:18 +0000 (08:50 +0200)] 
Add CHANGES note for [GL #3985]

3 years agoRefactor the isc_quota code and fix the quota in TCP accept code
Ondřej Surý [Tue, 11 Apr 2023 05:54:58 +0000 (07:54 +0200)] 
Refactor the isc_quota code and fix the quota in TCP accept code

In e18541287231b721c9cdb7e492697a2a80fd83fc, the TCP accept quota code
became broken in a subtle way - the quota would get initialized on the
first accept for the server socket and then deleted from the server
socket, so it would never get applied again.

Properly fixing this required a bigger refactoring of the isc_quota API
code to make it much simpler.  The new code decouples the ownership of
the quota and acquiring/releasing the quota limit.

After (during) the refactoring it became more clear that we need to use
the callback from the child side of the accepted connection, and not the
server side.

3 years agoConvert tls_send() callback to use isc_job_run()
Ondřej Surý [Tue, 11 Apr 2023 10:37:21 +0000 (12:37 +0200)] 
Convert tls_send() callback to use isc_job_run()

The tls_send() was already using uvreq; convert this to use more direct
isc_job_run() - the on-loop no-allocation method.

3 years agoConvert isc__nm_http_send() from isc_async_run() to isc_job_run()
Ondřej Surý [Tue, 11 Apr 2023 10:04:38 +0000 (12:04 +0200)] 
Convert isc__nm_http_send() from isc_async_run() to isc_job_run()

The isc__nm_http_send() was already using uvreq; convert this to use
more direct isc_job_run() - the on-loop no-allocation method.

3 years agoUse isc_job_run() for reading from StreamDNS socket
Ondřej Surý [Mon, 10 Apr 2023 05:16:45 +0000 (07:16 +0200)] 
Use isc_job_run() for reading from StreamDNS socket

Change the reading in the StreamDNS code to use isc_job_run() instead of
using isc_async_run() for less allocations and more streamlined
execution.

3 years agoRun closehandle_cb on run queue instead of async queue
Ondřej Surý [Sun, 9 Apr 2023 04:48:46 +0000 (06:48 +0200)] 
Run closehandle_cb on run queue instead of async queue

Instead of using isc_async_run() when closing StreamDNS handle, add
isc_job_t member to the isc_nmhandle_t structure and use isc_job_run()
to avoid allocation/deallocation on the StreamDNS hot-path.

3 years agoAccept overquota TCP connection on local thread if possible
Ondřej Surý [Sat, 8 Apr 2023 11:54:52 +0000 (13:54 +0200)] 
Accept overquota TCP connection on local thread if possible

If the quota callback is called on a thread matching the socket, call
the TCP accept function directly instead of using isc_async_run() which
allocates-deallocates memory.

3 years agoMake isc_tid() a header-only function
Ondřej Surý [Sat, 8 Apr 2023 11:56:13 +0000 (13:56 +0200)] 
Make isc_tid() a header-only function

The isc_tid() function is often called on the hot-path and it's the only
function is to return thread_local variable, make the isc_tid() function
a header-only to save several function calls during query-response
processing.

3 years agoMerge branch 'tkrizek/dnsrps-test-replace-egrep' into 'main'
Tom Krizek [Wed, 12 Apr 2023 11:55:28 +0000 (11:55 +0000)] 
Merge branch 'tkrizek/dnsrps-test-replace-egrep' into 'main'

Replace egrep with grep -E in rpz tests

See merge request isc-projects/bind9!7821

3 years agoReplace egrep with grep -E in rpz tests
Tom Krizek [Thu, 6 Apr 2023 14:33:06 +0000 (16:33 +0200)] 
Replace egrep with grep -E in rpz tests

GNU Grep 3.8 reports the following warnings:

    egrep: warning: egrep is obsolescent; using grep -E

3 years agoUpdate BIND version for release v9.19.12
Petr Špaček [Tue, 11 Apr 2023 14:48:56 +0000 (16:48 +0200)] 
Update BIND version for release

3 years agoAdd a CHANGES marker
Petr Špaček [Tue, 11 Apr 2023 14:48:27 +0000 (16:48 +0200)] 
Add a CHANGES marker

3 years agoMerge branch 'pspacek/prepare-documentation-for-bind-9.19.12' into 'v9.19.12-release'
Petr Špaček [Tue, 11 Apr 2023 14:46:17 +0000 (14:46 +0000)] 
Merge branch 'pspacek/prepare-documentation-for-bind-9.19.12' into 'v9.19.12-release'

Prepare documentation for BIND 9.19.12

See merge request isc-private/bind9!510

3 years agoAdd release notes for GL #3955, #3968, and #3997
Petr Špaček [Thu, 6 Apr 2023 16:45:32 +0000 (18:45 +0200)] 
Add release notes for GL #3955, #3968, and #3997

3 years agoAdd known issue release note for GL #3985 and #4006
Petr Špaček [Tue, 11 Apr 2023 14:23:53 +0000 (16:23 +0200)] 
Add known issue release note for GL #3985 and #4006

3 years agoAdd release note for GL #3998
Petr Špaček [Thu, 6 Apr 2023 16:38:58 +0000 (18:38 +0200)] 
Add release note for GL #3998

3 years agoReorder release notes
Petr Špaček [Tue, 11 Apr 2023 11:42:52 +0000 (13:42 +0200)] 
Reorder release notes

3 years agoTweak and reword release notes
Petr Špaček [Thu, 6 Apr 2023 16:35:16 +0000 (18:35 +0200)] 
Tweak and reword release notes

3 years agoPrepare release notes for BIND 9.19.12
Petr Špaček [Thu, 6 Apr 2023 16:21:47 +0000 (18:21 +0200)] 
Prepare release notes for BIND 9.19.12

3 years agoMerge branch '3975-atomically-increase-rrn-in-add-other-data' into 'main'
Mark Andrews [Tue, 11 Apr 2023 02:45:48 +0000 (02:45 +0000)] 
Merge branch '3975-atomically-increase-rrn-in-add-other-data' into 'main'

atomically increase rrn in add_other_data

Closes #3975

See merge request isc-projects/bind9!7824

3 years agoAtomically increase rrn in add_other_data
Mark Andrews [Tue, 11 Apr 2023 00:44:36 +0000 (10:44 +1000)] 
Atomically increase rrn in add_other_data

'rrn' needs to be treated atomically as it updated from multiple threads.

3 years agoMerge branch '3916-legacy-test-no-retries-in-resolution_fails' into 'main'
Michal Nowak [Thu, 6 Apr 2023 09:39:22 +0000 (09:39 +0000)] 
Merge branch '3916-legacy-test-no-retries-in-resolution_fails' into 'main'

Do not retry in resolution_fails() on timeout

Closes #3916

See merge request isc-projects/bind9!7814

3 years agoDo not retry in resolution_fails() on timeout
Michal Nowak [Wed, 5 Apr 2023 13:55:09 +0000 (15:55 +0200)] 
Do not retry in resolution_fails() on timeout

At the time of test number (19), there were 10 "sending packet to
10.53.0.7" lines in the "legacy/ns1/named.run" file; usually, only seven
are present:

    I:legacy:checking recursive lookup to edns 512 + no tcp server does not cause query loops (19)
    I:legacy:ns1 sent 10 queries to ns7, expected less than 10
    I:legacy:failed

Those three can be attributed to tests "8", "10", and "18", where the
dig of "resolution_fails()" retried after a timeout to succeed with
"status: SERVFAIL" subsequently, as seen in each of
dig.out.test{8,10,18} files.

    ;; communications error to 10.53.0.1#13093: timed out

    ; <<>> DiG 9.19.12-dev <<>> -p 13093 +tcp @10.53.0.1 edns512-notcp. TXT
    ; (1 server found)
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 5368
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

This retry is unnecessary because "resolution_fails()" considers timeout
a positive result.

3 years agoMerge branch 'mnowak/looking-for-dig-errors-must-not-fail' into 'main'
Michal Nowak [Thu, 6 Apr 2023 09:03:31 +0000 (09:03 +0000)] 
Merge branch 'mnowak/looking-for-dig-errors-must-not-fail' into 'main'

Looking for errors in dig output files must not fail

See merge request isc-projects/bind9!7813

3 years agoLooking for errors in dig output files must not fail
Michal Nowak [Thu, 6 Apr 2023 07:36:21 +0000 (09:36 +0200)] 
Looking for errors in dig output files must not fail

If no errors in dig output files of failed tests are found, TSAN file
parsing won't occur.

3 years agoMerge branch '3999-histo-div-zero' into 'main'
Ondřej Surý [Wed, 5 Apr 2023 21:29:50 +0000 (21:29 +0000)] 
Merge branch '3999-histo-div-zero' into 'main'

Fix a division by zero bug in isc_histo

Closes #3999

See merge request isc-projects/bind9!7804

3 years agoFix a division by zero bug in isc_histo
Tony Finch [Wed, 5 Apr 2023 13:17:29 +0000 (14:17 +0100)] 
Fix a division by zero bug in isc_histo

This can occur when calculating the standard deviation of an empty
histogram.

3 years agoMerge branch '3972-delv-coverity-fixes' into 'main'
Evan Hunt [Wed, 5 Apr 2023 20:19:16 +0000 (20:19 +0000)] 
Merge branch '3972-delv-coverity-fixes' into 'main'

address coverity warnings in delv

Closes #3972

See merge request isc-projects/bind9!7780

3 years agoaddress coverity warnings in delv
Evan Hunt [Mon, 3 Apr 2023 17:43:32 +0000 (10:43 -0700)] 
address coverity warnings in delv

clean up coverity warnings due to recent changes to delv:
- CID 451097: failure to check return value from inet_pton()
- CID 451098, 451100: dead code

3 years agoMerge branch '3998-incorrect-maxlabels' into 'main'
Tony Finch [Wed, 5 Apr 2023 14:46:48 +0000 (14:46 +0000)] 
Merge branch '3998-incorrect-maxlabels' into 'main'

Correct value of DNS_NAME_MAXLABELS

Closes #3998

See merge request isc-projects/bind9!7803

3 years agoCorrect value of DNS_NAME_MAXLABELS
Tony Finch [Wed, 5 Apr 2023 12:42:52 +0000 (13:42 +0100)] 
Correct value of DNS_NAME_MAXLABELS

It should be floor(DNS_NAME_MAXWIRE / 2) + 1 == 128

The mistake was introduced in c6bf51492dbd because:

  * I was refactoring an existing `DNS_MAX_LABELS` defined as 127

  * There was a longstanding bug in `dns_name_isvalid()` which
    checked the number of labels against 127U instead of 128

  * I mistakenly thought `dns_name_isvalid()` was correct and
    `dns_name_countlabels()` was incorrect, but the reverse was true.

After this commit, occurrances of `DNS_NAME_MAXLABELS` with value
128 are consistent with the use of 127 or 128 before commit
c6bf51492dbd except for the mistake in `dns_name_isvalid()`.
This commit adds a test case that checks the MAXLABELS case
in `dns_name_fromtext()` and `dns_name_isvalid()`.

3 years agoMerge branch 'pspacek/log-roll-doc-nits' into 'main'
Petr Špaček [Wed, 5 Apr 2023 14:02:47 +0000 (14:02 +0000)] 
Merge branch 'pspacek/log-roll-doc-nits' into 'main'

Log rotation doc improvements

See merge request isc-projects/bind9!7776

3 years agoRemove erroneous cross-references to suffix statement
Petr Špaček [Mon, 3 Apr 2023 14:34:19 +0000 (16:34 +0200)] 
Remove erroneous cross-references to suffix statement

Logging section referenced to "suffix" statement definition for dns64.

3 years agoMake rndc dnstap -roll docs easier to read
Petr Špaček [Mon, 3 Apr 2023 14:18:06 +0000 (16:18 +0200)] 
Make rndc dnstap -roll docs easier to read

3 years agoMerge branch 'fanf-qp-zt' into 'main'
Tony Finch [Wed, 5 Apr 2023 12:02:38 +0000 (12:02 +0000)] 
Merge branch 'fanf-qp-zt' into 'main'

Use a qp-trie for the zone table

See merge request isc-projects/bind9!7582

3 years agoUse a qp-trie for the zone table
Tony Finch [Tue, 14 Feb 2023 16:13:16 +0000 (16:13 +0000)] 
Use a qp-trie for the zone table

This change makes the zone table lock-free for reads. Previously, the
zone table used a red-black tree, which is not thread safe, so the hot
read path acquired both the per-view mutex and the per-zonetable
rwlock. (The double locking was to fix to cleanup races on shutdown.)

One visible difference is that zones are not necessarily shut down
promptly: it depends on when the qp-trie garbage collector cleans up
the zone table. The `catz` system test checks several times that zones
have been deleted; the test now checks for zones to be removed from
the server configuration, instead of being fully shut down. The catz
test does not churn through enough zones to trigger a gc, so the zones
are not fully detached until the server exits.

After this change, it is still possible to improve the way we handle
changes to the zone table, for instance, batching changes, or better
compaction heuristics.

3 years agoA few qp-trie cleanups
Tony Finch [Fri, 10 Mar 2023 15:55:00 +0000 (15:55 +0000)] 
A few qp-trie cleanups

Revert refcount debug tracing (commit a8b29f0365), there are better
ways to do it.

Use the dns_qpmethods_t typedef where appropriate.

Some stylistic improvements.

3 years agoCompact more in dns_qp_compact(DNS_QPGC_ALL)
Tony Finch [Fri, 3 Mar 2023 12:05:51 +0000 (12:05 +0000)] 
Compact more in dns_qp_compact(DNS_QPGC_ALL)

Commit 0858514ae8 enriched dns_qp_compact() to give callers more
control over how thoroughly the trie should be compacted.

In the DNS_QPGC_ALL case, if the trie is small it might be compacted
to a new position in the same memory chunk. In this situation it will
still be holding references to old leaf objects which have been
removed from the trie but will not be completely detached until the
chunk containing the references is freed.

This change resets the qp-trie allocator to a fresh chunk before a
DNS_QPGC_ALL compaction, so all the old memory chunks will be
evacuated and old leaf objects can be detached sooner.

3 years agoSupport for off-loop read-ony qp-trie transactions
Tony Finch [Thu, 2 Mar 2023 13:30:24 +0000 (13:30 +0000)] 
Support for off-loop read-ony qp-trie transactions

It is sometimes necessary to access a qp-trie outside an isc_loop,
such as in tests or an isc_work callback. The best option was to use
a `dns_qpmulti_write()` transaction, but that has overheads that are
not necessary for read-only access, such as committing a new version
of the trie even when nothing changed.

So this commit adds a `dns_qpmulti_read()` transaction, which is
nearly as lightweight as a query transaction, but it takes the mutex
like a write transaction.

3 years agoSupport for finding the longest parent domain in a qp-trie
Tony Finch [Fri, 10 Feb 2023 16:53:31 +0000 (16:53 +0000)] 
Support for finding the longest parent domain in a qp-trie

This is the first of the "fancy" searches that know how the DNS
namespace maps on to the structure of a qp-trie. For example, it will
find the closest enclosing zone in the zone tree.

3 years agoSupport for iterating over the leaves in a qp-trie
Tony Finch [Thu, 9 Feb 2023 14:37:43 +0000 (14:37 +0000)] 
Support for iterating over the leaves in a qp-trie

The iterator object records a path through the trie, in a similar
manner to the existing dns_rbtnodechain.

3 years agoMerge branch '3993-gcc-12-fanalyzer-claim-dereference-of-NULL' into 'main'
Arаm Sаrgsyаn [Wed, 5 Apr 2023 08:04:05 +0000 (08:04 +0000)] 
Merge branch '3993-gcc-12-fanalyzer-claim-dereference-of-NULL' into 'main'

Resolve "GCC 12 static analyzer: error: dereference of NULL 'alginfo' in openssleddsa_link.c"

Closes #3993

See merge request isc-projects/bind9!7791

3 years agoINSIST that openssleddsa_alg_info() is successful
Aram Sargsyan [Tue, 4 Apr 2023 12:34:35 +0000 (12:34 +0000)] 
INSIST that openssleddsa_alg_info() is successful

In the check_algorithm() function openssleddsa_alg_info() is
called with two known variants of the 'algorithm' argument, and
both are expected to return a non-NULL value.

Add an INSIST to suppress the following GCC 12 analyzer report:

    openssleddsa_link.c: In function 'raw_key_to_ossl':
    openssleddsa_link.c:92:13: error: dereference of NULL 'alginfo' [CWE-476] [-Werror=analyzer-null-dereference]
       92 |         int pkey_type = alginfo->pkey_type;
          |             ^~~~~~~~~

3 years agoMerge branch '3973-dnsrps-coverity-fixes' into 'main'
Ondřej Surý [Wed, 5 Apr 2023 07:24:44 +0000 (07:24 +0000)] 
Merge branch '3973-dnsrps-coverity-fixes' into 'main'

silence coverity warnings

Closes #3973

See merge request isc-projects/bind9!7781

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]