]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
2 years agoMerge branch 'each-qp-lookup-iterator' into 'main'
Evan Hunt [Wed, 6 Dec 2023 19:17:20 +0000 (19:17 +0000)] 
Merge branch 'each-qp-lookup-iterator' into 'main'

add an iterator argument to dns_qp_lookup()

See merge request isc-projects/bind9!8468

2 years agofix another dns_qp_lookup() iterator bug
Evan Hunt [Mon, 4 Dec 2023 19:21:40 +0000 (11:21 -0800)] 
fix another dns_qp_lookup() iterator bug

there was another edge case in which an iterator could be positioned at
the wrong node after dns_qp_lookup().  when searching for a key, it's
possible to reach a dead-end branch that doesn't match, because the
branch offset point is *after* the point where the search key differs
from the branch's contents.

for example, if searching for the key "mop", we could reach a branch
containing "moon" and "moor". the branch offset point - i.e., the
point after which the branch's leaves differ from each other - is the
fourth character ("n" or "r"). however, both leaves differ from the
search key at position *three* ("o" or "p"). the old code failed to
detect this condition, and would have incorrectly left the iterator
pointing at some lower value and not at "moor".

this has been fixed and the unit test now includes this scenario.

2 years agofix dns_qp_lookup() iterator bug
Evan Hunt [Sun, 3 Dec 2023 22:02:29 +0000 (14:02 -0800)] 
fix dns_qp_lookup() iterator bug

in some cases it was possible for the iterator to be positioned in the
wrong place by dns_qp_lookup(). previously, when a leaf node was found
which matched the search key at its parent branch's offset point, but
did not match after that point, the code incorrectly assumed the leaf
it had found was a successor to the searched-for name, and stepped the
iterator back to find a predecessor.  however, it was possible for the
non-matching leaf to be the predecessor, in which case stepping the
iterator back was wrong.

(for example: a branch contains "aba" and "abcd", and we are searching
for "abcde". we step down to the twig matching the letter "c" in
position 3. "abcd" is the predecessor of "abcde", so the iterator is
already correctly positioned, but because the twig was an exact match,
we would have moved it back one step to "aba".)

this previously went unnoticed due to a mistake in the qp_test unit
test, which had the wrong expected result for the test case that should
have detected the error. both the code and the test have been fixed.

2 years agoadd an iterator argument to dns_qp_lookup()
Evan Hunt [Sun, 5 Nov 2023 12:42:42 +0000 (13:42 +0100)] 
add an iterator argument to dns_qp_lookup()

the 'predecessor' argument to dns_qp_lookup() turns out not to
be sufficient for our needs: the predecessor node in a QP database
could have become "empty" (for the current version) because of an
update or because cache data expired, and in that case the caller
would have to iterate more than one step back to find the predecessor
node that it needs.

it may also be necessary for a caller to iterate forward, in
order to determine whether a node has any children.

for both of these reasons, we now replace the 'predecessor'
argument with an 'iter' argument. if set, this points to memory
with enough space for a dns_qpiter object.

when an exact match is found by the lookup, the iterator will be
pointing to the matching node. if not, it will be pointing to the
lexical predecessor of the nae that was searched for.

a dns_qpiter_current() method has been added for examining
the current value of the iterator without moving it in either
direction.

2 years agoMerge branch 'tkrizek/add-changes-entry-for-4462' into 'main'
Tom Krizek [Wed, 6 Dec 2023 16:33:51 +0000 (16:33 +0000)] 
Merge branch 'tkrizek/add-changes-entry-for-4462' into 'main'

Add CHANGES entry for #4462

See merge request isc-projects/bind9!8551

2 years agoAdd CHANGES entry for #4462
Tom Krizek [Wed, 6 Dec 2023 15:47:51 +0000 (16:47 +0100)] 
Add CHANGES entry for #4462

2 years agoMerge branch '4464-multithread-tls-initialisation-crash-fix' into 'main'
Artem Boldariev [Wed, 6 Dec 2023 15:29:05 +0000 (15:29 +0000)] 
Merge branch '4464-multithread-tls-initialisation-crash-fix' into 'main'

Fix TLS certs store deletion on concurrent access

Closes #4464

See merge request isc-projects/bind9!8531

2 years agoUpdate CHANGES [GL #4464]
Artem Boldariev [Mon, 4 Dec 2023 12:42:30 +0000 (14:42 +0200)] 
Update CHANGES [GL #4464]

Mention that BIND crashing due to a `tls` multithreaded entry
initialisation attempts has been fixed.

2 years agodoth test: add a secondary NS instance that reuses a 'tls' entry
Artem Boldariev [Mon, 4 Dec 2023 13:12:57 +0000 (15:12 +0200)] 
doth test: add a secondary NS instance that reuses a 'tls' entry

This commit extends the 'doth' system tests with additional secondary
NS instance that reuses the same 'tls' entry for connecting the the
primary to download zones. This configurations were known to crash
secondaries in some cases.

2 years agoFix TLS certs store deletion on concurrent access
Artem Boldariev [Mon, 4 Dec 2023 12:28:28 +0000 (14:28 +0200)] 
Fix TLS certs store deletion on concurrent access

During initialisation or reconfiguration, it is possible that multiple
threads are trying to create a TLS context and associated data (like
TLS certs store) concurrently. In some cases, a thread might be too
late to add newly created data to the TLS contexts cache, in which
case it needs to be discarded. In the code that handles that case, it
was not taken into account that, in some cases, the TLS certs store
could not have been created or should not be deleted, as it is being
managed by the TLS contexts cache already. Deleting the store in such
cases might lead to crashes.

This commit fixes the issue.

2 years agoMerge branch '4388-initial-proxyv2-support-in-bind-and-dig' into 'main'
Artem Boldariev [Wed, 6 Dec 2023 13:49:01 +0000 (13:49 +0000)] 
Merge branch '4388-initial-proxyv2-support-in-bind-and-dig' into 'main'

Make it possible to accept PROXYv2 in BIND (and send it in dig)

Closes #4388

See merge request isc-projects/bind9!8417

2 years agoUpdate CHANGES [GL #4388]
Artem Boldariev [Thu, 23 Nov 2023 16:50:01 +0000 (18:50 +0200)] 
Update CHANGES [GL #4388]

Mention the initial support for PROXYv2.

2 years agoUpdate release notes [GL #4388]
Artem Boldariev [Thu, 23 Nov 2023 16:44:38 +0000 (18:44 +0200)] 
Update release notes [GL #4388]

Mention the initial support for PROXYv2.

2 years agoDoH unit test: do not increase 'active_cconnects' too much
Artem Boldariev [Mon, 27 Nov 2023 21:10:36 +0000 (23:10 +0200)] 
DoH unit test: do not increase 'active_cconnects' too much

Theoretically, the value could get too big, not letting the test to
finish. This commit fixes that omission.

2 years agoSystem test for PROXYv2
Artem Boldariev [Tue, 14 Nov 2023 16:19:12 +0000 (18:19 +0200)] 
System test for PROXYv2

This commit adds a system test suite for PROXYv2. The idea on which it
is based is simple:

1. Firstly we check that 'allow-proxy' and 'allow-proxy-on' (whatever
is using the new 'isc_nmhandle_real_localaddr/peeraddr()') do what
they intended to do.

2. Anything else that needs an interface or peer address (ACL
functionality, for example) is using the old
'isc_nmhandle_localaddr/peeraddr()' - which are now returning
addresses received via PROXY (if any) instead of the real connection
addresses. The beauty of it that we DO NOT need to verify every bit of
the code relying on these functions: whatever works in one place will
work everywhere else, as these were the only functions that allowed
any higher level code to get peer and interface addresses.

This way it is relatively easy to see if PROXYv2 works as intended.

2 years agoAdd checkonf tests for the PROXYv2 related options
Artem Boldariev [Tue, 14 Nov 2023 18:33:30 +0000 (20:33 +0200)] 
Add checkonf tests for the PROXYv2 related options

This commit adds necessary PROXYv2 configuration options checks.

2 years agoAdd pre-rendered PROXY header test for PROXY over UDP
Artem Boldariev [Mon, 13 Nov 2023 20:55:46 +0000 (22:55 +0200)] 
Add pre-rendered PROXY header test for PROXY over UDP

This commit extends the PROXY over UDP transport test with
a pre-rendered PROXY header handling test.

2 years agoPROXY Stream pre-rendered PROXY handling test
Artem Boldariev [Mon, 13 Nov 2023 20:35:50 +0000 (22:35 +0200)] 
PROXY Stream pre-rendered PROXY handling test

This commit extends the PROXY Stream transport unit test suite with a
pre-rendered PROXY header handling test.

2 years agoBIND: Add 'allow-proxy' and 'allow-proxy-on' options
Artem Boldariev [Tue, 31 Oct 2023 10:39:04 +0000 (12:39 +0200)] 
BIND: Add 'allow-proxy' and 'allow-proxy-on' options

The main intention of PROXY protocol is to pass endpoints information
to a back-end server (in our case - BIND). That means that it is a
valid way to spoof endpoints information, as the addresses and ports
extracted from PROXYv2 headers, from the point of view of BIND, are
used instead of the real connection addresses.

Of course, an ability to easily spoof endpoints information can be
considered a security issue when used uncontrollably. To resolve that,
we introduce 'allow-proxy' and 'allow-proxy-on' ACL options. These are
the only ACL options in BIND that work with real PROXY connections
addresses, allowing a DNS server operator to specify from what clients
and on which interfaces he or she is willing to accept PROXY
headers. By default, for security reasons we do not allow to accept
them.

2 years agoAvoid using sock->iface and sock->peer from the lower transport
Artem Boldariev [Mon, 30 Oct 2023 17:37:34 +0000 (19:37 +0200)] 
Avoid using sock->iface and sock->peer from the lower transport

This commit modifies TLS Stream and DNS-over-HTTPS transports so that
they do not use the "sock->iface" and "sock->peer" of the lower level
transport directly.

That did not cause any problems before, as things worked as expected,
but with the introduction of PROXYv2 support we use handles to store
the information in both PROXY Stream and UDP Proxy
transports. Therefore, in order to propagate the information (like
addresses), extracted from PROXYv2 headers, from the lower level
transports to the higher-level ones, we need to get that information
from the lower-level handles rather than sockets. That means that we
should get the peer and interface addresses using the intended
APIs ("isc_nmhandle_peeraddr()" and "isc_nmhandle_localaddr()").

2 years agoAdd 'proxy' option to 'listen-on' statement
Artem Boldariev [Mon, 30 Oct 2023 15:03:30 +0000 (17:03 +0200)] 
Add 'proxy' option to 'listen-on' statement

This commit extends "listen-on" statement with "proxy" options that
allows one to enable PROXYv2 support on a dedicated listener. It can
have the following values:

- "plain" to send PROXYv2 headers without encryption, even in the case
of encrypted transports.
- "encrypted" to send PROXYv2 headers encrypted right after the TLS
handshake.

2 years agoIncrease conn. timeout in the timeout recovery tests
Artem Boldariev [Thu, 26 Oct 2023 22:43:00 +0000 (01:43 +0300)] 
Increase conn. timeout in the timeout recovery tests

Due to increased number of the NM unit tests and, thus, increased load
on the system timeout recovery tests can sometimes fail, in particular
on FreeBSD. This commit fixes that. Besides, it seems that use of
T_SOFT here was unintentional to begin with.

2 years agoDocument the new PROXY-related options for dig
Artem Boldariev [Wed, 18 Oct 2023 13:51:06 +0000 (16:51 +0300)] 
Document the new PROXY-related options for dig

This commit adds new documentation for +[no]proxy and +[no]proxy-plain
dig options.

2 years agoIntegrate PROXYv2 support into dig
Artem Boldariev [Mon, 16 Oct 2023 19:54:13 +0000 (22:54 +0300)] 
Integrate PROXYv2 support into dig

This commit adds PROXYv2 support into dig by the means of adding
+[no]proxy and +[no]proxy-plain options. Since this commit dig
supports sending PROXYv2 headers on all supported DNS-transports.

The support for PROXYv2 is modelled after that one in kdig.

2 years agoPROXY over UDP unit tests
Artem Boldariev [Fri, 13 Oct 2023 12:31:32 +0000 (15:31 +0300)] 
PROXY over UDP unit tests

This commit adds a unit test suite for the new PROXY over UDP
transport. Most of the code is reused from the UDP unit test suite, as
the new transport aims to be fully compatible with UDP on the API
level.

2 years agoRefactor UDP tests
Artem Boldariev [Wed, 11 Oct 2023 19:18:54 +0000 (22:18 +0300)] 
Refactor UDP tests

This commit mostly moves the code around to make the parts of the UDP
unit test suite reusable. That changes the unit test suite structure
to resemble that of stream based unit tests.

The motivation behind this is to reuse most of the code for the new
PROXY over UDP uni tests suite.

2 years agoAdd a utility function to dump all active sockets on a NM instance
Artem Boldariev [Tue, 26 Sep 2023 12:37:48 +0000 (15:37 +0300)] 
Add a utility function to dump all active sockets on a NM instance

Add the new isc__nm_dump_active_manager() function that can be used
for debugging purposes: it dumps all active sockets withing the
network manager instance.

2 years agoPROXYv2 over UDP transport
Artem Boldariev [Wed, 12 Jul 2023 12:25:38 +0000 (15:25 +0300)] 
PROXYv2 over UDP transport

This commit adds a new transport that supports PROXYv2 over UDP. It is
built on top of PROXYv2 handling code (just like PROXY Stream). It
works by processing and stripping the PROXYv2 headers at the beginning
of a datagram (when accepting a datagram) or by placing a PROXYv2
header to the beginning of an outgoing datagram.

The transport is built in such a way that incoming datagrams are being
handled with minimal memory allocations and copying.

2 years agoExtend DNS over HTTP(S) unit tests with PROXY over TLS checks
Artem Boldariev [Wed, 21 Jun 2023 18:50:26 +0000 (21:50 +0300)] 
Extend DNS over HTTP(S) unit tests with PROXY over TLS checks

This commit adds PROXY over TLS related checks to DNS over HTTP(S)
transport in order to ensure its compatibility with this mode.

2 years agoAdapt DNS over HTTP(S) unit tests for PROXY over TLS mode
Artem Boldariev [Wed, 21 Jun 2023 18:23:41 +0000 (21:23 +0300)] 
Adapt DNS over HTTP(S) unit tests for PROXY over TLS mode

This commit fixes the common, infrastructural code within the DNS over
HTTP unit test suite to fix and prepare it for PROXY over TLS mode.

2 years agoStreamDNS over TLS: Add PROXY over TLS tests
Artem Boldariev [Wed, 21 Jun 2023 15:35:42 +0000 (18:35 +0300)] 
StreamDNS over TLS: Add PROXY over TLS tests

This commit extends the TLS DNS unit tests suite with checks related
to PROXY over TLS support in StreamDNS.

2 years agoExtend PROXY Stream tests to include checks for PROXY over TLS
Artem Boldariev [Wed, 21 Jun 2023 13:33:13 +0000 (16:33 +0300)] 
Extend PROXY Stream tests to include checks for PROXY over TLS

This commit extends the PROXY stream unit test suite with checks
related to PROXY over TLS support within the transport.

2 years agoTLS: detect ISC_R_SHUTTINGDOWN and ISC_R_CANCELED cases properly
Artem Boldariev [Thu, 25 May 2023 15:47:07 +0000 (18:47 +0300)] 
TLS: detect ISC_R_SHUTTINGDOWN and ISC_R_CANCELED cases properly

In the previous versions of the NM, detecting the case when worker is
shutting down was not that important and actual status code did not
matter much. However, that might be not the case all the time.

This commit makes necessary modifications to the code.

2 years agoPROXY over TLS: Fix stream-based DNS transports tests support
Artem Boldariev [Thu, 25 May 2023 15:22:55 +0000 (18:22 +0300)] 
PROXY over TLS: Fix stream-based DNS transports tests support

This commit fixes the infrastructural code of the stream-based DNS
transports to take PROXY over TLS support into account.

2 years agoDoH: add PROXY over TLS support
Artem Boldariev [Fri, 19 May 2023 11:56:45 +0000 (14:56 +0300)] 
DoH: add PROXY over TLS support

This commit extends DNS over HTTP(S) transport with PROXY over TLS
support.

2 years agoStream DNS: add PROXY over TLS support
Artem Boldariev [Fri, 19 May 2023 11:28:52 +0000 (14:28 +0300)] 
Stream DNS: add PROXY over TLS support

This commit extends Stream DNS with PROXY over TLS support.

2 years agoFix TLS Stream in accordance with PROXY Stream over TLS support
Artem Boldariev [Thu, 18 May 2023 18:52:23 +0000 (21:52 +0300)] 
Fix TLS Stream in accordance with PROXY Stream over TLS support

This commit makes TLS Stream code to take PROXY Stream over TLS
support into account.

2 years agoFix common netmgr unit testing code for PROXY Stream over TLS
Artem Boldariev [Thu, 25 May 2023 11:59:50 +0000 (14:59 +0300)] 
Fix common netmgr unit testing code for PROXY Stream over TLS

This commit fixes common netmgr unit testing code to take PROXY Stream
over TLS support into account.

2 years agoAdd PROXY over TLS support to PROXY Stream
Artem Boldariev [Tue, 17 Oct 2023 17:36:58 +0000 (20:36 +0300)] 
Add PROXY over TLS support to PROXY Stream

This commit makes it possible to use PROXY Stream not only over TCP,
but also over TLS. That is, now PROXY Stream can work in two modes as
far as TLS is involved:

1. PROXY over (plain) TCP - PROXYv2 headers are sent unencrypted before
TLS handshake messages. That is the main mode as described in the
PROXY protocol specification (as it is clearly stated there), and most
of the software expects PROXYv2 support to be implemented that
way (e.g. HAProxy);

2. PROXY over (encrypted) TLS - PROXYv2 headers are sent after the TLS
handshake has happened. For example, this mode is being used (only ?)
by "dnsdist". As far as I can see, that is, in fact, a deviation from
the spec, but I can certainly see how PROXYv2 could end up being
implemented this way elsewhere.

2 years agoAdd PROXYv2 related checks to DNS over HTTP(S) unit test suite
Artem Boldariev [Thu, 11 May 2023 13:53:16 +0000 (16:53 +0300)] 
Add PROXYv2 related checks to DNS over HTTP(S) unit test suite

This commit extends DNS over HTTP(S) unit test suite with PROXYv2
related checks to ensure that the transport is compatible with that
mode.

2 years agoAdd PROXYv2 support to DNS over HTTP(S) transport
Artem Boldariev [Wed, 10 May 2023 19:01:36 +0000 (22:01 +0300)] 
Add PROXYv2 support to DNS over HTTP(S) transport

This commit extends DNS over HTTP(S) transport with PROXYv2 support.

2 years agoAdd PROXYv2 related tests for TLS DNS transport
Artem Boldariev [Tue, 9 May 2023 17:49:38 +0000 (20:49 +0300)] 
Add PROXYv2 related tests for TLS DNS transport

This commit adds a set of PROXYv2 related tests to ensure that Stream
DNS over TLS supports this mode.

2 years agoAdd PROXYv2 related tests for TCP DNS transport
Artem Boldariev [Tue, 9 May 2023 17:35:24 +0000 (20:35 +0300)] 
Add PROXYv2 related tests for TCP DNS transport

This commit adds a set of PROXYv2 related tests to ensure that Stream
DNS over TCP supports this mode.

2 years agoAdd PROXY support to Stream DNS
Artem Boldariev [Tue, 9 May 2023 12:13:05 +0000 (15:13 +0300)] 
Add PROXY support to Stream DNS

This commit makes it possible to use Stream DNS on top of PROXY Stream
either directly or indirectly (in the case when TLS is involved).

2 years agoExtend TLS Stream unit suite with PROXYv2 related tests
Artem Boldariev [Tue, 9 May 2023 16:49:40 +0000 (19:49 +0300)] 
Extend TLS Stream unit suite with PROXYv2 related tests

This commit adds a set of tests which help to verify that TLS Stream
works as expected on top of PROXY Stream.

2 years agoMake it possible to use TLS Stream on top of PROXY Stream
Artem Boldariev [Thu, 4 May 2023 20:06:23 +0000 (23:06 +0300)] 
Make it possible to use TLS Stream on top of PROXY Stream

This commit modifies TLS Stream to make it possible to use over PROXY
Stream. That is required to add PROVYv2 support into TLS-based
transports (DNS over HTTP, DNS over TLS).

2 years agoPROXY Stream: add unit test suite
Artem Boldariev [Thu, 27 Apr 2023 17:17:18 +0000 (20:17 +0300)] 
PROXY Stream: add unit test suite

This commit adds a specialised test suite for the PROXY Stream
transport by reusing most of the testing code from other unit tests
for other stream-based transports.

2 years agoPROXY Stream transport
Artem Boldariev [Thu, 16 Mar 2023 10:50:04 +0000 (12:50 +0200)] 
PROXY Stream transport

This commit adds a new stream-based transport with an interface
compatible with TCP. The transport is built on top of TCP transport
and the new PROXYv2 handling code. Despite being built on top of TCP,
it can be easily extended to work on top of any TCP-like stream-based
transport. The intention of having this transport is to add PROXYv2
support into all existing stream-based DNS transport (DNS over TCP,
DNS over TLS, DNS over HTTP) by making the work on top of this new
transport.

The idea behind the transport is simple after accepting the connection
or connecting to a remote server it enters PROXYv2 handling mode: that
is, it either attempts to read (when accepting the connection) or send
(when establishing a connection) a PROXYv2 header. After that it works
like a mere wrapper on top of the underlying stream-based
transport (TCP).

2 years agoAdd PROXY header handling unit test suite
Artem Boldariev [Fri, 3 Mar 2023 14:43:15 +0000 (16:43 +0200)] 
Add PROXY header handling unit test suite

The commit adds a fairly comprehensive unit test suite for our new
PROXYv2 handling code. The unit tests suite ensures both the
correctness of the code and ensures that the part responsible for
handling incoming headers is very strict regarding what to accept as
valid.

2 years agoAdd PROXYv2 header utilities
Artem Boldariev [Fri, 3 Mar 2023 14:42:47 +0000 (16:42 +0200)] 
Add PROXYv2 header utilities

This commit adds a set of utilities for dealing with PROXYv2 headers,
both parsing and generating them. The code has no dependencies from
the networking code and is (for the most part) a "separate library".

The part responsible for handling incoming PROXYv2 headers is
structured as a state machine which accepts data as input and calls a
callback to notify the upper-level code about the data processing
status.

Such a design, among other things, makes it easy to write a thorough
unit test suite for that, as there are fewer dependencies as well as
will not stand in the way of any changes in the networking code.

2 years agoMerge branch '4476-fix-cid-469729' into 'main'
Matthijs Mekking [Wed, 6 Dec 2023 12:51:24 +0000 (12:51 +0000)] 
Merge branch '4476-fix-cid-469729' into 'main'

CID 469729: Remove leftover return call

Closes #4476

See merge request isc-projects/bind9!8547

2 years agoCID 469729: Remove leftover return call
Matthijs Mekking [Wed, 6 Dec 2023 09:38:01 +0000 (10:38 +0100)] 
CID 469729: Remove leftover return call

This 'return (ret);' call can never be reached and should have been
removed as part of commit 75e0d394dd2147a0b07524521c084a71801e4eee.

2 years agoMerge branch 'mnowak/drop-openbsd-system-test-job' into 'main'
Michal Nowak [Tue, 5 Dec 2023 15:21:57 +0000 (15:21 +0000)] 
Merge branch 'mnowak/drop-openbsd-system-test-job' into 'main'

Drop OpenBSD system test CI job

See merge request isc-projects/bind9!8535

2 years agoRun "make check" in system:gcc:sid:amd64
Michal Nowak [Tue, 5 Dec 2023 08:44:50 +0000 (09:44 +0100)] 
Run "make check" in system:gcc:sid:amd64

Following the discontinuation of the OpenBSD system test in CI, transfer
the execution of the system test using the "make check" method to the
Debian "sid" system test CI job.

2 years agoDrop OpenBSD system test CI job
Michal Nowak [Mon, 4 Dec 2023 16:13:55 +0000 (17:13 +0100)] 
Drop OpenBSD system test CI job

The system tests on OpenBSD consistently exhibit lower stability
compared to our other CI platforms. Some of these challenges are
intrinsic to the system test itself and require attention. However,
there are OpenBSD issues, which seem to be more widespread on this
platform than others. In our daily CI pipelines, OpenBSD system tests
often bear the brunt of all failed CI jobs.

It's possible that our OpenBSD CI image could be optimized, but we
currently lack the domain-specific knowledge needed to make
improvements.

2 years agoMerge branch '4363-lower-max-nsec3-iterations' into 'main'
Matthijs Mekking [Tue, 5 Dec 2023 14:59:48 +0000 (14:59 +0000)] 
Merge branch '4363-lower-max-nsec3-iterations' into 'main'

Lower NSEC3 iteration limit to 50

Closes #4363

See merge request isc-projects/bind9!8515

2 years agoChange max NSEC3 iterations in unit tests to 50
Matthijs Mekking [Wed, 22 Nov 2023 16:30:00 +0000 (17:30 +0100)] 
Change max NSEC3 iterations in unit tests to 50

The nsec3 unit test needs to be adjusted to accept a lower maximum value
for NSEC3 iterations.

2 years agoAdd release note and CHANGES for #4363
Matthijs Mekking [Wed, 22 Nov 2023 15:39:40 +0000 (16:39 +0100)] 
Add release note and CHANGES for #4363

This protocol change is definitely worth mentioning.

2 years agoChange max NSEC3 iterations in system tests to 50
Matthijs Mekking [Wed, 22 Nov 2023 15:29:44 +0000 (16:29 +0100)] 
Change max NSEC3 iterations in system tests to 50

The dnssec and nsupdate system tests need to be adjusted to accept
a lower maximum value for NSEC3 iterations.

2 years agoLower the maximum allowed NSEC3 iterations to 50
Matthijs Mekking [Wed, 22 Nov 2023 15:12:51 +0000 (16:12 +0100)] 
Lower the maximum allowed NSEC3 iterations to 50

BIND 9 will now treat the response as insecure when processing NSEC3
records with iterations larger than 50.

Earlier, we limited the number of iterations to 150 (in #2445).

RFC 9276 says: Because there has been a large growth of open (public)
DNSSEC validating resolvers that are subject to compute resource
constraints when handling requests from anonymous clients, this
document recommends that validating resolvers reduce their iteration
count limits over time. Specifically, validating resolver operators and
validating resolver software implementers are encouraged to continue
evaluating NSEC3 iteration count deployment trends and lower their
acceptable iteration limits over time.

After evaluation, we decided that the next major BIND release should
lower the maximum allowed NSEC3 iterations to 50, which should be
fine for 99,87% of the domain names.

2 years agoChange NSEC3 iterations to 0 in system tests
Matthijs Mekking [Wed, 22 Nov 2023 11:32:55 +0000 (12:32 +0100)] 
Change NSEC3 iterations to 0 in system tests

The system tests need to be updated because non-zero iterations are no
longer accepted.

The autosign system test changes its iterations from 1 to 0 in one
test case. This requires the hash to be updated.

The checkconf system test needs to change the iterations in the good
configuration files to 0, and in the bad ones to 1 (any non-zero value
would suffice, but we test the corner case here). Also, the expected
failure message is change, so needs to be adjusted.

The nsec3 system test also needs iteration configuration adjustments.
In addition, the test script no longer needs the ITERATIONS environment
variable.

In the process of updating the system tests, I noticed an error
in the dnssec-policy "nsec3-other", where the salt length in one
configuration file is different than in the other (they need to be
the same). Furthermore, the 'rndc signing -nsec3param' test case
is operated on the zone 'nsec-change.kasp', so is moved so that the
tests on the same zone are grouped together.

2 years agodnssec-policy: refuse to load non-zero iterations
Matthijs Mekking [Wed, 22 Nov 2023 11:29:56 +0000 (12:29 +0100)] 
dnssec-policy: refuse to load non-zero iterations

According to RFC 9276, if NSEC3 must be used, then an iterations count
of 0 MUST be used to alleviate computational burdens.

2 years agoMerge branch '4452-pytest-improve-assert-messages' into 'main'
Tom Krizek [Tue, 5 Dec 2023 13:00:07 +0000 (13:00 +0000)] 
Merge branch '4452-pytest-improve-assert-messages' into 'main'

Improve assert messages in pytests

Closes #4452

See merge request isc-projects/bind9!8518

2 years agoRefactor statschannel test to use isctest
Tom Krizek [Mon, 4 Dec 2023 17:10:42 +0000 (18:10 +0100)] 
Refactor statschannel test to use isctest

Use common utility functions in favor of duplicating the code in a
test-specific file.

2 years agoAdd system test utility package isctest
Tom Krizek [Mon, 4 Dec 2023 17:05:50 +0000 (18:05 +0100)] 
Add system test utility package isctest

Create a utility package for code shared by the python tests. The
utility functions should use reasonable defaults and be split up into
modules according to their functionality.

Ensure assert rewriting is enabled for the modules to get the most
useful output from pytest.

2 years agoSimplify statsport fixture in statschannel test
Tom Krizek [Mon, 27 Nov 2023 12:28:27 +0000 (13:28 +0100)] 
Simplify statsport fixture in statschannel test

The ports fixture provides the required port numbers already and there's
no need to get the port number from environment.

2 years agoAllow assertion message rewrite in statschannel test
Tom Krizek [Fri, 24 Nov 2023 14:50:08 +0000 (15:50 +0100)] 
Allow assertion message rewrite in statschannel test

By default, the useful assertion message rewrite is used by pytest for
test modules only. Since another module is imported with shared
functionality, ensure it has pytest's assertion message rewriting
enabled to obtain more debug information in case it fails.

2 years agoMove helper functions in statchannel into single file
Tom Krizek [Fri, 24 Nov 2023 14:44:32 +0000 (15:44 +0100)] 
Move helper functions in statchannel into single file

Since dnspython is now a required dependency, there's no need to keep
these two helper files separate.

2 years agoAdd assert message to test doth/stress_http_quota.py
Tom Krizek [Fri, 24 Nov 2023 14:32:09 +0000 (15:32 +0100)] 
Add assert message to test doth/stress_http_quota.py

This file is executed outside of pytest with pure python, which doesn't
do any AssertionError message rewriting like pytest. Ensure the assert
messages in this file provide a useful debug message.

2 years agoMerge branch '4462-crash-on-shutdown-when-dnssec-validation-is-running-ensure-isc_mem...
Mark Andrews [Mon, 4 Dec 2023 22:55:50 +0000 (22:55 +0000)] 
Merge branch '4462-crash-on-shutdown-when-dnssec-validation-is-running-ensure-isc_mempool_getallocated-namepoolp' into 'main'

Resolve "Crash on shutdown when DNSSEC validation is running: ENSURE(isc_mempool_getallocated(*namepoolp) == 0) failed"

Closes #4462 and #4384

See merge request isc-projects/bind9!8526

2 years agoDestroy the message before detaching the view
Mark Andrews [Mon, 4 Dec 2023 01:23:18 +0000 (12:23 +1100)] 
Destroy the message before detaching the view

With shared name memory pools (f5af981831ea8a707090c1b09a47c25b75d86b5a)
the message needs to be destroyed before the view is detached which
in turn detaches the resolver which checks that all resources have
been returned.

2 years agoMerge branch '4457-dig-crashes-after-sigint-if-there-are-multiple-queries' into ...
Mark Andrews [Mon, 4 Dec 2023 21:10:00 +0000 (21:10 +0000)] 
Merge branch '4457-dig-crashes-after-sigint-if-there-are-multiple-queries' into 'main'

Resolve "dig crashes after SIGINT if there are multiple queries"

Closes #4457

See merge request isc-projects/bind9!8527

2 years agoAdd CHANGES note for [GL #4457]
Mark Andrews [Mon, 4 Dec 2023 02:25:37 +0000 (13:25 +1100)] 
Add CHANGES note for [GL #4457]

2 years agoHandle ISC_R_SHUTTINGDOWN in dighost.c:recv_done
Mark Andrews [Mon, 4 Dec 2023 02:21:20 +0000 (13:21 +1100)] 
Handle ISC_R_SHUTTINGDOWN in dighost.c:recv_done

When dighost.c:recv_done is called with ISC_R_SHUTTINGDOWN cancel
all outstanding lookups as this indicates SIGTERM was recieved.

2 years agoMerge branch '3198-add-rr-record' into 'main'
Michal Nowak [Mon, 4 Dec 2023 18:53:07 +0000 (18:53 +0000)] 
Merge branch '3198-add-rr-record' into 'main'

Add support for recording named with rr

Closes #3198

See merge request isc-projects/bind9!8479

2 years agoDo not daemonize named instances with custom args
Michał Kępień [Thu, 16 Nov 2023 12:21:33 +0000 (13:21 +0100)] 
Do not daemonize named instances with custom args

This enables the "logfileconfig" and "rpzextra" system tests to pass
when named is started under the supervision of rr (USE_RR=1).

2 years agoFix process listing string of rpzextra ns3 server
Michal Nowak [Wed, 8 Nov 2023 17:46:20 +0000 (18:46 +0100)] 
Fix process listing string of rpzextra ns3 server

2 years agoAdd support for recording named runtime with rr
Michal Nowak [Wed, 8 Nov 2023 18:21:30 +0000 (19:21 +0100)] 
Add support for recording named runtime with rr

The traces of the named process are stored in the directory
$system_test/nsX/named-Y/.

2 years agoRemove support for running system tests under Valgrind
Ondřej Surý [Wed, 9 Mar 2022 10:28:06 +0000 (11:28 +0100)] 
Remove support for running system tests under Valgrind

Valgrind support has been scarcely used.

2 years agoMerge branch 'mnowak/freebsd-14.0' into 'main'
Michal Nowak [Mon, 4 Dec 2023 15:26:56 +0000 (15:26 +0000)] 
Merge branch 'mnowak/freebsd-14.0' into 'main'

Add FreeBSD 14.0

See merge request isc-projects/bind9!8520

2 years agoAdd FreeBSD 14.0
Michal Nowak [Mon, 27 Nov 2023 13:29:16 +0000 (14:29 +0100)] 
Add FreeBSD 14.0

2 years agoMerge branch '1229-dig-no-yaml-output-when-host-is-unreachable' into 'main'
Arаm Sаrgsyаn [Mon, 4 Dec 2023 10:38:46 +0000 (10:38 +0000)] 
Merge branch '1229-dig-no-yaml-output-when-host-is-unreachable' into 'main'

Resolve "No YAML output in dig when host is unreachable"

Closes #1229

See merge request isc-projects/bind9!8501

2 years agoAdd a CHANGES note for [GL #1229]
Aram Sargsyan [Thu, 16 Nov 2023 13:38:39 +0000 (13:38 +0000)] 
Add a CHANGES note for [GL #1229]

2 years agoEmit "no servers could be reached" also for UDP setup failure
Aram Sargsyan [Thu, 16 Nov 2023 13:30:32 +0000 (13:30 +0000)] 
Emit "no servers could be reached" also for UDP setup failure

When all the servers are exhausted for UDP setup emit "no servers
could be reached" in udp_ready(). This message can also be emitted
for a recv_done() error and for TCP connection failure similarly.

2 years agoMerge branch '4417-stale-hyperlinks-in-the-arm' into 'main'
Petr Špaček [Mon, 4 Dec 2023 10:00:57 +0000 (10:00 +0000)] 
Merge branch '4417-stale-hyperlinks-in-the-arm' into 'main'

Fix stale hyperlinks in the ARM

Closes #4417

See merge request isc-projects/bind9!8525

2 years agoFix broken link to TLD DNSSEC stats
Suzanne Goldlust [Wed, 29 Nov 2023 22:44:17 +0000 (22:44 +0000)] 
Fix broken link to TLD DNSSEC stats

2 years agoFix broken link to OMB memo
Suzanne Goldlust [Wed, 29 Nov 2023 22:38:24 +0000 (22:38 +0000)] 
Fix broken link to OMB memo

2 years agoMerge branch '4251-remove-legacy-test-runner' into 'main'
Tom Krizek [Fri, 1 Dec 2023 14:21:34 +0000 (14:21 +0000)] 
Merge branch '4251-remove-legacy-test-runner' into 'main'

Remove legacy system test runner

Closes #4251

See merge request isc-projects/bind9!8514

2 years agoRemove -U 4 from system tests
Tom Krizek [Fri, 1 Dec 2023 12:59:55 +0000 (13:59 +0100)] 
Remove -U 4 from system tests

This option doesn't appear to be needed for any of the tests, so remove
it to keep things simple.

2 years agoAdd CHANGES note for [GL #4251]
Tom Krizek [Tue, 21 Nov 2023 12:35:38 +0000 (13:35 +0100)] 
Add CHANGES note for [GL #4251]

2 years agoUpdate system test documentation
Tom Krizek [Mon, 6 Nov 2023 13:45:07 +0000 (14:45 +0100)] 
Update system test documentation

Rewrite and reorganize the test documentation to focus on the pytest
runner, omit any mentions of the legacy runner which are no longer
relevant, and mention a few pytest tricks.

2 years agoRemove obsolete system test lists
Tom Krizek [Mon, 13 Nov 2023 14:24:14 +0000 (15:24 +0100)] 
Remove obsolete system test lists

These were used by deleted legacy runner utility scripts.

2 years agoRemove legacy runner control scripts
Tom Krizek [Tue, 31 Oct 2023 08:35:14 +0000 (09:35 +0100)] 
Remove legacy runner control scripts

These scripts have been used exclusively by the legacy test runner and
they're no longer needed.

2 years agoMerge branch '4451-use-only-single-method-for-overmem-condition' into 'main'
Ondřej Surý [Wed, 29 Nov 2023 13:21:09 +0000 (13:21 +0000)] 
Merge branch '4451-use-only-single-method-for-overmem-condition' into 'main'

Refactor the handling of isc_mem overmem condition

Closes #4451

See merge request isc-projects/bind9!8523

2 years agoAdd CHANGES note for [GL #4451]
Ondřej Surý [Wed, 29 Nov 2023 08:40:11 +0000 (09:40 +0100)] 
Add CHANGES note for [GL #4451]

2 years agoAdd isc_mem_overmem unit test
Ondřej Surý [Wed, 29 Nov 2023 11:42:38 +0000 (12:42 +0100)] 
Add isc_mem_overmem unit test

The new unit isc_mem_overmem unit test sets hi and lo water marks and
then does allocations to go over:

0. x < lo_water
1. lo_water < x < hi_water
2. x > hi_water
3. lo_water < x < hi_water
4. < lo_water

2 years agoCleanup unused stats_bucket() macro
Ondřej Surý [Wed, 29 Nov 2023 09:21:26 +0000 (10:21 +0100)] 
Cleanup unused stats_bucket() macro

2 years agoRefactor the handling of isc_mem overmem condition
Ondřej Surý [Wed, 29 Nov 2023 08:01:56 +0000 (09:01 +0100)] 
Refactor the handling of isc_mem overmem condition

Previously, there were two methods of working with the overmem
condition:

1. hi/lo water callback - when the overmem condition was reached
   for the first time, the water callback was called with HIWATER
   mark and .is_overmem boolean was set internally.  Similarly,
   when the used memory went below the lo water mark, the water
   callback would be called with LOWATER mark and .is_overmem
   was reset.  This check would be called **every** time memory
   was allocated or freed.

2. isc_mem_isovermem() - a simple getter for the internal
   .is_overmem flag

This commit refactors removes the first method and move the hi/lo water
checks to the isc_mem_isovermem() function, thus we now have only a
single method of checking overmem condition and the check for hi/lo
water is removed from the hot path for memory contexts that doesn't use
overmem checks.

2 years agoMerge branch 'mnowak/drop-named-alt3.conf.in-leftover' into 'main'
Michal Nowak [Tue, 28 Nov 2023 20:15:10 +0000 (20:15 +0000)] 
Merge branch 'mnowak/drop-named-alt3.conf.in-leftover' into 'main'

Drop the last remnant of ns2/named-alt3.conf.in

See merge request isc-projects/bind9!8506

2 years agoRenumber the ns2/named-alt*.conf.in files
Matthijs Mekking [Wed, 22 Nov 2023 07:43:50 +0000 (08:43 +0100)] 
Renumber the ns2/named-alt*.conf.in files

Now that some configuration input files have been removed, rename
the filenames.