]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
3 years agoMove random number re-seeding out of the hot path
Tony Finch [Fri, 22 Apr 2022 13:35:36 +0000 (14:35 +0100)] 
Move random number re-seeding out of the hot path

Instead of checking if we need to re-seed for every isc_random call,
seed the random number generator in the libisc global initializer
and the per-thread initializer.

3 years agoMerge branch 'ondrej-unsigned-to-unsigned_int' into 'main'
Ondřej Surý [Mon, 19 Sep 2022 14:02:00 +0000 (14:02 +0000)] 
Merge branch 'ondrej-unsigned-to-unsigned_int' into 'main'

Add semantic patch to use 'unsigned int' instead of 'unsigned'

See merge request isc-projects/bind9!6741

3 years agoUse the semantic patch to do the unsigned -> unsigned int change
Ondřej Surý [Wed, 7 Sep 2022 15:22:47 +0000 (17:22 +0200)] 
Use the semantic patch to do the unsigned -> unsigned int change

Apply the semantic patch on the whole code base to get rid of 'unsigned'
usage in favor of explicit 'unsigned int'.

3 years agoAdd semantic patch to use 'unsigned int' instead of 'unsigned'
Ondřej Surý [Wed, 7 Sep 2022 15:16:17 +0000 (17:16 +0200)] 
Add semantic patch to use 'unsigned int' instead of 'unsigned'

Add a very simple patch to enforce usage of 'unsigned int' instead of
just 'unsigned' for the consistency through the whole source code.

3 years agoMerge branch '3510-disable-stringop-overread' into 'main'
Ondřej Surý [Mon, 19 Sep 2022 13:51:16 +0000 (13:51 +0000)] 
Merge branch '3510-disable-stringop-overread' into 'main'

Disable stringop-overread with gcc-11+ Address Sanitizer

Closes #3510

See merge request isc-projects/bind9!6747

3 years agoDisable stringop-overread with gcc-11+ Address Sanitizer
Ondřej Surý [Thu, 8 Sep 2022 05:33:31 +0000 (07:33 +0200)] 
Disable stringop-overread with gcc-11+ Address Sanitizer

When Address Sanitizer is enabled in gcc-11+, number of false positives
might appear like this:

    netmgr/udp.c: In function 'isc__nm_udp_send':
    netmgr/udp.c:729:13: warning: 'uv_udp_send' reading 16 bytes from a region of size 8 [-Wstringop-overread]
      729 |         r = uv_udp_send(&uvreq->uv_req.udp_send, &sock->uv_handle.udp,
  |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      730 |                         &uvreq->uvbuf, 1, sa, udp_send_cb);
          |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    netmgr/udp.c:729:13: note: referencing argument 3 of type 'const uv_buf_t[0]'
    In file included from ./include/isc/uv.h:17,
                     from ./include/isc/barrier.h:31,
                     from netmgr/udp.c:17:
    /usr/include/uv.h:711:15: note: in a call to function 'uv_udp_send'
      711 | UV_EXTERN int uv_udp_send(uv_udp_send_t* req,
          |               ^~~~~~~~~~~

Disable the warning globally in the autoconf, instead of just locally in
a single CI job, as it might affect people outside our GitLab CI.

3 years agoMerge branch 'ondrej-netmgr-simplify-uv_close' into 'main'
Ondřej Surý [Mon, 19 Sep 2022 12:43:39 +0000 (12:43 +0000)] 
Merge branch 'ondrej-netmgr-simplify-uv_close' into 'main'

Reorder the uv_close() calls to close the socket immediately

See merge request isc-projects/bind9!6704

3 years agoAdd missing isc_refcount_destroy() for isc__nmsocket_t
Ondřej Surý [Mon, 29 Aug 2022 11:42:14 +0000 (13:42 +0200)] 
Add missing isc_refcount_destroy() for isc__nmsocket_t

The destructor for the isc__nmsocket_t was missing call to the
isc_refcount_destroy() on the reference counter, which might lead to
spurious ThreadSanitizer data race warnings if we ever change the
acquire-release memory order in the isc_refcount_decrement().

3 years agoReorder the uv_close() calls to close the socket immediately
Ondřej Surý [Mon, 29 Aug 2022 10:11:37 +0000 (12:11 +0200)] 
Reorder the uv_close() calls to close the socket immediately

Simplify the closing code - during the loopmgr implementation, it was
discovered that the various lists used by the uv_loop_t aren't FIFO, but
LIFO.  See doc/dev/libuv.md for more details.

With this knowledge, we can close the protocol handles (uv_udp_t and
uv_tcp_t) and uv_timer_t at the same time by reordering the uv_close()
calls, and thus making sure that after calling the
isc__nm_stoplistening(), the code will not issue any additional callback
calls (accept, read) on the socket that stopped listening.

This might help with the TLS and DoH shutting down sequence as described
in the [GL #3509] as we now stop the reading, stop the timer and call
the uv_close() as earliest as possible.

3 years agoAdd developer note for the libuv quirks
Ondřej Surý [Mon, 29 Aug 2022 12:30:54 +0000 (14:30 +0200)] 
Add developer note for the libuv quirks

3 years agoMerge branch '3545-prevent-unexpected-client-read-callbacks' into 'main'
Ondřej Surý [Mon, 19 Sep 2022 12:38:04 +0000 (12:38 +0000)] 
Merge branch '3545-prevent-unexpected-client-read-callbacks' into 'main'

Prevent unexpected UDP client read callbacks

Closes #3545

See merge request isc-projects/bind9!6777

3 years agoAdd CHANGES note for [GL #3545]
Ondřej Surý [Thu, 15 Sep 2022 08:17:42 +0000 (10:17 +0200)] 
Add CHANGES note for [GL #3545]

3 years agoImprove the udp_shutdown_read and udp_cancel_read tests
Ondřej Surý [Mon, 19 Sep 2022 09:40:15 +0000 (11:40 +0200)] 
Improve the udp_shutdown_read and udp_cancel_read tests

In the udp_shutdown_read unit test, delay the isc_loopmgr_shutdown() to
the send callback, and in the udp_cancel_read test wait for a single
timed out test, then read again, send an UDP packet and cancel the read
from the send callback.

3 years agoPrevent unexpected UDP client read callbacks
Ondřej Surý [Thu, 15 Sep 2022 07:48:34 +0000 (09:48 +0200)] 
Prevent unexpected UDP client read callbacks

The network manager UDP code was misinterpreting when the libuv called
the udp_recv_cb with nrecv == 0 and addr == NULL -> this doesn't really
mean that the "stream" has ended, but the libuv indicates that the
receive buffer can be freed.  This could lead to assertion failure in
the code that calls isc_nm_read() from the network manager read callback
due to the extra spurious callbacks.

Properly handle the extra callback calls from the libuv in the client
read callback, and refactor the UDP isc_nm_read() implementation to be
synchronous, so no datagram is lost between the time that we stop the
reading from the UDP socket and we restart it again in the asychronous
udpread event.

Add a unit test that tests the isc_nm_read() call from the read
callback to receive two datagrams.

3 years agoMerge branch '3522-update-detach' into 'main'
Evan Hunt [Thu, 15 Sep 2022 18:33:51 +0000 (18:33 +0000)] 
Merge branch '3522-update-detach' into 'main'

fix an incorrect detach in update processing

Closes #3522

See merge request isc-projects/bind9!6722

3 years agoCHANGES for [GL #3522]
Evan Hunt [Fri, 2 Sep 2022 21:47:12 +0000 (14:47 -0700)] 
CHANGES for [GL #3522]

3 years agofix an incorrect detach in update processing
Evan Hunt [Fri, 2 Sep 2022 21:44:58 +0000 (14:44 -0700)] 
fix an incorrect detach in update processing

when processing UDPATE requests, hold the request handle until
we either drop the request or respond to it.

3 years agoMerge branch '3427-tcp-system-test-bump-socket.create_connection-timeout' into 'main'
Michal Nowak [Thu, 15 Sep 2022 10:19:51 +0000 (10:19 +0000)] 
Merge branch '3427-tcp-system-test-bump-socket.create_connection-timeout' into 'main'

Bump socket.create_connection() timeout to 10 seconds

Closes #3427

See merge request isc-projects/bind9!6757

3 years agoBump socket.create_connection() timeout to 10 seconds
Michal Nowak [Fri, 9 Sep 2022 14:41:00 +0000 (16:41 +0200)] 
Bump socket.create_connection() timeout to 10 seconds

The tcp Pytest on OpenBSD fairly reliably fails when receive_tcp()
on a socket is attempted:

    >           (response, rtime) = dns.query.receive_tcp(sock, timeout())

    tests-tcp.py:50:
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    /usr/local/lib/python3.9/site-packages/dns/query.py:659: in receive_tcp
        ldata = _net_read(sock, 2, expiration)
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    sock = <socket.socket [closed] fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>
    count = 2, expiration = 1662719959.8106785

        def _net_read(sock, count, expiration):
            """Read the specified number of bytes from sock.  Keep trying until we
            either get the desired amount, or we hit EOF.
            A Timeout exception will be raised if the operation is not completed
            by the expiration time.
            """
            s = b''
            while count > 0:
                try:
    >               n = sock.recv(count)
    E               socket.timeout: timed out

This is because the socket is already closed.

Bump the socket connection timeout to 10 seconds.

3 years agoMerge branch '3542-gracefuly-handle-cancelled-http-read-during-sending' into 'main'
Ondřej Surý [Thu, 15 Sep 2022 08:57:19 +0000 (08:57 +0000)] 
Merge branch '3542-gracefuly-handle-cancelled-http-read-during-sending' into 'main'

Handle canceled read during sending data over stats channel

Closes #3542

See merge request isc-projects/bind9!6773

3 years agoAdd CHANGES and release note for [GL #3542]
Ondřej Surý [Fri, 9 Sep 2022 08:48:13 +0000 (10:48 +0200)] 
Add CHANGES and release note for [GL #3542]

3 years agoProvide stronger wording about the security of statistics channel
Ondřej Surý [Wed, 14 Sep 2022 12:18:32 +0000 (14:18 +0200)] 
Provide stronger wording about the security of statistics channel

Add more text about the importance of properly securing the statistics
channel and what is and what is not considered a security vulnerability.

3 years agoHandle canceled read during sending data over stats channel
Ondřej Surý [Thu, 8 Sep 2022 16:24:57 +0000 (18:24 +0200)] 
Handle canceled read during sending data over stats channel

An assertion failure would be triggered when the TCP connection
is canceled during sending the data back to the client.

Don't require the state to be `RECV` on non successful read to
gracefully handle canceled TCP connection during the SEND state of the
HTTPD channel.

3 years agoMerge branch '1176-add-support-for-sd_notify-interface-to-better-integrate-on-linux...
Petr Špaček [Thu, 15 Sep 2022 08:17:20 +0000 (08:17 +0000)] 
Merge branch '1176-add-support-for-sd_notify-interface-to-better-integrate-on-linux' into 'main'

Add support for reporting status via sd_notify()

Closes #1176

See merge request isc-projects/bind9!5514

3 years agoAdd CHANGES and release note for [GL #1176]
Ondřej Surý [Thu, 21 Oct 2021 08:02:45 +0000 (10:02 +0200)] 
Add CHANGES and release note for [GL #1176]

3 years agoAdd support for reporting status via sd_notify()
Ondřej Surý [Wed, 20 Oct 2021 16:14:49 +0000 (18:14 +0200)] 
Add support for reporting status via sd_notify()

sd_notify() may be called by a service to notify the service manager
about state changes. It can be used to send arbitrary information,
encoded in an environment-block-like string. Most importantly, it can be
used for start-up completion notification.

Add libsystemd check to autoconf script and when the library is detected
add calls to sd_notify() around the server->reload_status changes.

Co-authored-by: Petr Špaček <pspacek@isc.org>
3 years agoMerge branch 'pspacek/log-no-recursion-reason' into 'main'
Petr Špaček [Thu, 15 Sep 2022 07:40:17 +0000 (07:40 +0000)] 
Merge branch 'pspacek/log-no-recursion-reason' into 'main'

Log reasons why ACL denied recursion or cache peek

See merge request isc-projects/bind9!6669

3 years agoAdd tests for the new log messages with refusal reason
Evan Hunt [Wed, 14 Sep 2022 19:49:20 +0000 (12:49 -0700)] 
Add tests for the new log messages with refusal reason

Update the allow-query test to check for the new log messages.

3 years agoCHANGES note for [GL !6669]
Petr Špaček [Wed, 14 Sep 2022 10:32:41 +0000 (12:32 +0200)] 
CHANGES note for [GL !6669]

3 years agoLog reason why cache peek is not available
Petr Špaček [Fri, 5 Aug 2022 13:21:35 +0000 (15:21 +0200)] 
Log reason why cache peek is not available

Log which ACL caused RD=0 query into cache to be refused.
Expected performance impact is negligible.

3 years agoLog reason why recursion is not available
Petr Špaček [Fri, 5 Aug 2022 12:03:30 +0000 (14:03 +0200)] 
Log reason why recursion is not available

Log which ACL caused RA=0 condition.
Expected performance impact is negligible.

3 years agoMerge branch '3525-key-id-clashes-across-algorithms-cause-problems-with-statistics...
Mark Andrews [Thu, 15 Sep 2022 01:04:17 +0000 (01:04 +0000)] 
Merge branch '3525-key-id-clashes-across-algorithms-cause-problems-with-statistics' into 'main'

Resolve "key id clashes across algorithms cause problems with statistics"

Closes #3525

See merge request isc-projects/bind9!6745

3 years agoAdd a release note for [GL #3525]
Mark Andrews [Thu, 8 Sep 2022 00:01:25 +0000 (10:01 +1000)] 
Add a release note for [GL #3525]

3 years agoAdd a CHANGES note for [GL #3525]
Mark Andrews [Wed, 7 Sep 2022 23:59:10 +0000 (09:59 +1000)] 
Add a CHANGES note for [GL #3525]

3 years agoEmit key algorithm + key id in dnssec signing statsistics
Mark Andrews [Wed, 7 Sep 2022 23:48:27 +0000 (09:48 +1000)] 
Emit key algorithm + key id in dnssec signing statsistics

If there was a collision of key id across algorithms it was not
possible to determine where counter applies to which algorithm for
xml statistics while for json only one of the values was emitted.
The key names are now "<algorithm-number>+<id>" (e.g. "8+54274").

3 years agoMerge branch 'each-remove-resolve' into 'main'
Evan Hunt [Wed, 14 Sep 2022 17:20:52 +0000 (17:20 +0000)] 
Merge branch 'each-remove-resolve' into 'main'

remove 'resolve' test binary

See merge request isc-projects/bind9!6733

3 years agoremove 'resolve' test binary
Evan Hunt [Tue, 6 Sep 2022 20:35:27 +0000 (13:35 -0700)] 
remove 'resolve' test binary

the 'resolve' binary was added for testing dns_client as part of
the export library. the export libraries are no longer supported,
and tests using 'delv' provide the same coverage, so 'resolve' can
be removed now.

3 years agoMerge branch 'each-cleanup-dns_request' into 'main'
Evan Hunt [Wed, 14 Sep 2022 17:14:01 +0000 (17:14 +0000)] 
Merge branch 'each-cleanup-dns_request' into 'main'

remove dns_request_create()

See merge request isc-projects/bind9!6753

3 years agomerge dns_request_createvia() into dns_request_create()
Evan Hunt [Thu, 8 Sep 2022 18:43:41 +0000 (11:43 -0700)] 
merge dns_request_createvia() into dns_request_create()

dns_request_create() was a front-end to dns_request_createvia() that
was only used by test binaries. dns_request_createvia() has been
renamed to dns_request_create(), and the test programs that formerly
used dns_request_create() have been updated to use the new parameters.

3 years agoMerge branch '3399-random-device-ancient' into 'main'
Evan Hunt [Wed, 14 Sep 2022 16:41:15 +0000 (16:41 +0000)] 
Merge branch '3399-random-device-ancient' into 'main'

flag "random-device" as ancient

Closes #3399

See merge request isc-projects/bind9!6769

3 years agoCHANGES for [GL #3399]
Evan Hunt [Wed, 14 Sep 2022 01:17:55 +0000 (18:17 -0700)] 
CHANGES for [GL #3399]

3 years agoflag "random-device" as ancient
Evan Hunt [Wed, 14 Sep 2022 01:13:51 +0000 (18:13 -0700)] 
flag "random-device" as ancient

the "random-device" option was made non-functional in 9.13. this commit
removes it from the configuration parser; setting it is now an error.

3 years agoMerge branch '3537-idna-test' into 'main'
Tony Finch [Wed, 14 Sep 2022 12:39:08 +0000 (12:39 +0000)] 
Merge branch '3537-idna-test' into 'main'

Fix dig idna test on Debian 10 "buster"

Closes #3537

See merge request isc-projects/bind9!6767

3 years agoFix dig idna test on Debian 10 "buster"
Tony Finch [Tue, 13 Sep 2022 16:17:55 +0000 (17:17 +0100)] 
Fix dig idna test on Debian 10 "buster"

The test expected `xn--ah-` to be treated as a syntax error (punycode
requires letters after the last hyphen) but libidn2 on buster
converted the label to `ah` instead. To avoid this bug, change the
invalid label to `xn--0000h` which translates to an out-of-range
unicode codepoint (beyond the maximum value) which is corectly
trated as invalid in older libidn2.

3 years agoMerge branch '3536-out-of-tree' into 'main'
Tony Finch [Wed, 14 Sep 2022 10:23:29 +0000 (10:23 +0000)] 
Merge branch '3536-out-of-tree' into 'main'

Fix out-of-tree tests

Closes #3536

See merge request isc-projects/bind9!6766

3 years agoFix out-of-tree tests
Tony Finch [Tue, 13 Sep 2022 10:35:08 +0000 (11:35 +0100)] 
Fix out-of-tree tests

The change to `testsock.pl` in commit 258a896a broke the system
tests in out-of-tree builds because `ifconfig.sh.in` is not
copied to the worktree. Use `ifconfig.sh` instead.

3 years agoMerge branch '2295-add-the-ability-to-specify-that-a-server-supports-cookies' into... 6770/head
Mark Andrews [Wed, 14 Sep 2022 01:36:42 +0000 (01:36 +0000)] 
Merge branch '2295-add-the-ability-to-specify-that-a-server-supports-cookies' into 'main'

Resolve "Add the ability to specify that a server supports COOKIES."

Closes #2295

See merge request isc-projects/bind9!4410

3 years agoAdd CHANGES and release notes for [GL #2295]
Mark Andrews [Mon, 23 Nov 2020 23:44:40 +0000 (10:44 +1100)] 
Add CHANGES and release notes for [GL #2295]

3 years agoCheck "require-cookie yes;" triggers TCP fallback on no cookie
Mark Andrews [Wed, 10 Nov 2021 05:41:46 +0000 (16:41 +1100)] 
Check "require-cookie yes;" triggers TCP fallback on no cookie

3 years agoAdd server clause require-cookie
Mark Andrews [Mon, 23 Nov 2020 23:44:40 +0000 (10:44 +1100)] 
Add server clause require-cookie

Specifies if an UDP response requires a DNS COOKIE or not.
Fallback to TCP if not present and not TSIG signed.

3 years agoMerge branch '3520-rndc-shutdown-hang' into 'main'
Evan Hunt [Mon, 12 Sep 2022 20:34:32 +0000 (20:34 +0000)] 
Merge branch '3520-rndc-shutdown-hang' into 'main'

prevent a possible shutdown hang in rndc

See merge request isc-projects/bind9!6734

3 years agoprevent a possible shutdown hang in rndc
Evan Hunt [Tue, 6 Sep 2022 21:13:23 +0000 (14:13 -0700)] 
prevent a possible shutdown hang in rndc

In rndc_recvdone(), if 'sends' was not 0, then 'recvs' was not
decremented, in which case isc_loopmgr_shutdown() was never reached,
which could cause a hang. (This has not been observed to happen, but
the code was incorrect on examination.)

3 years agoMerge branch 'fanf-tolower' into 'main'
Tony Finch [Mon, 12 Sep 2022 12:08:06 +0000 (12:08 +0000)] 
Merge branch 'fanf-tolower' into 'main'

De-duplicate `tolower()`

See merge request isc-projects/bind9!6516

3 years agoCHANGES note for [GL !6516]
Tony Finch [Thu, 30 Jun 2022 15:31:15 +0000 (16:31 +0100)] 
CHANGES note for [GL !6516]

[cleanup] Move the duplicated ASCII case conversion tables to
isc_ascii where they can be shared, and replace the
various hot-path tolower() loops with calls to new
isc_ascii implementations.

3 years agoTests and benchmark for isc_ascii
Tony Finch [Sat, 25 Jun 2022 14:29:54 +0000 (15:29 +0100)] 
Tests and benchmark for isc_ascii

The test is to verify basic functionality. The benchmark compares a
number of alternative tolower() implementations on large and small
strings.

3 years agoGeneral-purpose unrolled ASCII tolower() loops
Tony Finch [Mon, 27 Jun 2022 11:57:28 +0000 (12:57 +0100)] 
General-purpose unrolled ASCII tolower() loops

When converting a string to lower case, the compiler is able to
autovectorize nicely, so a nice simple implementation is also very
fast, comparable to memcpy().

Comparisons are more difficult for the compiler, so we convert eight
bytes at a time using "SIMD within a register" tricks. Experiments
indicate it's best to stick to simple loops for shorter strings and
the remainder of long strings.

3 years agoConsolidate some ASCII tables in `isc/ascii` and `isc/hex`
Tony Finch [Fri, 24 Jun 2022 21:11:02 +0000 (22:11 +0100)] 
Consolidate some ASCII tables in `isc/ascii` and `isc/hex`

There were a number of places that had copies of various ASCII
tables (case conversion, hex and decimal conversion) that are intended
to be faster than the ctype.h macros, or avoid locale pollution.

Move them into libisc, and wrap the lookup tables with macros that
avoid the ctype.h gotchas.

3 years agoMerge branch '3519-macos-tests' into 'main'
Tony Finch [Mon, 12 Sep 2022 11:14:27 +0000 (11:14 +0000)] 
Merge branch '3519-macos-tests' into 'main'

System test fixes for macOS

Closes #3519

See merge request isc-projects/bind9!6719

3 years agoSkip the xfer test when Net::DNS is too old
Tony Finch [Thu, 1 Sep 2022 11:08:52 +0000 (12:08 +0100)] 
Skip the xfer test when Net::DNS is too old

This allows the system tests to run to completion on macOS
without requiring extra modules from CPAN.

3 years agoThe system tests are using another IP address
Tony Finch [Wed, 31 Aug 2022 20:09:06 +0000 (21:09 +0100)] 
The system tests are using another IP address

Reduce the number of places that know about the number of IP addresses
required by the system tests, by changing `testsock.pl` to read the
`max` from `ifconfig.sh.in`. This should make the test runner fail
early with a clear message when the interfaces have been set up by an
obsolete script.

Add comments to cross-reference `ifconfig.sh.in`, `testsock.pl`, and
`org.isc.bind.system` to make it easier to remember what needs
updating when an IP address is added.

3 years agoMerge branch '3527-dig-idna-relaxed' into 'main'
Tony Finch [Mon, 12 Sep 2022 11:09:38 +0000 (11:09 +0000)] 
Merge branch '3527-dig-idna-relaxed' into 'main'

More lenient IDNA processing in dig

Closes #3527

See merge request isc-projects/bind9!6738

3 years agoCHANGES and release note for [GL #3527]
Tony Finch [Tue, 16 Aug 2022 15:02:45 +0000 (16:02 +0100)] 
CHANGES and release note for [GL #3527]

[func] When an international domain name is not valid, DiG will
now pass it through unchanged, instead of stopping with
an error message. [GL #3527]

3 years agoMore lenient IDNA processing in dig
Tony Finch [Mon, 5 Sep 2022 14:49:49 +0000 (15:49 +0100)] 
More lenient IDNA processing in dig

If there are any problems with IDN processing, DiG will now quietly
handle the name as if IDN were disabled. This means that international
query names are rendered verbatim on the wire, and ACE names are
printed raw without conversion to UTF8.

If you want to check the syntax of international domain names,
use the `idn2` utility.

3 years agoMerge branch '3528-catz-test-faster' into 'main'
Tony Finch [Mon, 12 Sep 2022 10:31:10 +0000 (10:31 +0000)] 
Merge branch '3528-catz-test-faster' into 'main'

Speed up the `catz` system test

Closes #3528

See merge request isc-projects/bind9!6742

3 years agoSpeed up the `catz` system test
Tony Finch [Wed, 7 Sep 2022 16:57:58 +0000 (17:57 +0100)] 
Speed up the `catz` system test

Do not delay sending NOFIFY messages, and allow catalog zones to
update every second instead of every 5 seconds.

3 years agoMerge branch '3531-initialize-struct-server' into 'main'
Tony Finch [Mon, 12 Sep 2022 10:12:42 +0000 (10:12 +0000)] 
Merge branch '3531-initialize-struct-server' into 'main'

Ensure that named_server_t is properly initialized

Closes #3531

See merge request isc-projects/bind9!6755

3 years agoEnsure that named_server_t is properly initialized
Tony Finch [Fri, 9 Sep 2022 07:21:10 +0000 (08:21 +0100)] 
Ensure that named_server_t is properly initialized

There was a ubsan error reporting an invalid value for interface_auto
(a boolean value cannot be 190) because it was not initialized. To
avoid this problem happening again, ensure the whole of the server
structure is initialized to zero before setting the (relatively few)
non-zero elements.

3 years agoMerge branch '3534-fix-error-reporting-for-posix-threads-functions' into 'main'
Michał Kępień [Fri, 9 Sep 2022 18:28:07 +0000 (18:28 +0000)] 
Merge branch '3534-fix-error-reporting-for-posix-threads-functions' into 'main'

Fix error reporting for POSIX Threads functions

See merge request isc-projects/bind9!6756

3 years agoFix error reporting for POSIX Threads functions
Michał Kępień [Fri, 9 Sep 2022 18:25:47 +0000 (20:25 +0200)] 
Fix error reporting for POSIX Threads functions

Commit 3608abc8fa6a33046e1d34a0789cf7c9547f09ad inadvertently carried
over a mistake in logging pthread_cond_init() errors to the
ERRNO_CHECK() preprocessor macro: instead of passing the value returned
by a given pthread_*() function to strerror_r(), ERRNO_CHECK() passes
the errno variable to strerror_r().  This causes bogus error reports
because POSIX Threads API functions do not set the errno variable.

Fix by passing the value returned by a given pthread_*() function
instead of the errno variable to strerror_r().  Since this change makes
the name of the affected macro (ERRNO_CHECK()) confusing, rename the
latter to PTHREADS_RUNTIME_CHECK().  Also log the integer error value
returned by a given pthread_*() function verbatim to rule out any
further confusion in runtime error reporting.

3 years agoMerge branch 'michal/set-up-version-and-release-notes-for-bind-9.19.6' into 'main'
Michał Kępień [Fri, 9 Sep 2022 18:23:08 +0000 (18:23 +0000)] 
Merge branch 'michal/set-up-version-and-release-notes-for-bind-9.19.6' into 'main'

Set up version and release notes for BIND 9.19.6

See merge request isc-projects/bind9!6758

3 years agoSet up release notes for BIND 9.19.6
Michał Kępień [Fri, 9 Sep 2022 17:56:43 +0000 (19:56 +0200)] 
Set up release notes for BIND 9.19.6

3 years agoUpdate BIND version to 9.19.6-dev
Michał Kępień [Fri, 9 Sep 2022 17:56:43 +0000 (19:56 +0200)] 
Update BIND version to 9.19.6-dev

3 years agoMerge branch 'michal/add-placeholder-entries-to-CHANGES' into 'main'
Michał Kępień [Thu, 8 Sep 2022 08:55:46 +0000 (08:55 +0000)] 
Merge branch 'michal/add-placeholder-entries-to-CHANGES' into 'main'

Add placeholder entries to CHANGES

See merge request isc-projects/bind9!6750

3 years agoAdd placeholder entries to CHANGES
Michał Kępień [Thu, 8 Sep 2022 08:42:01 +0000 (10:42 +0200)] 
Add placeholder entries to CHANGES

Add placeholders for the following issues:

  - [GL #3394]
  - [GL #3487]
  - [GL #3491]
  - [GL #3493]
  - [GL #3517]

3 years agoMerge branch '3459-rrl-wildcard-handling' into 'main'
Michał Kępień [Thu, 8 Sep 2022 07:35:43 +0000 (07:35 +0000)] 
Merge branch '3459-rrl-wildcard-handling' into 'main'

Make RRL code treat all QNAMEs subject to wildcard processing as the same name

Closes #3459

See merge request isc-projects/bind9!6744

3 years agoAdd CHANGES and release notes for [GL #3459]
Aram Sargsyan [Mon, 25 Jul 2022 14:59:41 +0000 (14:59 +0000)] 
Add CHANGES and release notes for [GL #3459]

3 years agoDocument RRL processing for wildcard names
Aram Sargsyan [Mon, 25 Jul 2022 14:13:28 +0000 (14:13 +0000)] 
Document RRL processing for wildcard names

All valid wildcard domain names are interpreted as the zone's origin
name concatenated to the "*" name.

3 years agoFix RRL responses-per-second bypass using wildcard names
Aram Sargsyan [Mon, 25 Jul 2022 13:55:03 +0000 (13:55 +0000)] 
Fix RRL responses-per-second bypass using wildcard names

It is possible to bypass Response Rate Limiting (RRL)
`responses-per-second` limitation using specially crafted wildcard
names, because the current implementation, when encountering a found
DNS name generated from a wildcard record, just strips the leftmost
label of the name before making a key for the bucket.

While that technique helps with limiting random requests like
<random>.example.com (because all those requests will be accounted
as belonging to a bucket constructed from "example.com" name), it does
not help with random names like subdomain.<random>.example.com.

The best solution would have been to strip not just the leftmost
label, but as many labels as necessary until reaching the suffix part
of the wildcard record from which the found name is generated, however,
we do not have that information readily available in the context of RRL
processing code.

Fix the issue by interpreting all valid wildcard domain names as
the zone's origin name concatenated to the "*" name, so they all will
be put into the same bucket.

3 years agoMerge branch 'matthijs-fix-intermittent-inline-system-test-failure' into 'main'
Matthijs Mekking [Wed, 7 Sep 2022 15:10:56 +0000 (15:10 +0000)] 
Merge branch 'matthijs-fix-intermittent-inline-system-test-failure' into 'main'

Fix intermittent inline system test failure

See merge request isc-projects/bind9!6708

3 years agoUpdate inline system test, zone 'retransfer3.'
Matthijs Mekking [Tue, 30 Aug 2022 08:04:16 +0000 (10:04 +0200)] 
Update inline system test, zone 'retransfer3.'

The zone 'retransfer3.' tests whether zones that 'rndc signing
-nsec3param' requests are queued even if the zone is not loaded.

The test assumes that if 'rndc signing -list' shows that the zone is
done signing with two keys, and there are no NSEC3 chains pending, the
zone is done handling the '-nsec3param' queued requests. However, it
is possible that the 'rndc signing -list' command is received before
the corresponding privatetype records are added to the zone (the records
that are used to retrieve the signing status with 'rndc signing').

This is what happens in test failure
https://gitlab.isc.org/isc-projects/bind9/-/jobs/2722752.

The 'rndc signing -list retransfer3' is thus an unreliable check.
It is simpler to just remove the check and wait for a certain amount
of time and check whether ns3 has re-signed the zone using NSEC3.

3 years agoMerge branch '3508-fix-building-without-doh-support' into 'main'
Michał Kępień [Wed, 7 Sep 2022 11:21:57 +0000 (11:21 +0000)] 
Merge branch '3508-fix-building-without-doh-support' into 'main'

Fix building without DoH support

Closes #3508

See merge request isc-projects/bind9!6737

3 years agoFix building with --disable-doh
Michał Kępień [Wed, 7 Sep 2022 10:50:08 +0000 (12:50 +0200)] 
Fix building with --disable-doh

Commit b69e783164cd50e3306364668558e460617ee8fc inadvertently caused
builds using the --disable-doh switch to fail, by putting the
declaration of the isc__nm_async_settlsctx() function inside an #ifdef
block that is only evaluated when DNS-over-HTTPS support is enabled.
This results in the following compilation errors being triggered:

    netmgr/netmgr.c:2657:1: error: no previous prototype for 'isc__nm_async_settlsctx' [-Werror=missing-prototypes]
     2657 | isc__nm_async_settlsctx(isc__networker_t *worker, isc__netievent_t *ev0) {
          | ^~~~~~~~~~~~~~~~~~~~~~~

Fix by making the declaration of the isc__nm_async_settlsctx() function
in lib/isc/netmgr/netmgr-int.h visible regardless of whether
DNS-over-HTTPS support is enabled or not.

3 years agoTest the --disable-doh switch in GitLab CI
Michał Kępień [Wed, 7 Sep 2022 10:50:08 +0000 (12:50 +0200)] 
Test the --disable-doh switch in GitLab CI

Use the --disable-doh switch for all Ubuntu 22.04 builds in GitLab CI to
immediately flag any code changes that would break such builds.

3 years agoMerge branch 'each-interface-magic' into 'main'
Evan Hunt [Wed, 7 Sep 2022 04:47:09 +0000 (04:47 +0000)] 
Merge branch 'each-interface-magic' into 'main'

when creating an interface, set magic before linking

See merge request isc-projects/bind9!6735

3 years agowhen creating an interface, set magic before linking
Evan Hunt [Wed, 7 Sep 2022 00:12:14 +0000 (17:12 -0700)] 
when creating an interface, set magic before linking

set the magic number in a newly-created interface object
before appending it to mgr->interfaces in order to prevent
a possible assertion.

3 years agoMerge branch '3364-various-coverity-issues-after-dns_message_gettemp-cleanup' into...
Mark Andrews [Tue, 6 Sep 2022 15:25:39 +0000 (15:25 +0000)] 
Merge branch '3364-various-coverity-issues-after-dns_message_gettemp-cleanup' into 'main'

Resolve "Various Coverity issues after dns_message_gettemp* cleanup"

Closes #3364

See merge request isc-projects/bind9!6588

3 years agoRemove dead code
Mark Andrews [Mon, 18 Jul 2022 08:00:30 +0000 (18:00 +1000)] 
Remove dead code

    *** CID 352817:  Control flow issues  (DEADCODE) /lib/ns/xfrout.c: 1568 in sendstream()
    1562
    1563      /* Advance lasttsig to be the last TSIG generated */
    1564      CHECK(dns_message_getquerytsig(msg, xfr->mctx, &xfr->lasttsig));
    1565
    1566     failure:
    1567      if (msgname != NULL) {
    >>>     CID 352817:  Control flow issues  (DEADCODE)
    >>>     Execution cannot reach this statement: "if (msgrds != NULL) {
      if ...".
    1568      if (msgrds != NULL) {
    1569      if (dns_rdataset_isassociated(msgrds)) {
    1570      dns_rdataset_disassociate(msgrds);
    1571      }
    1572      dns_message_puttemprdataset(msg, &msgrds);
    1573      }

3 years agoRemove dead code
Mark Andrews [Mon, 18 Jul 2022 07:39:12 +0000 (17:39 +1000)] 
Remove dead code

    *** CID 352816:  Control flow issues  (DEADCODE) /lib/ns/query.c: 8443 in query_dns64()
    8437     cleanup:
    8438      if (buffer != NULL) {
    8439      isc_buffer_free(&buffer);
    8440      }
    8441
    8442      if (dns64_rdata != NULL) {
    >>>     CID 352816:  Control flow issues  (DEADCODE)
    >>>     Execution cannot reach this statement: "dns_message_puttemprdata(cl...".
    8443      dns_message_puttemprdata(client->message, &dns64_rdata);
    8444      }
    8445
    8446      if (dns64_rdataset != NULL) {
    8447      dns_message_puttemprdataset(client->message, &dns64_rdataset);
    8448      }

3 years agoRemove dead code
Mark Andrews [Mon, 18 Jul 2022 07:34:30 +0000 (17:34 +1000)] 
Remove dead code

    *** CID 352812:  Control flow issues  (DEADCODE) /lib/ns/query.c: 8584 in query_filter64()
    8578     cleanup:
    8579      if (buffer != NULL) {
    8580      isc_buffer_free(&buffer);
    8581      }
    8582
    8583      if (myrdata != NULL) {
    >>>     CID 352812:  Control flow issues  (DEADCODE)
    >>>     Execution cannot reach this statement: "dns_message_puttemprdata(cl...".
    8584      dns_message_puttemprdata(client->message, &myrdata);
    8585      }
    8586
    8587      if (myrdataset != NULL) {
    8588      dns_message_puttemprdataset(client->message, &myrdataset);
    8589      }

3 years agoSilence REVERSE_INULL
Mark Andrews [Mon, 18 Jul 2022 07:21:25 +0000 (17:21 +1000)] 
Silence REVERSE_INULL

Remove unnecessary != NULL checks

    *** CID 352809:  Null pointer dereferences  (REVERSE_INULL) /lib/dns/message.c: 4654 in dns_message_buildopt()
    4648      if (rdata != NULL) {
    4649      dns_message_puttemprdata(message, &rdata);
    4650      }
    4651      if (rdataset != NULL) {
    4652      dns_message_puttemprdataset(message, &rdataset);
    4653      }
    >>>     CID 352809:  Null pointer dereferences  (REVERSE_INULL)
    >>>     Null-checking "rdatalist" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
    4654      if (rdatalist != NULL) {
    4655      dns_message_puttemprdatalist(message, &rdatalist);
    4656      }
    4657      return (result);
    4658     }
    4659

3 years agoRemove dead code in xfrin.c
Mark Andrews [Mon, 18 Jul 2022 06:42:00 +0000 (16:42 +1000)] 
Remove dead code in xfrin.c

also removed unnecessary 'msg != NULL' check

   *** CID 352815:  Control flow issues  (DEADCODE) /lib/dns/xfrin.c: 1363 in xfrin_send_request()
   1357      isc_nmhandle_attach(send_xfr->handle, &xfr->sendhandle);
   1358      isc_refcount_increment0(&send_xfr->sends);
   1359      isc_nm_send(xfr->handle, &region, xfrin_send_done, send_xfr);
   1360
   1361     failure:
   1362      if (qname != NULL) {
   >>>     CID 352815:  Control flow issues  (DEADCODE)
   >>>     Execution cannot reach this statement: "dns_message_puttempname(msg...".
   1363      dns_message_puttempname(msg, &qname);
   1364      }
   1365      if (qrdataset != NULL) {
   1366      dns_message_puttemprdataset(msg, &qrdataset);
   1367      }
   1368      if (msg != NULL) {

   *** CID 352819:  Control flow issues  (DEADCODE) /lib/dns/xfrin.c: 1366 in xfrin_send_request()
   1360
   1361     failure:
   1362      if (qname != NULL) {
   1363      dns_message_puttempname(msg, &qname);
   1364      }
   1365      if (qrdataset != NULL) {
   >>>     CID 352819:  Control flow issues  (DEADCODE)
   >>>     Execution cannot reach this statement: "dns_message_puttemprdataset...".
   1366      dns_message_puttemprdataset(msg, &qrdataset);
   1367      }
   1368      if (msg != NULL) {
   1369      dns_message_detach(&msg);
   1370      }
   1371      if (soatuple != NULL) {

3 years agoMerge branch '3518-libxml2-deprecated-functions' into 'main'
Arаm Sаrgsyаn [Tue, 6 Sep 2022 09:42:01 +0000 (09:42 +0000)] 
Merge branch '3518-libxml2-deprecated-functions' into 'main'

Do not use libxml2 deprecated functions

Closes #3518

See merge request isc-projects/bind9!6727

3 years agoAdd CHANGES note for [GL #3518]
Aram Sargsyan [Mon, 5 Sep 2022 10:01:33 +0000 (10:01 +0000)] 
Add CHANGES note for [GL #3518]

3 years agoDo not use libxml2 deprecated functions
Aram Sargsyan [Mon, 5 Sep 2022 09:59:44 +0000 (09:59 +0000)] 
Do not use libxml2 deprecated functions

The usage of xmlInitThreads() and xmlCleanupThreads() functions in
libxml2 is now marked as deprecated, and these functions will be made
private in the future.

Use xmlInitParser() and xmlCleanupParser() instead of them.

3 years agoMerge branch 'aram/isc_nm_listentlsdns-error-path-bugfix' into 'main'
Arаm Sаrgsyаn [Tue, 6 Sep 2022 08:25:39 +0000 (08:25 +0000)] 
Merge branch 'aram/isc_nm_listentlsdns-error-path-bugfix' into 'main'

Fix isc_nm_listentlsdns() error path bug

See merge request isc-projects/bind9!6728

3 years agoFix isc_nm_listentlsdns() error path bug
Aram Sargsyan [Mon, 5 Sep 2022 14:42:32 +0000 (14:42 +0000)] 
Fix isc_nm_listentlsdns() error path bug

The isc_nm_listentlsdns() function erroneously calls
isc__nm_tcpdns_stoplistening() instead of isc__nm_tlsdns_stoplistening()
when something goes wrong, which can cause an assertion failure.

3 years agoMerge branch '3485-dig-fallback-to-idna2003' into 'main'
Ondřej Surý [Mon, 5 Sep 2022 08:36:48 +0000 (08:36 +0000)] 
Merge branch '3485-dig-fallback-to-idna2003' into 'main'

Allow fallback to IDNA2003 processing

Closes #3485

See merge request isc-projects/bind9!6699

3 years agoAdd CHANGES and release note for [GL #3485]
Ondřej Surý [Fri, 26 Aug 2022 10:28:10 +0000 (12:28 +0200)] 
Add CHANGES and release note for [GL #3485]

3 years agoEnable the IDNA2003 domain names in the idna system test
Ondřej Surý [Fri, 26 Aug 2022 11:10:22 +0000 (13:10 +0200)] 
Enable the IDNA2003 domain names in the idna system test

Allow the IDNA2003 tests to succeed after the fallback to IDNA2003 was
implemented.

3 years agoAllow fallback to IDNA2003 processing
Ondřej Surý [Fri, 26 Aug 2022 10:24:07 +0000 (12:24 +0200)] 
Allow fallback to IDNA2003 processing

In several cases where IDNA2008 mappings do not exist whereas IDNA2003
mappings do, dig was failing to process the suplied domain name.  Take a
backwards compatible approach, and convert the domain to IDNA2008 form,
and if that fails try the IDNA2003 conversion.