]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
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

3 years agoCHANGES for [GL #3247]
Evan Hunt [Tue, 18 Oct 2022 23:39:04 +0000 (16:39 -0700)] 
CHANGES for [GL #3247]

3 years agoadd a test with CD=1 query for pending data
Evan Hunt [Tue, 18 Oct 2022 23:37:07 +0000 (16:37 -0700)] 
add a test with CD=1 query for pending data

this is a regression test for [GL #3247].

3 years agoensure RPZ lookups handle CD=1 correctly
Evan Hunt [Tue, 18 Oct 2022 20:48:52 +0000 (13:48 -0700)] 
ensure RPZ lookups handle CD=1 correctly

RPZ rewrites called dns_db_findext() without passing through the
client database options; as as result, if the client set CD=1,
DNS_DBFIND_PENDINGOK was not used as it should have been, and
cache lookups failed, resulting in failure of the rewrite.

3 years agoMerge branch '3270-serialize-statschannel-http-requests' into 'main'
Ondřej Surý [Wed, 19 Oct 2022 12:47:06 +0000 (12:47 +0000)] 
Merge branch '3270-serialize-statschannel-http-requests' into 'main'

Serialize the HTTP/1.1 statschannel requests

Closes #3270

See merge request isc-projects/bind9!6954

3 years agoSerialize the HTTP/1.1 statschannel requests
Ondřej Surý [Tue, 18 Oct 2022 19:46:16 +0000 (21:46 +0200)] 
Serialize the HTTP/1.1 statschannel requests

The statschannel truncated test still terminates abruptly sometimes and
it doesn't return the answer for the first query.  This might happen
when the second process_request() discovers there's not enough space
before the sending is complete and the connection is terminated before
the client gets the data.

Change the isc_http, so it pauses the reading when it receives the data
and resumes it only after the sending has completed or there's
incomplete request waiting for more data.

This makes the request processing slightly less efficient, but also less
taxing for the server, because previously all requests that has been
received via single TCP read would be processed in the loop and the
sends would be queued after the read callback has processed a full
buffer.

3 years agoMerge branch '3612-fix-mem-functions-with-openssl-1.0.2' into 'main'
Ondřej Surý [Wed, 19 Oct 2022 12:42:20 +0000 (12:42 +0000)] 
Merge branch '3612-fix-mem-functions-with-openssl-1.0.2' into 'main'

Fix the non-developer build with OpenSSL 1.0.2

Closes #3612

See merge request isc-projects/bind9!6952

3 years agoFix the non-developer build with OpenSSL 1.0.2
Ondřej Surý [Wed, 19 Oct 2022 12:13:26 +0000 (14:13 +0200)] 
Fix the non-developer build with OpenSSL 1.0.2

In non-developer build, a wrong condition prevented the
isc__tls_malloc_ex, isc__tls_realloc_ex and isc__tls_free_ex to be
defined.  This was causing FTBFS on platforms with OpenSSL 1.0.2.

3 years agoMerge branch '3270-remove-time-requirement-for-statschannel-truncated-test' into...
Ondřej Surý [Wed, 19 Oct 2022 12:35:38 +0000 (12:35 +0000)] 
Merge branch '3270-remove-time-requirement-for-statschannel-truncated-test' into 'main'

Remove the time requirement for the statschannel truncated test

Closes #3270

See merge request isc-projects/bind9!6951

3 years agoRemove the time requirement for the statschannel truncated test
Ondřej Surý [Wed, 19 Oct 2022 11:52:09 +0000 (13:52 +0200)] 
Remove the time requirement for the statschannel truncated test

The 5 seconds requirement to finish the 'pipelined with truncated
stream' was causing spurious failures in the CI because the job runners
might be very busy and sending 128k of data might simply take some time.

Remove the time requirement altogether, there's actually no reason why
the test SHOULD or even MUST finish under 5 seconds.

3 years agoMerge branch 'tkrizek/system-tests-fixes' into 'main'
Tom Krizek [Wed, 19 Oct 2022 11:01:26 +0000 (11:01 +0000)] 
Merge branch 'tkrizek/system-tests-fixes' into 'main'

Update various system tests and add them to default test suite

See merge request isc-projects/bind9!6942

3 years agoRemove generated controls.conf file from system tests
Tom Krizek [Fri, 7 Oct 2022 14:23:56 +0000 (16:23 +0200)] 
Remove generated controls.conf file from system tests

The controls.conf file shouldn't be used directly without templating it
first. Remove this no longer used hard-coded file to avoid confusion.

3 years agoRevive dupsigs system test
Tom Krizek [Tue, 18 Oct 2022 15:16:27 +0000 (17:16 +0200)] 
Revive dupsigs system test

Correctly source conf.sh in dupsigs test scripts (fix issue introduced
by 093af1c00ac25e4f132fe2442a24e1264aadb28d).

Update dupsigs test for dnssec-dnskey-kskonly default. Since v9.17.20,
the dnssec-dnskey-kskonly is set to yes. Update the test to not expect
the additional RRSIG with ZSK for DNSKEY.

Speed up the test from 20 minutes to 2.5 minutes and make it part of the
default test suite executed in CI.
- decrease number of records to sign from 2000 to 500
- decrease the signing interval by a factor of 6
- shorten the final part of the test after last signing (since nothing
  new happens there)

Finally, clarify misleading comments about (in)sufficient time for zone
re-signing. The time used in the test is in fact sufficient for the
re-signing to happen. If it wasn't, the previous ZSK would end up being
deleted while its signatures would still be present, which is a
situation where duplicate signatures can still happen.

3 years agoRevive the stress system test
Tom Krizek [Fri, 14 Oct 2022 14:59:50 +0000 (16:59 +0200)] 
Revive the stress system test

Ensure the port numbers are dynamically filled in with copy_setports.

Clarify test fail condition.

Make the stress test part of the default test suite since it doesn't
seem to run too long or interfere with other tests any more (the
original note claiming so is more than 20 years old).

Related !6883

3 years agoRevive dialup system test
Tom Krizek [Mon, 10 Oct 2022 15:21:41 +0000 (17:21 +0200)] 
Revive dialup system test

Properly template the port number in config files with copy_setports.

The test takes two minutes on my machine which doesn't seem like a
proper justification to exclude it from the test suite, especially
considering we run these tests in parallel nowadays. The resource usage
doesn't seems significantly increased so it shouldn't interfere with
other system tests.

There also exists a precedent for longer running system tests that are
already part of the default system test suite (e.g. serve-stale takes
almost three minutes on the same machine).

3 years agoMake digdelv test work in different network envs
Tom Krizek [Wed, 5 Oct 2022 13:59:13 +0000 (15:59 +0200)] 
Make digdelv test work in different network envs

When a target server is unreachable, the varying network conditions may
cause different ICMP message (or no message). The host unreachable
message was discovered when attempting to run the test locally while
connected to a VPN network which handles all traffic.

Extend the dig output check with "host unreachable" message to avoid a
false negative test result in certain network environments.

3 years agoMerge branch '3394-cve-2022-2795-test' into 'main'
Michal Nowak [Wed, 19 Oct 2022 10:31:56 +0000 (10:31 +0000)] 
Merge branch '3394-cve-2022-2795-test' into 'main'

Add tests for CVE-2022-2795

Closes #3394

See merge request isc-projects/bind9!6945

3 years agoAdd tests for CVE-2022-2795
Michał Kępień [Tue, 6 Sep 2022 11:36:44 +0000 (13:36 +0200)] 
Add tests for CVE-2022-2795

Add a test ensuring that the amount of work fctx_getaddresses() performs
for any encountered delegation is limited: delegate example.net to a set
of 1,000 name servers in the redirect.com zone, the names of which all
resolve to IP addresses that nothing listens on, and query for a name in
the example.net domain, checking the number of times the findname()
function gets executed in the process; fail if that count is excessively
large.

Since the size of the referral response sent by ans3 is about 20 kB, it
cannot be sent back over UDP (EMSGSIZE) on some operating systems in
their default configuration (e.g. FreeBSD - see the
net.inet.udp.maxdgram sysctl).  To enable reliable reproduction of
CVE-2022-2795 (retry patterns vary across BIND 9 versions) and avoid
false positives at the same time (thread scheduling - and therefore the
number of fetch context restarts - vary across operating systems and
across test runs), extend bin/tests/system/resolver/ans3/ans.pl so that
it also listens on TCP and make "ns1" in the "resolver" system test
always use TCP when communicating with "ans3".

Also add a test (foo.bar.sub.tld1/TXT) that ensures the new limitations
imposed on the resolution process by the mitigation for CVE-2022-2795 do
not prevent valid, glueless delegation chains from working properly.