Commit Graph

35329 Commits

Author SHA1 Message Date
Ondřej Surý
b4ed35c946 Merge branch '3093-missing-libuv-code' into 'main'
add UV_ENOTSUP to isc___nm_uverr2result()

Closes #3093

See merge request isc-projects/bind9!5712
2022-01-17 10:46:35 +00:00
Evan Hunt
be0bc24c7f add UV_ENOTSUP to isc___nm_uverr2result()
This error code is now mapped to ISC_R_FAMILYNOSUPPORT.
2022-01-17 11:45:10 +01:00
Ondřej Surý
ec82226465 Merge branch 'ondrej/fix-missing-backtick-in-host.rst' into 'main'
Add missing backtick to host.rst

See merge request isc-projects/bind9!5724
2022-01-16 07:01:45 +00:00
Ondřej Surý
aaa31962d2 Add missing backtick to host.rst
The missing backtick was causing formatting problems in the host
manpage.
2022-01-16 07:56:17 +01:00
Artem Boldariev
e9942b3ba7 Merge branch 'artem-better-doh-error-logging' into 'main'
DoH: log bad HTTP/2 requests

See merge request isc-projects/bind9!5679
2022-01-14 14:23:43 +00:00
Artem Boldariev
ca9fe3559a DoH: ensure that server_send_error_response() is used properly
The server_send_error_response() function is supposed to be used only
in case of failures and never in case of legitimate requests. Ensure
that ISC_HTTP_ERROR_SUCCESS is never passed there by mistake.
2022-01-14 16:00:42 +02:00
Artem Boldariev
a38b4945c1 DoH: add bad HTTP/2 requests logging
Add some error logging when facing bad requests over HTTP/2. Log the
address and the error description.
2022-01-14 16:00:42 +02:00
Ondřej Surý
5630df8712 Merge branch '3069-increase-dig-timeout-in-resolver-test-v2' into 'main'
Increase the timeout to 15 seconds for the resolver test

Closes #3069

See merge request isc-projects/bind9!5721
2022-01-14 13:51:16 +00:00
Ondřej Surý
d3b975abb6 Increase the timeout to 15 seconds for the resolver test
1. 10 seconds is an unfortunate pick because that reintroduces the
   problem described in commit 5307bf64 (for an earlier check).

   Change the +tries=3 +timeout=10 to +tries=2 +time=15, so that we
   minimize the risk of dig missing any responses sent by the server in
   the first 15 seconds while also increasing our chances of the
   response arriving in time on machines under heavy load and allowing
   it a single retry in case things go awry.

2. The comment about TCP above was misleading: as painfully proven by
   GitLab CI, using TCP is no guarantee of receiving a response in a
   timely manner.  It may help a bit, but it is certainly not a 100%
   reliable solution.

   Change the dig invocation to just use UDP like in the two prior
   tests for consistency (and revise that comment accordingly).
2022-01-14 13:00:56 +01:00
Ondřej Surý
70596240c4 Merge branch '3069-increase-dig-timeout-in-resolver-test' into 'main'
Make resolver system test shellcheck clean

Closes #3069

See merge request isc-projects/bind9!5719
2022-01-14 11:16:11 +00:00
Ondřej Surý
29b9c8e7f5 Increase the dig timeout in resolver test to 10 seconds
The resolver system tests was exhibiting often intermitten failures,
increase the timeout from default 5 second to 10 seconds to give the dig
more leeway for providing an answer.
2022-01-14 11:13:26 +01:00
Ondřej Surý
6d9afd4cc0 Make resolver system test shellcheck clean
The resolver system test shell scripts were using legacy syntax.
Convert the script into POSIX shell syntax and make them shellcheck
clean.
2022-01-14 11:13:26 +01:00
Ondřej Surý
8d95c96b51 Merge branch '3095-detect-padding-in-struct_msghdr' into 'main'
Instead of detecting MUSL libc, detect padding in struct msghdr

Closes #3095

See merge request isc-projects/bind9!5718
2022-01-13 23:26:54 +00:00
Ondrej Sury
9da228dde6 Instead of detecting MUSL libc, detect padding in struct msghdr
The detection of MUSL libc via autoconf $host turned out to be
not reliable.

Convert the autoconf check from $host detection to actually detect
the padding used in the struct msghdr.
2022-01-13 23:06:09 +01:00
Ondřej Surý
5b7e5b1bd8 Merge branch '3095-invalid-recvmmsg-detection' into 'main'
Fix the UDP recvmmsg support

Closes #3095

See merge request isc-projects/bind9!5713
2022-01-13 18:43:00 +00:00
Ondřej Surý
8d778f758b Add CHANGES and release notes for [GL #3095] 2022-01-13 19:06:39 +01:00
Ondřej Surý
0a4e91ee47 Revert "Always enqueue isc__nm_tcp_resumeread()"
The commit itself is harmless, but at the same time it is also useless,
so we are reverting it.

This reverts commit 11c869a3d5.
2022-01-13 19:06:39 +01:00
Ondrej Sury
287ea095f1 Disable udp recvmmsg support on systems with MUSL libc
The Linux kernel diverts from the POSIX specification for two members of
struct msghdr making them size_t sized (instead of int and socklen_t).
In glibc, the developers have decided to use that.  However, the MUSL
developers used padding for the struct and kept the members defined
according to the POSIX.

This creates a problem, because libuv doesn't use recvmmsg() library
call where the padding members are correctly zeroed and instead calls
the syscall directly, the struct msghdr is passed to the kernel with
enormous values in those two members (because of the random junk in the
padding members) and the syscall thus fail with EMSGSIZE.

Disable udp recvmmsg support on systems with MUSL libc until the libuv
starts zeroing the struct msghdr before passing it to the syscall.
2022-01-13 19:06:39 +01:00
Ondřej Surý
7370725008 Fix the UDP recvmmsg support
Previously, the netmgr/udp.c tried to detect the recvmmsg detection in
libuv with #ifdef UV_UDP_<foo> preprocessor macros.  However, because
the UV_UDP_<foo> are not preprocessor macros, but enum members, the
detection didn't work.  Because the detection didn't work, the code
didn't have access to the information when we received the final chunk
of the recvmmsg and tried to free the uvbuf every time.  Fortunately,
the isc__nm_free_uvbuf() had a kludge that detected attempt to free in
the middle of the receive buffer, so the code worked.

However, libuv 1.37.0 changed the way the recvmmsg was enabled from
implicit to explicit, and we checked for yet another enum member
presence with preprocessor macro, so in fact libuv recvmmsg support was
never enabled with libuv >= 1.37.0.

This commit changes to the preprocessor macros to autoconf checks for
declaration, so the detection now works again.  On top of that, it's now
possible to cleanup the alloc_cb and free_uvbuf functions because now,
the information whether we can or cannot free the buffer is available to
us.
2022-01-13 19:06:39 +01:00
Ondřej Surý
abe466e5b3 Merge branch '2951-dont-schedule-zone-refresh-when-shutting-down' into 'main'
Refactor zone stub, refresh and notify event callbacks

Closes #2951

See merge request isc-projects/bind9!5715
2022-01-13 17:46:08 +00:00
Ondřej Surý
abe6d4ee04 Add CHANGES note for [GL #3084] 2022-01-13 17:58:33 +01:00
Ondřej Surý
c960236adb Don't schedule next zone events when shutting down
When the named is shutting down, the zone event callbacks could
re-schedule the stub and refresh events leading to assertion failure.

Handle the ISC_R_SHUTTINGDOWN event state gracefully by bailing out.
2022-01-13 17:58:33 +01:00
Ondřej Surý
efca93942c Refactor zone stub, refresh and notify event callbacks
This commit cleanups the way how we handle the revent->result in the
stub_callback(), refresh_callback() and notify_done() zone callbacks.
2022-01-13 17:58:33 +01:00
Ondřej Surý
28c8fb839c Merge branch '3086-remove-workaround-for-server-mishandling-notify-with-soa-record-in-answer-section' into 'main'
Remove the workaround for broken handling of NOTIFY with SOA

Closes #3086

See merge request isc-projects/bind9!5704
2022-01-13 16:56:19 +00:00
Ondřej Surý
e3379e1615 Add CHANGES note for [GL #3086] 2022-01-13 17:19:38 +01:00
Ondřej Surý
8a0c4355d2 Remove the workaround for broken handling of NOTIFY with SOA
In 2000, old BIND instances (BIND 8?) would return FORMERR if the SOA is
included in the NOTIFY.

Remove the workaround that detected the state and resent the NOTIFY
without SOA record.
2022-01-13 17:09:43 +01:00
Arаm Sаrgsyаn
6441646ead Merge branch '3087-tls-ephemeral-ecc-gnutls-nss-compat' into 'main'
Use uncompressed point conversion form for 'tls ephemeral' ECC keys

Closes #3087

See merge request isc-projects/bind9!5705
2022-01-13 13:11:14 +00:00
Aram Sargsyan
daf11421df Add a test to query DoT using gnutls-cli
Add a test to check BIND's DoT (DNS-over-TLS) implementation using
gnutls-cli to confirm that it is compatibe with the GnuTLS library.
2022-01-13 12:28:11 +00:00
Aram Sargsyan
6f457c5121 Generate a random serial number for 'tls ephemeral' certificates
Clients can cache the TLS certificates and refuse to accept
another one with the same serial number from the same issuer.

Generate a random serial number for the self-signed certificates
instead of using a fixed value.
2022-01-13 11:03:07 +00:00
Aram Sargsyan
0a19b5cd62 Use uncompressed point conversion form for 'tls ephemeral' ECC keys
GnuTLS, NSS, and possibly other TLS libraries currently fail to work
with compressed point conversion form supported by OpenSSL.

Use uncompressed point conversion form for better compatibility.
2022-01-13 11:03:06 +00:00
Ondřej Surý
2eee9242e3 Merge branch '3079-assertion-failure-on-TCP-read' into 'main'
Use ISC_R_SHUTTINGDOWN to detect netmgr shutting down

Closes #3079

See merge request isc-projects/bind9!5710
2022-01-13 09:26:31 +00:00
Ondřej Surý
86b9df1dd2 Update CHANGES and release notes for [GL #3079] 2022-01-13 09:49:58 +01:00
Ondřej Surý
dbd9c31354 Use ISC_R_SHUTTINGDOWN to detect netmgr shutting down
When the dispatch code was refactored in libdns, the netmgr was changed
to return ISC_R_SHUTTINGDOWN when the netmgr is shutting down, and the
ISC_R_CANCELED is now reserved only for situation where the callback was
canceled by the caller.

This change wasn't reflected in the controlconf.c channel which was
still looking for ISC_R_CANCELED as the shutdown event.
2022-01-13 09:14:12 +01:00
Ondřej Surý
a6a09385ee Merge branch 'ondrej/remove-util-copyrights' into 'main'
Remove the copyright handling via util/copyrights

See merge request isc-projects/bind9!5147
2022-01-11 08:58:14 +00:00
Ondřej Surý
e1d2e26360 Remove util/copyrights 2022-01-11 09:05:02 +01:00
Ondřej Surý
58bd26b6cf Update the copyright information in all files in the repository
This commit converts the license handling to adhere to the REUSE
specification.  It specifically:

1. Adds used licnses to LICENSES/ directory

2. Add "isc" template for adding the copyright boilerplate

3. Changes all source files to include copyright and SPDX license
   header, this includes all the C sources, documentation, zone files,
   configuration files.  There are notes in the doc/dev/copyrights file
   on how to add correct headers to the new files.

4. Handle the rest that can't be modified via .reuse/dep5 file.  The
   binary (or otherwise unmodifiable) files could have license places
   next to them in <foo>.license file, but this would lead to cluttered
   repository and most of the files handled in the .reuse/dep5 file are
   system test files.
2022-01-11 09:05:02 +01:00
Ondřej Surý
dbcff56043 Add reuse lint CI job
Instead of checking for the licenses in the misc step, add a separate
job that uses the upstream provided image that has reuse tool installed
and run `reuse lint` from the separate job.
2022-01-10 21:16:28 +01:00
Ondřej Surý
09c32a8d75 Remove the copyright handling via util/copyrights
The copyright handling has been long obsolete, the works is covered as
whole by the COPYING/LICENSE file even if a specific file doesn't have
a copyright header.

The important thing to remember here is that any work is covered by a
copyright law and by explicitly giving it license we provide extra
rights to the users of the works.
2022-01-07 13:30:46 +01:00
Mark Andrews
47a9915888 Merge branch '3025-document-how-rate-limiting-uses-dns-cookies' into 'main'
Document how rate limiting uses DNS cookies

Closes #3025

See merge request isc-projects/bind9!5700
2022-01-07 08:24:09 +00:00
Björn Persson
a59482b85c Document the interation of DNS COOKIE and RRL
Send back BADCOOKIE responses instead of TC=1 when slipping.

Skip rate limiting for UDP requests with valid server cookies.
2022-01-07 13:08:14 +11:00
Ondřej Surý
5d677c1b36 Merge branch '3079-always-enqueue-isc__nm_tcp_resumeread' into 'main'
Always enqueue isc__nm_tcp_resumeread()

Closes #3079

See merge request isc-projects/bind9!5695
2022-01-06 19:10:48 +00:00
Ondřej Surý
5563d06d62 Add CHANGES and release note for [GL #3079] 2022-01-06 10:34:04 -08:00
Ondřej Surý
11c869a3d5 Always enqueue isc__nm_tcp_resumeread()
The isc__nm_tcp_resumeread() was using maybe_enqueue function to enqueue
netmgr event which could case the read callback to be executed
immediately if there was enough data waiting in the TCP queue.

If such thing would happen, the read callback would be called before the
previous read callback was finished and the worker receive buffer would
be still marked "in use" causing a assertion failure.

This would affect only raw TCP channels, e.g. rndc and http statistics.
2022-01-06 10:34:04 -08:00
Petr Špaček
579247395d Merge branch 'vicky-main-patch-33672' into 'main'
Update preface.rst of DNSSEC Guide with new contact info for Josh Kuo

See merge request isc-projects/bind9!5696
2022-01-06 15:19:04 +00:00
Vicky Risk
896fa924f3 Update preface.rst of DNSSEC Guide with new contact info for Josh Kuo 2022-01-06 14:54:40 +00:00
Matthijs Mekking
ca1a664005 Merge branch '3035-dnssec-policy-stops-signing-when-removing-zsk' into 'main'
Fix autosign system test, allow expired zone signatures to be replaced with KSK RRSIGs

Closes #3049 and #3035

See merge request isc-projects/bind9!5617
2022-01-06 08:51:54 +00:00
Matthijs Mekking
6e9fed2d24 Replace RSASHA1 in autosign test with default alg
Change RSASHA1 to $DEFAULT_ALGORITHM to be FIPS compliant.

There is one RSASHA1 occurence left, to test that dynamically adding an
NSEC3PARAM record to an NSEC-only zone fails.
2022-01-06 09:33:36 +01:00
Matthijs Mekking
f3e668d630 Add CHANGES and release note for GL #3049
This is a bugfix worth mentioning.
2022-01-06 09:33:35 +01:00
Matthijs Mekking
fbd559ad0d Update autosign test
Update the autosign system test with new expected behavior.

The 'nozsk.example' zone should have its expired zone signatures
deleted and replaced with signatures generated with the KSK.

The 'inaczsk.example' zone should have its expired zone signatures
deleted and replaced with signatures generated with the KSK.

In both scenarios, signatures are deleted, not retained, so the
"retaining signatures" warning should not be logged.

Furthermore, thsi commit fixex a test bug where the 'awk' command
always returned 0.

Finally, this commit adds a test case for an offline KSK, for the zone
'noksk.example'. In this case the expired signatures should be retained
(despite the zone being bogus, but resigning the DNSKEY RRset with the
ZSK won't help here).
2022-01-06 09:32:32 +01:00
Matthijs Mekking
beeefe35c4 Fix bug introduced by #763 related to offline keys
In some cases we want to keep expired signatures. For example, if the
KSK is offline, we don't want to fall back to signing with the ZSK.
We could remove the signatures, but in any case we end up with a broken
zone.

The change made for GL #763 prevented the behavior to sign the DNSKEY
RRset with the ZSK if the KSK was offline (and signatures were expired).

The change causes the definition of "having both keys": if one key is
offline, we still consider having both keys, so we don't fallback
signing with the ZSK if KSK is offline.

That change also works the other way, if the ZSK is offline, we don't
fallback signing with the KSK.

This commit fixes that, so we only fallback signing zone RRsets with
the KSK, not signing key RRsets with the ZSK.
2022-01-06 09:32:32 +01:00