Commit graph

35015 commits

Author SHA1 Message Date
Mark Andrews
dbeea1afa0 Don't use 'dnssec-signzone -P' unless necessary
Most of the test zones in the dnssec system test can be verified.
Use -z when only a single key is being used so that the verifier
knows that only a single key is in use.
2021-11-23 08:44:47 +11:00
Mark Andrews
77ca778377 Generate test zone with multiple NSEC and NSEC3 chains
The method used to generate a test zone with multiple NSEC and
NSEC3 chains was incorrect.  Multiple calls to dnssec-signzone
with multiple parameters is not additive.  Extract the chain on
each run then add them to the final signed zone instance.
2021-11-23 08:44:47 +11:00
Ondřej Surý
e3ca3156a5 Merge branch '3018-resolver-crash' into 'main'
fix a use-after-free in resolver

Closes #3018

See merge request isc-projects/bind9!5584
2021-11-22 10:38:15 +00:00
Evan Hunt
465353d9ca CHANGES for [GL #3018] 2021-11-22 11:35:34 +01:00
Evan Hunt
326a4fc13b fix a use-after-free in resolver
when processing a mismatched response, we call dns_dispatch_getnext().
If that fails, for example because of a timeout, fctx_done() is called,
which cancels all queries. This triggers a crash afterward when
fctx_cancelquery() is called, and is unnecessary since fctx_done()
would have been called later anyway.
2021-11-22 11:35:34 +01:00
Ondřej Surý
949c3919a8 Merge branch '2978-fix-data-race-in-adb.c' into 'main'
Fix the data race when shutting down dns_adb

Closes #2978

See merge request isc-projects/bind9!5569
2021-11-22 10:29:02 +00:00
Ondřej Surý
7e002d89b4 Fix the data race when shutting down dns_adb
When dns_adb is shutting down, first the adb->shutting_down flag is set
and then task is created that runs shutdown_stage2() that sets the
shutdown flag on names and entries.  However, when dns_adb_createfind()
is called, only the individual shutdown flags are being checked, and the
global adb->shutting_down flag was not checked.  Because of that it was
possible for a different thread to slip in and create new find between
the dns_adb_shutdown() and dns_adb_detach(), but before the
shutdown_stage2() task is complete.  This was detected by
ThreadSanitizer as data race because the zonetable might have been
already detached by dns_view shutdown process and simultaneously
accessed by dns_adb_createfind().

This commit converts the adb->shutting_down to atomic_bool to prevent
the global adb lock when creating the find.
2021-11-22 11:09:21 +01:00
Matthijs Mekking
9d94720735 Merge branch '1836-extended-dns_errors' into 'main'
Set Extended EDNS Error (EDE) Prohibited (18)

See merge request isc-projects/bind9!4793
2021-11-19 09:58:26 +00:00
Matthijs Mekking
4354047f97 Test for EDE option with non-EDNS query
Add a test case to make sure the EDE option is not set on an EDNS
disabled query.
2021-11-19 09:44:28 +01:00
Matthijs Mekking
842fa76cdd Add CHANGES and release notes for EDE:18
New feature.
2021-11-19 09:44:28 +01:00
Matthijs Mekking
f14964a1b1 Test for EDE option 18 in allow-query test
If a query is refused because of an ACL error, check that the extended
DNS error "Prohibited (18)" is set.
2021-11-19 09:44:28 +01:00
Matthijs Mekking
ca7f2fd903 Add EDE to query messages
Add extended DNS error on refused queries. All instances are related to
unauthorized clients, so set extended DNS error code 18 (Prohibited).
2021-11-19 09:44:28 +01:00
Matthijs Mekking
6c8fc2f4f0 Add method to set extended DNS error
Add a new parameter to 'ns_client_t' to store potential extended DNS
error. Reset when the client request ends, or is put back.

Add defines for all well-known info-codes.

Update the number of DNS_EDNSOPTIONS that we are willing to set.

Create a new function to set the extended error for a client reply.
2021-11-19 09:44:28 +01:00
Matthijs Mekking
36503721f2 Merge branch 'doc-fix-cookie-algorithm-desc' into 'main'
[ISC-support #19862] Update docs to reflect changes to acceptable cookie-algorithm values

See merge request isc-projects/bind9!5573
2021-11-18 12:57:52 +00:00
Dan Theisen
b29a748119 Update docs with correct cookie-algorithm values
The documentation was inconsistent with the code. The new description
for cookie-algorithm now reflects the current behavior.

The following two commits are the relevant code changes to this
section of docs: afa81ee4 a912f313
2021-11-18 13:26:12 +01:00
Michał Kępień
a814f72261 Merge branch 'v9_17_20-release' into 'main'
Merge 9.17.20 release branch

See merge request isc-projects/bind9!5581
2021-11-18 08:14:40 +00:00
Michał Kępień
d0940f87b6 Set up release notes for BIND 9.17.21 2021-11-18 09:00:07 +01:00
Michał Kępień
50ea1f5fc4 Update BIND version to 9.17.20 2021-11-18 09:00:07 +01:00
Michał Kępień
27abbbafeb Add a CHANGES marker 2021-11-18 09:00:07 +01:00
Michał Kępień
ac870ec6d6 Merge branch 'michal/prepare-documentation-for-bind-9.17.20' into 'v9_17_20-release'
Prepare documentation for BIND 9.17.20

See merge request isc-private/bind9!335
2021-11-18 09:00:07 +01:00
Michał Kępień
adf37a9d59 Prepare release notes for BIND 9.17.20 2021-11-18 09:00:07 +01:00
Michał Kępień
02b1a18db2 Reorder release notes 2021-11-18 09:00:07 +01:00
Michał Kępień
075f03d37f Tweak and reword release notes 2021-11-18 09:00:07 +01:00
Evan Hunt
00d379da8e Merge branch '2374-mdig-ephemeral' into 'main'
Make mdig use the OS-supplied ephemeral port range

Closes #2374

See merge request isc-projects/bind9!5552
2021-11-17 22:38:50 +00:00
Evan Hunt
0fecb10c17 Make mdig use the OS-supplied ephemeral port range
mdig was always using the default 1024-65535 range for outgoing
messages, instead of using the system's configured ephemeral ports.
2021-11-17 14:13:17 -08:00
Evan Hunt
f6fc9d8c61 Merge branch 'each-fix-warnings' into 'main'
address '--disable-doh' failures

See merge request isc-projects/bind9!5561
2021-11-17 22:11:36 +00:00
Evan Hunt
7f63ee3bae address '--disable-doh' failures
Change 5756 (GL #2854) introduced build errors when using
'configure --disable-doh'.  To fix this, isc_nm_is_http_handle() is
now defined in all builds, not just builds that have DoH enabled.

Missing code comments were added both for that function and for
isc_nm_is_tlsdns_handle().
2021-11-17 13:48:43 -08:00
Mark Andrews
a58859b197 Merge branch '3012-begin-end-dnssec-managed-keys-in-bin-named-config-c-are-mismatched' into 'main'
Resolve "BEGIN/END DNSSEC/MANAGED KEYS in bin/named/config.c are mismatched."

Closes #3012

See merge request isc-projects/bind9!5575
2021-11-16 21:44:21 +00:00
Mark Andrews
1d7b1f74c9 Embed NAMED_SYSCONFDIR contents in the bind.keys comment 2021-11-16 14:39:05 +11:00
Mark Andrews
43a7f3f532 Update comments around built in trust anchors
The comments now say "# BEGIN TRUST ANCHORS" and "# END TRUST ANCHORS".
2021-11-16 14:36:10 +11:00
Ondřej Surý
92823f9424 Merge branch 'ondrej/update-flycheck-configuration-on-Linux' into 'main'
Add flycheck configuration for libxml2 and json-c on Linux

See merge request isc-projects/bind9!5570
2021-11-15 11:33:37 +00:00
Ondřej Surý
41f86440c4 Add flycheck configuration for libxml2 and json-c on Linux 2021-11-15 12:31:48 +01:00
Mark Andrews
e8d1dd30bc Merge branch '3003-greedy-regular-expression-causes-intermittent-nsupdate-system-test-failures' into 'main'
Resolve "Greedy regular expression causes intermittent "nsupdate" system test failures"

Closes #3003

See merge request isc-projects/bind9!5559
2021-11-10 01:49:43 +00:00
Mark Andrews
c1df7884f0 Add CHANGES note for [GL #3003] 2021-11-10 12:13:34 +11:00
Mark Andrews
be879cda72 Replace incorrect sed expersion with awk
The sed expression could find the wrong instance of 10.
Use awk to replace the TTL field and also to specify the
server and issue the send command.
2021-11-10 12:09:51 +11:00
Petr Špaček
ed99c502b6 Merge branch 'pspacek/ci-jobs-interruptible' into 'main'
Automatically cancel CI jobs on outdated branches

See merge request isc-projects/bind9!5558
2021-11-09 10:54:39 +00:00
Petr Špaček
02b438fadf
Automatically cancel CI jobs on outdated branches
Gitlab feature
https://docs.gitlab.com/ee/ci/pipelines/settings.html#auto-cancel-redundant-pipelines
can automatically cancel jobs which operate on an outdated code, i.e. on
branches which received new commits while jobs with an older set of
commits are still running. For this feature to work jobs have to be
configured with boolean interruptible: true.

I think practically all of our current CI jobs can be cancelled,
so the option is now on by default for all jobs.
2021-11-09 11:21:34 +01:00
Petr Špaček
a3ea4fec2a Merge branch 'pspacek/gitlab-ci-cleanup' into 'main'
Remove obsolete PYTHONPATH setting from .gitlab-ci.yaml

See merge request isc-projects/bind9!5563
2021-11-09 09:54:51 +00:00
Petr Špaček
310a15ac94
Remove obsolete PYTHONPATH setting from .gitlab-ci.yaml
It was leftover after removing Python tools in commit
98b3b93791.
2021-11-09 10:24:42 +01:00
Petr Špaček
05eab7cf8f Merge branch '2779-wildcard_test_property_based' into 'main'
Add property based test for wildcard expansion

See merge request isc-projects/bind9!5203
2021-11-08 13:20:50 +00:00
Petr Špaček
6495e59a4c
Fix system test .status file cleanup 2021-11-08 13:23:22 +01:00
Petr Špaček
49da19c353
Add new system test for wildcard expansion
This is almost minimal prototype to show how to use python-hypothesis
library in a system test. It does not fully replace existing shell-based
system test for wildcards.
2021-11-08 13:23:05 +01:00
Petr Špaček
8ce4759c5c
Use more liberal pylint for tests
Ignore wrong-import-position to enable use of pytest.importorskip.
2021-11-08 13:23:05 +01:00
Petr Špaček
1a80e641e9
Use more liberal flake8 for tests
Ignore rule W402 (wrong import order) to enable use of
pytest.importorskip.
2021-11-08 13:23:05 +01:00
Petr Špaček
b8829c801f
Allow py.test system test to skip itself
Enable use of shortcuts like pytest.importorskip and other tricks
which can cause test to skip itself.
2021-11-08 13:23:03 +01:00
Artem Boldariev
4589146eb1 Merge branch '2854-cache-control-max-age' into 'main'
Resolve #2854: DoH:  Assign HTTP responses freshness lifetime according to the smallest TTL found in the Answer section

Closes #2854

See merge request isc-projects/bind9!5493
2021-11-05 13:02:52 +00:00
Artem Boldariev
2a340ee510 Modify the CHANGES file [GL #2854]
Mentions that we now assign HTTP freshness lifetime to responses sent
over DNS-over-HTTPS.
2021-11-05 14:14:59 +02:00
Evan Hunt
03564ba982 add a max-age test to doth system test
use curl, when available, to query for names that do and do not
exist; dump the response headers and check for the expected
max-age value.
2021-11-05 14:14:59 +02:00
Artem Boldariev
51a2c7aed3 DoH: Set the "max-age" "Cache-Control" HTTP header value
This commit makes BIND set the "max-age" value of the "Cache-Control"
HTTP header to the minimal TTL from the Answer section for positive
answers, as RFC 8484 advises in section 5.1.

We calculate the minimal TTL as a side effect of rendering the
response DNS message, so it does not change the code flow much, nor
should it have any measurable negative impact on the performance.

For negative answers, the "max-age" value is set using the TTL and
SOA-minimum values from an SOA record in the Authority section.
2021-11-05 14:14:59 +02:00
Artem Boldariev
80482f8d3e DoH: Add isc_nm_set_min_answer_ttl()
This commit adds an isc_nm_set_min_answer_ttl() function which is
intended to to be used to give a hint to the underlying transport
regarding the answer TTL.

The interface is intentionally kept generic because over time more
transports might benefit from this functionality, but currently it is
intended for DoH to set "max-age" value within "Cache-Control" HTTP
header (as recommended in the RFC8484, section 5.1 "Cache
Interaction").

It is no-op for other DNS transports for the time being.
2021-11-05 14:14:59 +02:00