]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
3 years agoCleanup the dead nodes when pruning the tree
Ondřej Surý [Wed, 2 Nov 2022 12:04:56 +0000 (13:04 +0100)] 
Cleanup the dead nodes when pruning the tree

While sending the node to prune_tree(), we can also cleanup dead nodes
because we already hold the tree and node bucket write locks.

3 years agoMerge branch 'ondrej-rework-pthread-rwlock-3' into 'main'
Ondřej Surý [Wed, 2 Nov 2022 09:56:33 +0000 (09:56 +0000)] 
Merge branch 'ondrej-rework-pthread-rwlock-3' into 'main'

Make the pthread_rwlock implementation header-only macros [3/3]

See merge request isc-projects/bind9!6909

3 years agoMake the pthread_rwlock implementation header-only macros [2/2]
Ondřej Surý [Fri, 14 Oct 2022 10:54:57 +0000 (12:54 +0200)] 
Make the pthread_rwlock implementation header-only macros [2/2]

While using mutrace, the phtread-rwlock based isc_rwlock implementation
would be all tracked in the rwlock.c unit losing all useful information
as all rwlocks would be traced in a single place.  Rewrite the
pthread_rwlock based implementation to be header-only macros, so we can
use mutrace to properly track the rwlock contention without heavily
patching mutrace to understand the libisc synchronization primitives.

3 years agoRemove one level of indirection from isc_rwlock [1/2]
Ondřej Surý [Fri, 14 Oct 2022 10:03:02 +0000 (12:03 +0200)] 
Remove one level of indirection from isc_rwlock [1/2]

Instead of checking the PTHREAD_RUNTIME_CHECK from the header, move it
to the pthread_rwlock implementation functions.  The internal isc_rwlock
actually cannot fail, so the checks in the header was useless anyway.

3 years agoMerge branch 'ondrej-rework-pthread-rwlock-2' into 'main'
Ondřej Surý [Wed, 2 Nov 2022 08:52:27 +0000 (08:52 +0000)] 
Merge branch 'ondrej-rework-pthread-rwlock-2' into 'main'

Remove isc_rwlock_downgrade() from isc_rwlock [2/3]

See merge request isc-projects/bind9!6908

3 years agoMerge branch 'ondrej-rework-pthread-rwlock-1' into 'main'
Ondřej Surý [Wed, 2 Nov 2022 08:05:38 +0000 (08:05 +0000)] 
Merge branch 'ondrej-rework-pthread-rwlock-1' into 'main'

Remove isc_rwlock_downgrade usage in rbtdb.c [1/3]

See merge request isc-projects/bind9!6907

3 years agoRemove isc_rwlock_downgrade() from isc_rwlock
Ondřej Surý [Fri, 14 Oct 2022 09:42:31 +0000 (11:42 +0200)] 
Remove isc_rwlock_downgrade() from isc_rwlock

The isc_rwlock_downgrade() is not used anywhere, so we can remove it and
make the pthread_rwlock implementation simpler.

3 years agoAdd strong rwlock consistency checks to dns_rbtdb
Ondřej Surý [Fri, 14 Oct 2022 12:35:44 +0000 (14:35 +0200)] 
Add strong rwlock consistency checks to dns_rbtdb

The dns_rbtdb unit already tracks the state of the node and tree rwlocks
during the top level function and passes the states of the locks to the
called functions.

Add the tree locking family of macros modeled after node locking macros,
and expand both to track the state of the lock in an external variable.
Additionally, in developer mode, add precondition to the macros, so the
lock is in required state - this should cause an assertion failure on
double locking instead of the thread getting stuck.

3 years agoRemove isc_rwlock_downgrade usage in rbtdb.c
Ondřej Surý [Thu, 13 Oct 2022 19:10:04 +0000 (21:10 +0200)] 
Remove isc_rwlock_downgrade usage in rbtdb.c

The only place where isc_rwlock_downgrade was being used was the
decrement_reference() where the code tries either relocks the node
rwlock to write and then tries to upgrade the tree lock.  When returning
from the function it tries to restore the locks into a previous state
which is nice, but kind of moot, because at every use of
decrement_reference() the node locks is immediately or almost
immeditately unlocked, and same holds for the tree lock.

Instead of trying to restore the node and tree lock into the initial
state, the decrement_reference now returns the state of the locks, so
the caller can then use the right unlock operation (read or write).
Only when the tree lock was originally unlocked, the decrement_reference
unlocks the tree lock before returning to the caller.

3 years agoMerge branch '3583-make-libcap-mandatory-on-linux' into 'main'
Ondřej Surý [Tue, 1 Nov 2022 14:32:34 +0000 (14:32 +0000)] 
Merge branch '3583-make-libcap-mandatory-on-linux' into 'main'

Refactor the privilege dropping

Closes #3583

See merge request isc-projects/bind9!6873

3 years agoAdd CHANGES and release note for [GL #3583]
Ondřej Surý [Thu, 6 Oct 2022 12:34:24 +0000 (14:34 +0200)] 
Add CHANGES and release note for [GL #3583]

3 years agoRefactor the privilege dropping
Ondřej Surý [Thu, 6 Oct 2022 12:22:20 +0000 (14:22 +0200)] 
Refactor the privilege dropping

On Linux, the libcap is now mandatory.  It makes things simpler for us.

System without {set,get}res{uid,gid} now have compatibility shim using
setreuid/setregid or seteuid/setegid to setup effective UID/GID, so the
same code can be called all the time (including on Linux).

3 years agoMerge branch 'artem-fix-tlsdns-tcpdns-unit-tests-connect-func-passing' into 'main'
Artem Boldariev [Tue, 1 Nov 2022 13:24:23 +0000 (13:24 +0000)] 
Merge branch 'artem-fix-tlsdns-tcpdns-unit-tests-connect-func-passing' into 'main'

Fix TCP and TLS DNS tests: properly pass connection callback

See merge request isc-projects/bind9!6986

3 years agoTLS DNS unit tests: do not share the port with TCP DNS tests
Artem Boldariev [Wed, 26 Oct 2022 12:41:30 +0000 (15:41 +0300)] 
TLS DNS unit tests: do not share the port with TCP DNS tests

TLS DNS unit tests were sharing the port with TCP DNS tests by
mistake. That could have caused conflicts between the two, when
running the unit tests in parallel. This commit fixes that.

3 years agoTCP and TLS DNS tests: properly pass connection callback
Artem Boldariev [Wed, 26 Oct 2022 12:17:54 +0000 (15:17 +0300)] 
TCP and TLS DNS tests: properly pass connection callback

After the loop manager refactoring TCP DNS and TLS DNS unit tests
ended up broken.

The problem is that in these unit tests the code is written in such a
way that for establishing a new connection tcpdns_connect() and
tlsdns_connect() functions are used. However, in these tests as a
connection callback function connect_connect_cb() is used. The
function logic is responsible for determining the function for
establishing subsequent connection.

To do so, it called get_stream_connect_function() ... which can return
only tcp_connect() or tls_connect(), not tcpdns_connect() or
tlsdns_connect(). That is definitely *not* what was implied.

All this time the unit tests were testing something, but now what was
intended.

This commit fixes the problem by passing the tcpdns_connect() and
tlsdns_connect() function pointers to connect_connect_cb().

3 years agoMerge branch '3583-bind-to-interfaces-early' into 'main'
Ondřej Surý [Tue, 1 Nov 2022 10:50:33 +0000 (10:50 +0000)] 
Merge branch '3583-bind-to-interfaces-early' into 'main'

Rescan interfaces before dropping privileges

Closes #3583

See merge request isc-projects/bind9!6875

3 years agoAdd CHANGES note for [GL #3583]
Ondřej Surý [Thu, 6 Oct 2022 16:06:05 +0000 (18:06 +0200)] 
Add CHANGES note for [GL #3583]

3 years agoRescan interfaces before dropping privileges
Ondřej Surý [Thu, 6 Oct 2022 16:00:06 +0000 (18:00 +0200)] 
Rescan interfaces before dropping privileges

The ns_interfacemgr_scan() now requires the loopmgr to be running, so we
need to end exclusive mode for the rescan and then begin it again.

This is relatively safe operation (because the scan happens on the timer
anyway), but we need to ensure that we won't load the configuration from
different threads.  This is already the case because the initial load
happens on the main thread and the control channel also listens just on
the main loop.

3 years agoMerge branch '2895-named-can-create-unrecoverable-managed-keys' into 'main'
Arаm Sаrgsyаn [Tue, 1 Nov 2022 10:48:18 +0000 (10:48 +0000)] 
Merge branch '2895-named-can-create-unrecoverable-managed-keys' into 'main'

Don't trust a placeholder KEYDATA record

Closes #2895

See merge request isc-projects/bind9!7003

3 years agoAdd CHANGES and release notes for [GL #2895]
Aram Sargsyan [Mon, 31 Oct 2022 13:03:47 +0000 (13:03 +0000)] 
Add CHANGES and release notes for [GL #2895]

3 years agoDon't trust a placeholder KEYDATA record
Aram Sargsyan [Mon, 31 Oct 2022 12:49:05 +0000 (12:49 +0000)] 
Don't trust a placeholder KEYDATA record

When named starts it creates an empty KEYDATA record in the managed-keys
zone as a placeholder, then schedules a key refresh. If key refresh
fails for some reason (e.g. connectivity problems), named will load the
placeholder key into secroots as a trusted key during the next startup,
which will break the chain of trust, and named will never recover from
that state until managed-keys.bind and managed-keys.bind.jnl files are
manually deleted before (re)starting named again.

Before calling load_secroots(), check that we are not dealing with a
placeholder.

3 years agoTest managed-keys placeholder
Aram Sargsyan [Mon, 31 Oct 2022 12:48:57 +0000 (12:48 +0000)] 
Test managed-keys placeholder

Add a dnssec test to make sure that named can correctly process a
managed-keys zone with a placeholder KEYDATA record.

3 years agoMerge branch '3617-keyfetch-race' into 'main'
Evan Hunt [Tue, 1 Nov 2022 06:28:04 +0000 (06:28 +0000)] 
Merge branch '3617-keyfetch-race' into 'main'

call dns_resolver_createfetch() asynchronously in zone_refreshkeys()

Closes #3617

See merge request isc-projects/bind9!6971

3 years agoCHANGES for [GL #3617]
Evan Hunt [Mon, 31 Oct 2022 21:40:40 +0000 (14:40 -0700)] 
CHANGES for [GL #3617]

3 years agoCall dns_resolver_createfetch() asynchronously in zone_refreshkeys()
Evan Hunt [Sun, 23 Oct 2022 18:39:44 +0000 (11:39 -0700)] 
Call dns_resolver_createfetch() asynchronously in zone_refreshkeys()

Because dns_resolver_createfetch() locks the view, it was necessary
to unlock the zone in zone_refreshkeys() before calling it in order
to maintain the lock order, and relock afterward. this permitted a race
with dns_zone_synckeyzone().

This commit moves the call to dns_resolver_createfetch() into a separate
function which is called asynchronously after the zone has been
unlocked.

The keyfetch object now attaches to the zone to ensure that
it won't be shut down before the asynchronous call completes.

This necessitated refactoring dns_zone_detach() so it always runs
unlocked. For managed zones it now schedules zone_shutdown() to
run asynchronously, and for unmanaged zones, it requires the last
dns_zone_detach() to be run without loopmgr running.

3 years agoMerge branch '3634-dont-enforce-jemalloc-on-NetBSD' into 'main'
Ondřej Surý [Mon, 31 Oct 2022 15:14:37 +0000 (15:14 +0000)] 
Merge branch '3634-dont-enforce-jemalloc-on-NetBSD' into 'main'

Don't enforce jemalloc on NetBSD

Closes #3634

See merge request isc-projects/bind9!7004

3 years agoAdd CHANGES note for [GL #3634]
Ondřej Surý [Mon, 31 Oct 2022 14:48:08 +0000 (14:48 +0000)] 
Add CHANGES note for [GL #3634]

3 years agoDon't enforce jemalloc on NetBSD
Ondřej Surý [Mon, 31 Oct 2022 14:46:30 +0000 (14:46 +0000)] 
Don't enforce jemalloc on NetBSD

The NetBSD system allocator is in fact based on the jemalloc, but it
doesn't export the extended interface, so we can't use that.  Remove
the jemalloc enforcement for the NetBSD.

3 years agoMerge branch '3632-async-backwards' into 'main'
Evan Hunt [Mon, 31 Oct 2022 13:24:38 +0000 (13:24 +0000)] 
Merge branch '3632-async-backwards' into 'main'

isc_async_run() runs events in reverse order

Closes #3632

See merge request isc-projects/bind9!7000

3 years agoisc_async_run() runs events in reverse order
Evan Hunt [Sun, 30 Oct 2022 01:05:39 +0000 (18:05 -0700)] 
isc_async_run() runs events in reverse order

when more than one event was scheduled in the isc_aysnc queue,
they were executed in reverse order. we need to pull events
off the back of queue instead the front, so that uv_loop will
run them in the right order.

note that isc_job_run() has the same behavior, because it calls
uv_idle_start() directly. in that case we just document it so
it'll be less surprising in the future.

3 years agoMerge branch 'each-fix-fuzz' into 'main'
Evan Hunt [Mon, 31 Oct 2022 11:28:38 +0000 (11:28 +0000)] 
Merge branch 'each-fix-fuzz' into 'main'

fix build error in fuzz tests

See merge request isc-projects/bind9!6997

3 years agofix build error in fuzz tests
Evan Hunt [Mon, 31 Oct 2022 05:40:44 +0000 (22:40 -0700)] 
fix build error in fuzz tests

a missing include file caused dns_message_checksig.c to fail
to build on some platforms. this has been fixed.

3 years agoMerge branch 'each-dupsigs-test' into 'main'
Evan Hunt [Mon, 31 Oct 2022 11:23:41 +0000 (11:23 +0000)] 
Merge branch 'each-dupsigs-test' into 'main'

make dupsigs test less timing-sensitive

See merge request isc-projects/bind9!6998

3 years agomake dupsigs test less timing-sensitive
Evan Hunt [Sun, 30 Oct 2022 08:19:35 +0000 (01:19 -0700)] 
make dupsigs test less timing-sensitive

the dupsigs test is prone to failing on slow CI machines
because the first test can occur before the zone is fully
signed.

instead of just waiting ten seconds arbitrarily, we now
check every second, and allow up to 30 seconds before giving
up.

3 years agoMerge branch '3628-cleanup-task-from-dns_masterdump' into 'main'
Ondřej Surý [Mon, 31 Oct 2022 10:30:49 +0000 (10:30 +0000)] 
Merge branch '3628-cleanup-task-from-dns_masterdump' into 'main'

Refactor zone loading and dumping to use offloaded work

Closes #3628

See merge request isc-projects/bind9!6990

3 years agoAdd CHANGES note for [GL #3628]
Ondřej Surý [Mon, 31 Oct 2022 10:19:36 +0000 (10:19 +0000)] 
Add CHANGES note for [GL #3628]

3 years agoRefactor dns_master_dump*async() to use offloaded work
Ondřej Surý [Wed, 26 Oct 2022 18:01:29 +0000 (20:01 +0200)] 
Refactor dns_master_dump*async() to use offloaded work

The dns_master_dump*async() functions were using isc_async_run() to
schedule work on the active loop; use isc_work_enqueue() instead.

3 years agorefactor dns_master_dump*async() to use loop callbacks
Evan Hunt [Wed, 26 Oct 2022 18:12:36 +0000 (11:12 -0700)] 
refactor dns_master_dump*async() to use loop callbacks

Asynchronous zone dumping now uses loop callbacks instead of
task events.

3 years agoMerge branch '3631-fix-zone-maintenance-race' into 'main'
Evan Hunt [Mon, 31 Oct 2022 10:24:24 +0000 (10:24 +0000)] 
Merge branch '3631-fix-zone-maintenance-race' into 'main'

fix a potential data race in zone_maintenance()

Closes #3631

See merge request isc-projects/bind9!6999

3 years agofix a potential data race in zone_maintenance()
Evan Hunt [Mon, 31 Oct 2022 06:48:14 +0000 (23:48 -0700)] 
fix a potential data race in zone_maintenance()

zone_maintenance() accessed zone timer information without locking.

3 years agoMerge branch '3625-run-zone-loading-as-offloaded-task' into 'main'
Ondřej Surý [Mon, 31 Oct 2022 06:24:23 +0000 (06:24 +0000)] 
Merge branch '3625-run-zone-loading-as-offloaded-task' into 'main'

Move the zone loading to the offloaded threads

Closes #3625

See merge request isc-projects/bind9!6985

3 years agoAdd CHANGES note for [GL #3625]
Ondřej Surý [Wed, 26 Oct 2022 11:26:23 +0000 (13:26 +0200)] 
Add CHANGES note for [GL #3625]

3 years agoMove the zone loading to the offloaded threads
Ondřej Surý [Wed, 26 Oct 2022 10:40:43 +0000 (12:40 +0200)] 
Move the zone loading to the offloaded threads

Instead of doing incremental zone loading with fixed quantum - 100
loaded lines per event, move the zone loading process to the offloaded
libuv threads using isc_work_enqueue() API.

This has the advantage that the thread scheduling is given back to the
operating system that understands blocking operations, and the zone
loading operation doesn't block the networking threads directly.

3 years agoRefactor dns_master_loadfileinc() to use loopmgr instead of tasks
Evan Hunt [Tue, 25 Oct 2022 21:38:53 +0000 (14:38 -0700)] 
Refactor dns_master_loadfileinc() to use loopmgr instead of tasks

Incremental file loads now use loopmgr events instead of task events.

The dns_master_loadstreaminc(), _loadbufferinc(), _loadlexer() and
_loadlexerinc() functions were not used in BIND, and have been removed.

3 years agoMerge branch '3576-check-_dns-svcb-records-additional-constraints' into 'main'
Mark Andrews [Fri, 28 Oct 2022 20:49:45 +0000 (20:49 +0000)] 
Merge branch '3576-check-_dns-svcb-records-additional-constraints' into 'main'

Resolve "Check _dns SVCB records additional constraints in primary zones."

Closes #3576

See merge request isc-projects/bind9!6856

3 years agoAdd release note for [GL #3576]
Mark Andrews [Thu, 6 Oct 2022 06:42:14 +0000 (17:42 +1100)] 
Add release note for [GL #3576]

3 years agoAdd CHANGES for [GL #3576]
Mark Andrews [Wed, 5 Oct 2022 07:01:10 +0000 (18:01 +1100)] 
Add CHANGES for [GL #3576]

3 years agoTest named's check-svcb behaviour with UPDATE
Mark Andrews [Thu, 6 Oct 2022 06:31:40 +0000 (17:31 +1100)] 
Test named's check-svcb behaviour with UPDATE

Checks that malformed _dns SVCB records are rejected unless
check-svcb is set to no, in which case they are accepted. Both
missing ALPN and missing DOHPATH are checked for.

3 years agoCheck check-svcb processing in nsupdate
Mark Andrews [Thu, 6 Oct 2022 04:23:03 +0000 (15:23 +1100)] 
Check check-svcb processing in nsupdate

3 years agoAdd various zones containing bad _dns SVCB records
Mark Andrews [Thu, 6 Oct 2022 01:34:13 +0000 (12:34 +1100)] 
Add various zones containing bad _dns SVCB records

3 years agoAdd check-svcb to named
Mark Andrews [Wed, 5 Oct 2022 06:49:07 +0000 (17:49 +1100)] 
Add check-svcb to named

check-svcb signals whether to perform additional contraint tests
when loading / update primary zone files.

3 years agoAdd checking of _dns SVCB records constraints to nsupdate
Mark Andrews [Wed, 5 Oct 2022 06:25:21 +0000 (17:25 +1100)] 
Add checking of _dns SVCB records constraints to nsupdate

_dns SVBC records have additional constrains which should be checked
when records are being added.  This adds those constraint checks but
allows the user to override them using 'check-svcb no'.

3 years agoAdd dns_rdata_checksvcb
Mark Andrews [Wed, 5 Oct 2022 06:18:24 +0000 (17:18 +1100)] 
Add dns_rdata_checksvcb

dns_rdata_checksvcb performs data entry checks on SVCB records.
In particular that _dns SVBC record have an 'alpn' and if that 'alpn'
parameter indicates HTTP is in use that 'dophath' is present.

3 years agoAdd dns_name_isdnssvcb
Mark Andrews [Wed, 5 Oct 2022 06:09:33 +0000 (17:09 +1100)] 
Add dns_name_isdnssvcb

dns_name_isdnssvcb looks for a name which starts with the label
_dns or _<port>._dns labels.

3 years agoMerge branch 'matthijs-fix-bug-tls-dynamic-update-forwarding' into 'main'
Matthijs Mekking [Thu, 27 Oct 2022 11:38:15 +0000 (11:38 +0000)] 
Merge branch 'matthijs-fix-bug-tls-dynamic-update-forwarding' into 'main'

Fix update forwarding bug

See merge request isc-projects/bind9!6982

3 years agoFix update forwarding bug
Matthijs Mekking [Wed, 26 Oct 2022 08:02:36 +0000 (10:02 +0200)] 
Fix update forwarding bug

The wrong tls configuration was picked here. It should be of the
primary that is selected by forward->which, not zone->curprimary.

This bug may cause BIND to select the wrong primary when retrieving
the TLS settings, or cause a crash in case the wrongly selected primary
has no TLS settings.

3 years agoAdd new upforwd system test
Matthijs Mekking [Wed, 26 Oct 2022 07:51:21 +0000 (09:51 +0200)] 
Add new upforwd system test

Add a new upforwd system test that checks if update forwarding still
works if the first primary is badly configured.

We cannot reuse the 'example.' zone for this test because that
checks if update forwarding works for DoT. What transport is used
in the new test is of no relevance.

Update the system test to use different known good file names for
the different zones that are being tested.

3 years agoMerge branch '3503-random-default-algorithm-in-tests' into 'main'
Tom Krizek [Thu, 27 Oct 2022 10:15:05 +0000 (10:15 +0000)] 
Merge branch '3503-random-default-algorithm-in-tests' into 'main'

Random selection of DEFAULT_ALGORITHM in system tests at runtime

Closes #3503

See merge request isc-projects/bind9!6989

3 years agoRandomize algorithm selection for mkeys test
Tom Krizek [Wed, 26 Oct 2022 14:20:57 +0000 (16:20 +0200)] 
Randomize algorithm selection for mkeys test

Use the ALGORITHM_SET option to use randomly selected default algorithm
in this test. Make sure the test works by using variables instead of
hard-coding values.

3 years agoSet algorithms for system tests at runtime
Tom Krizek [Wed, 26 Oct 2022 15:38:32 +0000 (17:38 +0200)] 
Set algorithms for system tests at runtime

Use the get_algorithms.py script to detect supported algorithms and
select random algorithms to use for the tests.

Make sure to load common.conf.sh after KEYGEN env var is exported.

3 years agoScript for random algorithm selection in system tests
Tom Krizek [Tue, 25 Oct 2022 15:45:16 +0000 (17:45 +0200)] 
Script for random algorithm selection in system tests

Multiple algorithm sets can be defined in this script. These can be
selected via the ALGORITHM_SET environment variable. For compatibility
reasons, "stable" set contains the currently used algorithms, since our
system tests need some changes before being compatible with randomly
selected algorithms.

The script operation is similar to the get_ports.py - environment
variables are created and then printed out as `export NAME=VALUE`
commands, to be interpreted by shell. Once we support pytest runner for
system tests, this should be a fixture instead.

3 years agoExport env variables in system tests
Tom Krizek [Tue, 25 Oct 2022 16:00:27 +0000 (18:00 +0200)] 
Export env variables in system tests

Certain variables have to be exported in order for the system tests to
work. It makes little sense to export the variables in one place/script
while they're defined in another place.

Since it makes no harm, export all the variables to make the behaviour
more predictable and consistent. Previously, some variables were
exported as environment variables, while others were just shell
variables which could be used once the configuration was sourced from
another script. However, they wouldn't be exposed to spawned processes.

For simplicity sake (and for the upcoming effort to run system tests
with pytest), export all variables that are used. TESTS, PARALLEL_UNIX
and SUBDIRS variables are automake-specific, aren't used anywhere else
and thus not exported.

3 years agoSupport testcrypto.sh usage without including conf.sh
Tom Krizek [Tue, 25 Oct 2022 12:05:07 +0000 (14:05 +0200)] 
Support testcrypto.sh usage without including conf.sh

The only variable really needed for the script to work is the path to
the $KEYGEN binary. Allow setting this via an environment variable to
avoid loading conf.sh (and causing a chicken-egg problem). Also make
testcrypto.sh executable to allow its use from conf.sh.

3 years agoUnify indentation level in testcrypto.sh
Tom Krizek [Tue, 25 Oct 2022 12:02:30 +0000 (14:02 +0200)] 
Unify indentation level in testcrypto.sh

3 years agoMerge branch '3627-inheritance-bug-remote-server-port' into 'main'
Matthijs Mekking [Thu, 27 Oct 2022 10:13:48 +0000 (10:13 +0000)] 
Merge branch '3627-inheritance-bug-remote-server-port' into 'main'

Fix inheritance bug when setting port in remote server configuration

Closes #3627

See merge request isc-projects/bind9!6988

3 years agoAdd release note and change entry for [GL #3627]
Matthijs Mekking [Wed, 26 Oct 2022 15:19:40 +0000 (17:19 +0200)] 
Add release note and change entry for [GL #3627]

3 years agoFix config bug related to port setting
Matthijs Mekking [Wed, 26 Oct 2022 07:55:55 +0000 (09:55 +0200)] 
Fix config bug related to port setting

There are three levels there for the port value, with increasing
priority:

1. The default ports, defined by 'port' and 'tls-port' config options.
2. The primaries-level default port: primaries port <number>  { ... };
3. The primaries element-level port: primaries { <address> port
   <number>; ... };"

In 'named_config_getipandkeylist()', the 'def_port' and 'def_tlsport'
variables are extracted from level 1. The 'port' variable is extracted
from the level 2. Currently if that is unset, it defaults to the
default port ('def_port' or 'def_tlsport' depending on the transport
used), but overrides the level 2 port setting for the next primaries in
the list.

Update the code such that we inherit the port only if the level 3 port
is not set, and inherit from the default ports if the level 2 port is
also not set.

3 years agoAdd xfer system test case
Matthijs Mekking [Wed, 26 Oct 2022 14:55:05 +0000 (16:55 +0200)] 
Add xfer system test case

Add a test case that if the first primary fails, the fallback of a
second primary on plain DNS works. This is mainly to test that the port
configuration inheritance works correctly.

3 years agoMerge branch 'ondrej-cleanup-isc_lex_create' into 'main'
Ondřej Surý [Wed, 26 Oct 2022 17:11:23 +0000 (17:11 +0000)] 
Merge branch 'ondrej-cleanup-isc_lex_create' into 'main'

Change the return type of isc_lex_create() to void

See merge request isc-projects/bind9!6983

3 years agoChange the return type of isc_lex_create() to void
Ondřej Surý [Wed, 26 Oct 2022 10:35:41 +0000 (12:35 +0200)] 
Change the return type of isc_lex_create() to void

The isc_lex_create() cannot fail, so cleanup the return type from
isc_result_t to void.

3 years agoMerge branch 'pspacek/tsec-cleanup' into 'main'
Petr Špaček [Tue, 25 Oct 2022 08:54:41 +0000 (08:54 +0000)] 
Merge branch 'pspacek/tsec-cleanup' into 'main'

Remove unused lib/dns/tsec

See merge request isc-projects/bind9!6874

3 years agoRemove unused lib/dns/tsec
Petr Špaček [Thu, 6 Oct 2022 12:39:17 +0000 (14:39 +0200)] 
Remove unused lib/dns/tsec

dns_tsec API is not referenced anywhere, remove it.
This is a leftover after dns_client cleanup.

Related: !4835

3 years agoMerge branch '3620-disable-doh-crash' into 'main'
Evan Hunt [Tue, 25 Oct 2022 04:54:56 +0000 (04:54 +0000)] 
Merge branch '3620-disable-doh-crash' into 'main'

Fix an error when building with --disable-doh

Closes #3620

See merge request isc-projects/bind9!6978

3 years agoFix an error when building with --disable-doh
Evan Hunt [Mon, 24 Oct 2022 20:54:39 +0000 (13:54 -0700)] 
Fix an error when building with --disable-doh

The netievent handler for isc_nmsocket_set_tlsctx() was inadvertently
ifdef'd out when BIND was built with --disable-doh, resulting in an
assertion failure on startup when DoT was configured.

3 years agoMerge branch '3517-serve-stale-cache-timeout-0-test' into 'main'
Tom Krizek [Mon, 24 Oct 2022 12:50:51 +0000 (12:50 +0000)] 
Merge branch '3517-serve-stale-cache-timeout-0-test' into 'main'

[CVE-2022-3080] Test serve stale cache with timeout 0 and CNAME

See merge request isc-projects/bind9!6975

3 years agoRemove misleading comment from serve-stale test
Tom Krizek [Fri, 2 Sep 2022 08:26:16 +0000 (10:26 +0200)] 
Remove misleading comment from serve-stale test

The stale-answer-client-timeout option is not set to 0 in the config
neither is it the default value. This was probably caused by a
copy-paste error.

3 years agoTest serve stale cache with timeout 0 and CNAME
Tom Krizek [Thu, 1 Sep 2022 11:56:33 +0000 (13:56 +0200)] 
Test serve stale cache with timeout 0 and CNAME

Add a couple of tests that verify the serve-stale behavior when
stale-answer-client-timeout is set to 0 and a (stale) CNAME record is
queried.

Related #3517

3 years agoMerge branch 'michal/bump-sphinx-version-to-5.3.0' into 'main'
Michał Kępień [Mon, 24 Oct 2022 09:46:07 +0000 (09:46 +0000)] 
Merge branch 'michal/bump-sphinx-version-to-5.3.0' into 'main'

Bump Sphinx version to 5.3.0

See merge request isc-projects/bind9!6972

3 years agoBump Sphinx version to 5.3.0
Michał Kępień [Mon, 24 Oct 2022 09:05:02 +0000 (11:05 +0200)] 
Bump Sphinx version to 5.3.0

Make the Sphinx version listed in doc/arm/requirements.txt match the
version currently used in GitLab CI, so that Read the Docs builds the
documentation using the same Python software versions as those used in
GitLab CI.

3 years agoMerge branch '3603-resolver-prefetch-eligibility-edge-case-bug' into 'main'
Arаm Sаrgsyаn [Fri, 21 Oct 2022 11:28:44 +0000 (11:28 +0000)] 
Merge branch '3603-resolver-prefetch-eligibility-edge-case-bug' into 'main'

Synchronize prefetch "trigger" and "eligibility" code and documentation

Closes #3603

See merge request isc-projects/bind9!6937

3 years agoGetting the "prefetch" setting from the configuration cannot fail
Aram Sargsyan [Thu, 20 Oct 2022 10:38:50 +0000 (10:38 +0000)] 
Getting the "prefetch" setting from the configuration cannot fail

The "prefetch" setting is in "defaultconf" so it cannot fail, use
INSIST to confirm that.

The 'trigger' and 'eligible' variables are now prefixed with
'prefetch_' and their declaration moved to an upper level, because
there is no more additional code block after this change.

3 years agoFix prefetch "trigger" value's documentation in ARM
Aram Sargsyan [Tue, 18 Oct 2022 13:21:01 +0000 (13:21 +0000)] 
Fix prefetch "trigger" value's documentation in ARM

For the prefetch "trigger" parameter ARM states that when a cache
record with a lower TTL value is encountered during query processing,
it is refreshed. But in reality, the record is refreshed when the TTL
value is lower or equal to the configured "trigger" value.

Fix the documentation to make it match with with the code.

3 years agoAdd a CHANGES note for [GL #3603]
Aram Sargsyan [Tue, 18 Oct 2022 13:10:04 +0000 (13:10 +0000)] 
Add a CHANGES note for [GL #3603]

3 years agoMatch prefetch eligibility behavior with ARM
Aram Sargsyan [Tue, 18 Oct 2022 12:59:47 +0000 (12:59 +0000)] 
Match prefetch eligibility behavior with ARM

ARM states that the "eligibility" TTL is the smallest original TTL
value that is accepted for a record to be eligible for prefetching,
but the code, which implements the condition doesn't behave in that
manner for the edge case when the TTL is equal to the configured
eligibility value.

Fix the code to check that the TTL is greater than, or equal to the
configured eligibility value, instead of just greater than it.

3 years agoAdd another prefetch check in the resolver system test
Aram Sargsyan [Tue, 18 Oct 2022 13:06:19 +0000 (13:06 +0000)] 
Add another prefetch check in the resolver system test

The test triggers a prefetch, but fails to check if it acutally
happened, which prevented it from catching a bug when the record's
TTL value matches the configured prefetch eligibility value.

Check that prefetch happened by comparing the TTL values.

3 years agoMerge branch '3611-bench-render' into 'main'
Tony Finch [Fri, 21 Oct 2022 09:53:09 +0000 (09:53 +0000)] 
Merge branch '3611-bench-render' into 'main'

Delete the `render` benchmark

Closes #3611

See merge request isc-projects/bind9!6947

3 years agoDelete the `render` benchmark
Tony Finch [Wed, 19 Oct 2022 10:20:24 +0000 (11:20 +0100)] 
Delete the `render` benchmark

Instead of fixing a Coverity complaint (and other style nits),
delete it because it needs input data that can't be generated
with the tools that ship with BIND.

3 years agoMerge branch '3598-adb-quota-might-not-be-decremented' into 'main'
Arаm Sаrgsyаn [Fri, 21 Oct 2022 08:50:53 +0000 (08:50 +0000)] 
Merge branch '3598-adb-quota-might-not-be-decremented' into 'main'

Resolve "ADB quota might not be decremented"

Closes #3598

See merge request isc-projects/bind9!6893

3 years agoAdd CHANGES and release notes for [GL #3598]
Aram Sargsyan [Fri, 21 Oct 2022 08:09:01 +0000 (08:09 +0000)] 
Add CHANGES and release notes for [GL #3598]

3 years agoCall dns_adb_endudpfetch() on error path, if required
Aram Sargsyan [Fri, 21 Oct 2022 08:08:55 +0000 (08:08 +0000)] 
Call dns_adb_endudpfetch() on error path, if required

For UDP queries, after calling dns_adb_beginudpfetch() in fctx_query(),
make sure that dns_adb_endudpfetch() is also called on error path, in
order to adjust the quota back.

3 years agoAlways call dns_adb_endudpfetch() in fctx_cancelquery() for UDP queries
Aram Sargsyan [Fri, 21 Oct 2022 08:08:47 +0000 (08:08 +0000)] 
Always call dns_adb_endudpfetch() in fctx_cancelquery() for UDP queries

It is currently possible that dns_adb_endudpfetch() is not
called in fctx_cancelquery() for a UDP query, which results
in quotas not being adjusted back.

Always call dns_adb_endudpfetch() for UDP queries.

3 years agoUnlink the query under cleanup_query
Aram Sargsyan [Fri, 21 Oct 2022 08:08:37 +0000 (08:08 +0000)] 
Unlink the query under cleanup_query

In the cleanup code of fctx_query() function there is a code path
where 'query' is linked to 'fctx' and it is being destroyed.

Make sure that 'query' is unlinked before destroying it.

3 years agoMerge branch '3563-fix-named-startup-on-manycore-solaris-systems' into 'main'
Ondřej Surý [Thu, 20 Oct 2022 12:02:04 +0000 (12:02 +0000)] 
Merge branch '3563-fix-named-startup-on-manycore-solaris-systems' into 'main'

Fix named failing to start on Solaris systems with hundreds of CPUs

Closes #3563

See merge request isc-projects/bind9!6955

3 years agoModify release notes [GL #3563]
Artem Boldariev [Wed, 19 Oct 2022 12:45:50 +0000 (15:45 +0300)] 
Modify release notes [GL #3563]

Mention that a startup problem on manycore Solaris systems is fixed.

3 years agoModify CHANGES [GL #3563]
Artem Boldariev [Wed, 19 Oct 2022 12:37:11 +0000 (15:37 +0300)] 
Modify CHANGES [GL #3563]

Mention that a startup problem on manycore Solaris systems is fixed.

3 years agoFix named failing to start on Solaris systems with hundreds of CPUs
Artem Boldariev [Wed, 19 Oct 2022 12:26:48 +0000 (15:26 +0300)] 
Fix named failing to start on Solaris systems with hundreds of CPUs

This commit fixes a startup issue on Solaris systems with
many (reportedly > 510) CPUs by bumping RLIMIT_NOFILE. This appears to
be a regression from 9.11.

3 years agoMerge branch '3270-use-curl-in-statschannel-system-test' into 'main'
Ondřej Surý [Thu, 20 Oct 2022 12:00:54 +0000 (12:00 +0000)] 
Merge branch '3270-use-curl-in-statschannel-system-test' into 'main'

Replace raw nc usage in statschannel system test with curl

Closes #3270

See merge request isc-projects/bind9!6946

3 years agoReplace some raw nc usage in statschannel system test with curl
Ondřej Surý [Tue, 18 Oct 2022 19:46:16 +0000 (21:46 +0200)] 
Replace some raw nc usage in statschannel system test with curl

For tests where the TCP connection might get interrupted abruptly,
replace the nc with curl as the data sent from server to client might
get lost because of abrupt TCP connection.  This happens when the TCP
connection gets closed during sending the large request to the server.

As we already require curl for other system tests, replace the nc usage
in the statschannel test with curl that actually understands the
HTTP/1.1 protocol, so the same connection is reused for sending the
consequtive requests, but without client-side "pipelining".

For the record, the server doesn't support parallel processing of the
pipelined request, so it's a bit misnomer here, because what we are
actually testing is that we process all requests received in a single
TCP read callback.

3 years agoMerge tag 'v9_19_6'
Michal Nowak [Thu, 20 Oct 2022 09:01:27 +0000 (11:01 +0200)] 
Merge tag 'v9_19_6'

BIND 9.19.6

3 years agoMerge branch '3247-rpz-ip-cd' into 'main'
Evan Hunt [Wed, 19 Oct 2022 20:11:26 +0000 (20:11 +0000)] 
Merge branch '3247-rpz-ip-cd' into 'main'

ensure RPZ lookups handle CD=1 correctly

Closes #3247

See merge request isc-projects/bind9!6944