2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00
Commit Graph

37503 Commits

Author SHA1 Message Date
Aram Sargsyan
8c48eabbc1 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.
2022-11-01 09:50:34 +00:00
Evan Hunt
faad579301 Merge branch '3617-keyfetch-race' into 'main'
call dns_resolver_createfetch() asynchronously in zone_refreshkeys()

Closes #3617

See merge request isc-projects/bind9!6971
2022-11-01 06:28:04 +00:00
Evan Hunt
1ab97cd41b CHANGES for [GL #3617] 2022-10-31 14:40:40 -07:00
Evan Hunt
31c53235dd 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.
2022-10-31 14:34:12 -07:00
Ondřej Surý
16be88d14f 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
2022-10-31 15:14:37 +00:00
Ondřej Surý
fdf1e226fd Add CHANGES note for [GL #3634] 2022-10-31 14:48:08 +00:00
Ondřej Surý
feea72414b 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.
2022-10-31 14:46:30 +00:00
Evan Hunt
07e2b57152 Merge branch '3632-async-backwards' into 'main'
isc_async_run() runs events in reverse order

Closes #3632

See merge request isc-projects/bind9!7000
2022-10-31 13:24:38 +00:00
Evan Hunt
dc878e3098 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.
2022-10-31 05:43:45 -07:00
Evan Hunt
0f4af13906 Merge branch 'each-fix-fuzz' into 'main'
fix build error in fuzz tests

See merge request isc-projects/bind9!6997
2022-10-31 11:28:38 +00:00
Evan Hunt
428eac45ba 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.
2022-10-31 04:28:01 -07:00
Evan Hunt
792d69855a Merge branch 'each-dupsigs-test' into 'main'
make dupsigs test less timing-sensitive

See merge request isc-projects/bind9!6998
2022-10-31 11:23:41 +00:00
Evan Hunt
d9b85cbaae 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.
2022-10-31 04:03:01 -07:00
Ondřej Surý
a69ba0b6bf 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
2022-10-31 10:30:49 +00:00
Ondřej Surý
8fc229c17a Add CHANGES note for [GL #3628] 2022-10-31 10:30:27 +00:00
Ondřej Surý
04670889bc 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.
2022-10-31 10:30:27 +00:00
Evan Hunt
b54c721894 refactor dns_master_dump*async() to use loop callbacks
Asynchronous zone dumping now uses loop callbacks instead of
task events.
2022-10-31 10:30:27 +00:00
Evan Hunt
d63f742b42 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
2022-10-31 10:24:24 +00:00
Evan Hunt
f92b946df3 fix a potential data race in zone_maintenance()
zone_maintenance() accessed zone timer information without locking.
2022-10-31 02:54:40 -07:00
Ondřej Surý
a20d0008da 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
2022-10-31 06:24:23 +00:00
Ondřej Surý
c59750bfbc Add CHANGES note for [GL #3625] 2022-10-30 14:56:55 -07:00
Ondřej Surý
77aeed6231 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.
2022-10-30 14:56:40 -07:00
Evan Hunt
dcc4c3e3ec 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.
2022-10-30 14:56:40 -07:00
Mark Andrews
0fc0d485da 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
2022-10-28 20:49:45 +00:00
Mark Andrews
94c4d5b23d Add release note for [GL #3576] 2022-10-29 07:03:15 +11:00
Mark Andrews
ae37a48638 Add CHANGES for [GL #3576] 2022-10-29 07:03:15 +11:00
Mark Andrews
1244a2ffb9 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.
2022-10-29 00:22:54 +11:00
Mark Andrews
c040e82c82 Check check-svcb processing in nsupdate 2022-10-29 00:22:54 +11:00
Mark Andrews
7782c78d15 Add various zones containing bad _dns SVCB records 2022-10-29 00:22:54 +11:00
Mark Andrews
da6359345e Add check-svcb to named
check-svcb signals whether to perform additional contraint tests
when loading / update primary zone files.
2022-10-29 00:22:54 +11:00
Mark Andrews
f857006cd9 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'.
2022-10-29 00:22:54 +11:00
Mark Andrews
3881afeb15 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.
2022-10-29 00:22:54 +11:00
Mark Andrews
f1043f19dd Add dns_name_isdnssvcb
dns_name_isdnssvcb looks for a name which starts with the label
_dns or _<port>._dns labels.
2022-10-29 00:22:54 +11:00
Matthijs Mekking
f8a741c104 Merge branch 'matthijs-fix-bug-tls-dynamic-update-forwarding' into 'main'
Fix update forwarding bug

See merge request isc-projects/bind9!6982
2022-10-27 11:38:15 +00:00
Matthijs Mekking
218c661b41 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.
2022-10-27 12:22:23 +02:00
Matthijs Mekking
72530d2f9c 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.
2022-10-27 12:22:23 +02:00
Tom Krizek
549b153d2b 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
2022-10-27 10:15:05 +00:00
Tom Krizek
f65f276f98 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.
2022-10-27 12:14:29 +02:00
Tom Krizek
69b608ee9f 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.
2022-10-27 12:14:29 +02:00
Tom Krizek
5f480c8485 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.
2022-10-27 12:14:29 +02:00
Tom Krizek
37d14c69c0 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.
2022-10-27 12:14:29 +02:00
Tom Krizek
bb1c6bbdc7 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.
2022-10-27 12:14:29 +02:00
Tom Krizek
01b293b055 Unify indentation level in testcrypto.sh 2022-10-27 12:14:27 +02:00
Matthijs Mekking
7f844be555 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
2022-10-27 10:13:48 +00:00
Matthijs Mekking
5585256bf6 Add release note and change entry for [GL #3627] 2022-10-27 11:39:34 +02:00
Matthijs Mekking
72d3bf8e4e 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.
2022-10-27 11:39:34 +02:00
Matthijs Mekking
622a499027 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.
2022-10-27 11:39:34 +02:00
Ondřej Surý
e004ca4f6c 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
2022-10-26 17:11:23 +00:00
Ondřej Surý
6ba0a22627 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.
2022-10-26 12:55:06 +02:00
Petr Špaček
75137645c7 Merge branch 'pspacek/tsec-cleanup' into 'main'
Remove unused lib/dns/tsec

See merge request isc-projects/bind9!6874
2022-10-25 08:54:41 +00:00