]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
3 years agoCheck removal of ENT when subdomains are removed
Mark Andrews [Fri, 21 Apr 2023 03:49:32 +0000 (13:49 +1000)] 
Check removal of ENT when subdomains are removed

Empty-non-terminal NSEC records where not always removed when the
delegations generating them where removed via update. Check that
they now are.

3 years agoCleanup orphaned empty-non-terminal NSEC3
Mark Andrews [Fri, 21 Apr 2023 02:11:15 +0000 (12:11 +1000)] 
Cleanup orphaned empty-non-terminal NSEC3

When OPTOUT was in use we didn't ensure that NSEC3 records
for orphaned empty-non-terminals where removed.  Check if
there are orphaned empty-non-terminal NSEC3 even if there
wasn't an NSEC3 RRset to be removed in dns_nsec3_delnsec3.

3 years agoMerge branch 'jpmens-main-patch-10650' into 'main'
Ondřej Surý [Mon, 24 Apr 2023 15:12:12 +0000 (15:12 +0000)] 
Merge branch 'jpmens-main-patch-10650' into 'main'

ARM: replace word in TLS section

See merge request isc-projects/bind9!7864

3 years agoFix typo in the ARM - missed -> missing
JP Mens [Sat, 22 Apr 2023 17:46:20 +0000 (17:46 +0000)] 
Fix typo in the ARM - missed -> missing

3 years agoMerge branch '4004-reimplemented-max-transfer--in' into 'main'
Ondřej Surý [Fri, 21 Apr 2023 11:31:04 +0000 (11:31 +0000)] 
Merge branch '4004-reimplemented-max-transfer--in' into 'main'

Implement maximum global and idle time for incoming XFR

Closes #4004

See merge request isc-projects/bind9!7810

3 years agoAdd CHANGES note for [GL #4004]
Ondřej Surý [Wed, 5 Apr 2023 21:07:44 +0000 (23:07 +0200)] 
Add CHANGES note for [GL #4004]

3 years agoImplement new checks for the xfer system test
Aram Sargsyan [Mon, 17 Apr 2023 12:22:49 +0000 (12:22 +0000)] 
Implement new checks for the xfer system test

Check the max-transfer-time-in and max-transfer-idle-in options.

3 years agoImplement new -T options for xfer system tests
Aram Sargsyan [Mon, 17 Apr 2023 12:22:38 +0000 (12:22 +0000)] 
Implement new -T options for xfer system tests

'-T transferinsecs' makes named interpret the max-transfer-time-out,
max-transfer-idle-out, max-transfer-time-in and max-transfer-idle-in
configuration options as seconds instead of minutes.

'-T transferslowly' makes named to sleep for one second for every
xfrout message.

'-T transferstuck' makes named to sleep for one minute for every
xfrout message.

3 years agoImplement maximum global and idle time for incoming XFR
Ondřej Surý [Wed, 5 Apr 2023 20:35:00 +0000 (22:35 +0200)] 
Implement maximum global and idle time for incoming XFR

After the dns_xfrin was changed to use network manager, the maximum
global (max-transfer-time-in) and idle (max-transfer-idle-in) times for
incoming transfers were turned inoperational because of missing
implementation.

Restore this functionality by implementing the timers for the incoming
transfers.

3 years agoMerge branch '4005-handle-ISC_R_INVALIDPROTO-from-libuv' into 'main'
Ondřej Surý [Fri, 21 Apr 2023 10:43:14 +0000 (10:43 +0000)] 
Merge branch '4005-handle-ISC_R_INVALIDPROTO-from-libuv' into 'main'

Handle ISC_R_INVALIDPROTO in the dispatch

Closes #4005

See merge request isc-projects/bind9!7860

3 years agoAdd CHANGES and release note for [GL #4005]
Ondřej Surý [Fri, 21 Apr 2023 08:16:44 +0000 (10:16 +0200)] 
Add CHANGES and release note for [GL #4005]

3 years agocheck for invalid protocol when dispatch fails
Evan Hunt [Wed, 5 Apr 2023 21:05:46 +0000 (14:05 -0700)] 
check for invalid protocol when dispatch fails

treat ISC_R_INVALIDPROTO as a networking error when it occurs.

3 years agoadd a result code for ENOPROTOOPT, EPROTONOSUPPORT
Evan Hunt [Wed, 5 Apr 2023 21:05:46 +0000 (14:05 -0700)] 
add a result code for ENOPROTOOPT, EPROTONOSUPPORT

there was no isc_result_t value for invalid protocol errors
that could be returned from libuv.

3 years agoMerge branch '3977-add-isc_spinlock-implementation' into 'main'
Ondřej Surý [Fri, 21 Apr 2023 10:10:47 +0000 (10:10 +0000)] 
Merge branch '3977-add-isc_spinlock-implementation' into 'main'

Add isc_spinlock unit with shim pthread_spin implementation

Closes #3977

See merge request isc-projects/bind9!7749

3 years agoAdd CHANGES note for [GL #3977]
Ondřej Surý [Thu, 30 Mar 2023 08:44:21 +0000 (10:44 +0200)] 
Add CHANGES note for [GL #3977]

3 years agoAdd isc_spinlock unit with shim pthread_spin implementation
Ondřej Surý [Fri, 3 Mar 2023 08:24:13 +0000 (09:24 +0100)] 
Add isc_spinlock unit with shim pthread_spin implementation

The spinlock is small (atomic_uint_fast32_t at most), lightweight
synchronization primitive and should only be used for short-lived and
most of the time a isc_mutex should be used.

Add a isc_spinlock unit which is either (most of the time) a think
wrapper around pthread_spin API or an efficient shim implementation of
the simple spinlock.

3 years agoAlways initialize the workers in the libtest
Ondřej Surý [Thu, 30 Mar 2023 07:14:21 +0000 (09:14 +0200)] 
Always initialize the workers in the libtest

The workers variable might be needed even to tests not using
loopmgr. Split the workers initialization into setup_workers() function
and always call it from the default main loop.

3 years agoMerge branch '4011-fix-read_stop-in-streaming-protocols' into 'main'
Ondřej Surý [Thu, 20 Apr 2023 12:03:52 +0000 (12:03 +0000)] 
Merge branch '4011-fix-read_stop-in-streaming-protocols' into 'main'

Fix the streaming read callback shutdown logic

Closes #4011

See merge request isc-projects/bind9!7836

3 years agoAdd CHANGES note for [GL #4011]
Ondřej Surý [Fri, 14 Apr 2023 03:43:32 +0000 (05:43 +0200)] 
Add CHANGES note for [GL #4011]

3 years agoFix the streaming read callback shutdown logic
Ondřej Surý [Thu, 13 Apr 2023 15:27:50 +0000 (17:27 +0200)] 
Fix the streaming read callback shutdown logic

When shutting down TCP sockets, the read callback calling logic was
flawed, it would call either one less callback or one extra.  Fix the
logic in the way:

1. When isc_nm_read() has been called but isc_nm_read_stop() hasn't on
   the handle, the read callback will be called with ISC_R_CANCELED to
   cancel active reading from the socket/handle.

2. When isc_nm_read() has been called and isc_nm_read_stop() has been
   called on the on the handle, the read callback will be called with
   ISC_R_SHUTTINGDOWN to signal that the dormant (not-reading) socket
   is being shut down.

3. The .reading and .recv_read flags are little bit tricky.  The
   .reading flag indicates if the outer layer is reading the data (that
   would be uv_tcp_t for TCP and isc_nmsocket_t (TCP) for TLSStream),
   the .recv_read flag indicates whether somebody is interested in the
   data read from the socket.

   Usually, you would expect that the .reading should be false when
   .recv_read is false, but it gets even more tricky with TLSStream as
   the TLS protocol might need to read from the socket even when sending
   data.

   Fix the usage of the .recv_read and .reading flags in the TLSStream
   to their true meaning - which mostly consist of using .recv_read
   everywhere and then wrapping isc_nm_read() and isc_nm_read_stop()
   with the .reading flag.

4. The TLS failed read helper has been modified to resemble the TCP code
   as much as possible, clearing and re-setting the .recv_read flag in
   the TCP timeout code has been fixed and .recv_read is now cleared
   when isc_nm_read_stop() has been called on the streaming socket.

5. The use of Network Manager in the named_controlconf, isccc_ccmsg, and
   isc_httpd units have been greatly simplified due to the improved design.

6. More unit tests for TCP and TLS testing the shutdown conditions have
   been added.

Co-authored-by: Ondřej Surý <ondrej@isc.org>
Co-authored-by: Artem Boldariev <artem@isc.org>
3 years agoMerge tag 'v9.19.12'
Michał Kępień [Thu, 20 Apr 2023 10:43:46 +0000 (12:43 +0200)] 
Merge tag 'v9.19.12'

BIND 9.19.12

3 years agoMerge branch '3986-handle-ISC_R_NOPERM-in-dns_dispatch-and-honour-the-source-port...
Ondřej Surý [Thu, 20 Apr 2023 09:01:49 +0000 (09:01 +0000)] 
Merge branch '3986-handle-ISC_R_NOPERM-in-dns_dispatch-and-honour-the-source-port' into 'main'

Honour the source-port when retrying in dns_dispatch

Closes #3986

See merge request isc-projects/bind9!7806

3 years agoAdd CHANGES note for [GL #3986]
Ondřej Surý [Wed, 5 Apr 2023 13:42:05 +0000 (15:42 +0200)] 
Add CHANGES note for [GL #3986]

3 years agoHonour the source-port when retrying in dns_dispatch
Ondřej Surý [Wed, 5 Apr 2023 13:28:32 +0000 (15:28 +0200)] 
Honour the source-port when retrying in dns_dispatch

When retrying in the DNS dispatch, the local port would be forgotten on
ISC_R_ADDRINUSE, keep the configured source-port even when retrying.

Additionally, treat ISC_R_NOPERM same as ISC_R_ADDRINUSE.

Closes: #3986
3 years agoMerge branch '4001-4002-retry-over-TCP-when-notify-sending-fails' into 'main'
Ondřej Surý [Thu, 20 Apr 2023 08:41:02 +0000 (08:41 +0000)] 
Merge branch '4001-4002-retry-over-TCP-when-notify-sending-fails' into 'main'

Handle the failure to send notify more gracefully and with log

Closes #4001 and #4002

See merge request isc-projects/bind9!7805

3 years agoAdd CHANGES and release note for [GL #4001] [GL #4002]
Ondřej Surý [Wed, 5 Apr 2023 13:37:07 +0000 (15:37 +0200)] 
Add CHANGES and release note for [GL #4001] [GL #4002]

3 years agoHandle the failure to send notify more gracefully and with log
Ondřej Surý [Wed, 5 Apr 2023 13:24:21 +0000 (15:24 +0200)] 
Handle the failure to send notify more gracefully and with log

When dns_request_create() failed in notify_send_toaddr(), sending the
notify would silently fail.  When notify_done() failed, the error would
be logged on the DEBUG(2) level.

This commit remedies the situation by:

 * Promoting several messages related to notifies to INFO level and add
   a "success" log message at the INFO level

 * Adding a TCP fallback - when sending the notify over UDP fails, named
   will retry sending notify over TCP and log the information on the
   NOTICE level

 * When sending the notify over TCP fails, it will be logged on the
   WARNING level

Closes: #4001, #4002
3 years agoMerge branch '3998-check-countlabels' into 'main'
Tony Finch [Tue, 18 Apr 2023 12:58:09 +0000 (12:58 +0000)] 
Merge branch '3998-check-countlabels' into 'main'

Check dns_name_countlabels() wrt DNS_NAME_MAXLABELS

Closes #3998

See merge request isc-projects/bind9!7822

3 years agoCheck dns_name_countlabels() wrt DNS_NAME_MAXLABELS
Tony Finch [Thu, 6 Apr 2023 17:22:51 +0000 (18:22 +0100)] 
Check dns_name_countlabels() wrt DNS_NAME_MAXLABELS

This test case was omitted from [GL !7803]

3 years agoMerge branch 'fanf-inane' into 'main'
Tony Finch [Tue, 18 Apr 2023 12:22:55 +0000 (12:22 +0000)] 
Merge branch 'fanf-inane' into 'main'

Fix several typoes in name_test

See merge request isc-projects/bind9!7800

3 years agoFix several typos in name_test
Tony Finch [Wed, 5 Apr 2023 11:56:02 +0000 (12:56 +0100)] 
Fix several typos in name_test

`nane` -> `name`

3 years agoMerge branch 'aram/xfer-test-bugfix' into 'main'
Arаm Sаrgsyаn [Tue, 18 Apr 2023 09:38:12 +0000 (09:38 +0000)] 
Merge branch 'aram/xfer-test-bugfix' into 'main'

Fix variable name error in the xfer system test

See merge request isc-projects/bind9!7845

3 years agoFix variable name error in the xfer system test
Aram Sargsyan [Mon, 17 Apr 2023 15:56:37 +0000 (15:56 +0000)] 
Fix variable name error in the xfer system test

There is no 'ret' in this test, and it is obvious that 'ret=1'
should be 'tmp=1' for the check to work correctly, if the string
is not found in the log file.

3 years agoMerge branch '3996-in-fatal-only-pause-when-running' into 'main'
Mark Andrews [Tue, 18 Apr 2023 01:11:49 +0000 (01:11 +0000)] 
Merge branch '3996-in-fatal-only-pause-when-running' into 'main'

In fatal only pause loops when they are running.

Closes #3996

See merge request isc-projects/bind9!7825

3 years agoisc_loopmgr_pause was called inappropriately
Mark Andrews [Tue, 11 Apr 2023 05:32:51 +0000 (15:32 +1000)] 
isc_loopmgr_pause was called inappropriately

isc_loopmgr_pause can't be called before isc_loopmgr_run is
called as the thread ids are not yet valid.  If there is a
fatal error before isc_loopmgr_run is run then don't call
isc_loopmgr_pause.

3 years agoMerge branch '3769-migrate-zsk-ksk-split-tocsk' into 'main'
Matthijs Mekking [Mon, 17 Apr 2023 09:39:59 +0000 (09:39 +0000)] 
Merge branch '3769-migrate-zsk-ksk-split-tocsk' into 'main'

kasp: Add test case for migrating KSK/ZSK to CSK

See merge request isc-projects/bind9!7306

3 years agoAdd key state init debugging
Matthijs Mekking [Fri, 6 Jan 2023 11:39:10 +0000 (12:39 +0100)] 
Add key state init debugging

When debugging an issue it can be useful to see what BIND initially
set the key states to.

3 years agokasp: Add test case for migrating KSK/ZSK to CSK
Matthijs Mekking [Fri, 6 Jan 2023 11:36:23 +0000 (12:36 +0100)] 
kasp: Add test case for migrating KSK/ZSK to CSK

Add a test case to cover #3679 where a user migrates from a KSK/ZSK
split using auto-dnssec maintain, to the default dnssec-policy (CSK).

The test actually does not use the default dnssec-policy, but it does
use one that has the same keys clause. For testing convenience, we use
the same propagation time values as other test cases that migrate to
dnssec-policy with mismatching existing key set.

3 years agoMerge branch '4015-fix-forward_cancel-from-the-wrong-loop' into 'main'
Ondřej Surý [Fri, 14 Apr 2023 15:13:03 +0000 (15:13 +0000)] 
Merge branch '4015-fix-forward_cancel-from-the-wrong-loop' into 'main'

Run the forward_cancel on the appropriate zone->loop

Closes #4015

See merge request isc-projects/bind9!7835

3 years agoAdd CHANGES note for [GL #4015]
Ondřej Surý [Fri, 14 Apr 2023 04:12:54 +0000 (06:12 +0200)] 
Add CHANGES note for [GL #4015]

3 years agoRun the forward_cancel on the appropriate zone->loop
Ondřej Surý [Fri, 14 Apr 2023 03:43:53 +0000 (05:43 +0200)] 
Run the forward_cancel on the appropriate zone->loop

If the zone forwards are canceled from dns_zonemgr_shutdown(), the
forward_cancel() would get called from the main loop, which is wrong.
It needs to be called from the matching zone->loop.

Run the dns_request_cancel() via isc_async_run() on the loop associated
with the zone instead of calling the dns_request_cancel() directly from
the main loop.

3 years agoMerge branch 'ondrej/remove-unused-netmgr-worker-sendbuf' into 'main'
Ondřej Surý [Fri, 14 Apr 2023 14:20:52 +0000 (14:20 +0000)] 
Merge branch 'ondrej/remove-unused-netmgr-worker-sendbuf' into 'main'

Remove unused netmgr->worker->sendbuf

See merge request isc-projects/bind9!7841

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.