]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
5 years agoAdd tests for going from secure to insecure
Matthijs Mekking [Thu, 3 Dec 2020 07:53:34 +0000 (08:53 +0100)] 
Add tests for going from secure to insecure

Add two test zones that will be reconfigured to go insecure, by
setting the 'dnssec-policy' option to 'none'.

One zone was using inline-signing (implicitly through dnssec-policy),
the other is a dynamic zone.

Two tweaks to the kasp system test are required: we need to set
when to except the CDS/CDS Delete Records, and we need to know
when we are dealing with a dynamic zone (because the logs to look for
are slightly different, inline-signing prints "(signed)" after the
zone name, dynamic zones do not).

5 years agoMerge branch '2245-bind-9-16-8-does-not-honor-cpu-affinity' into 'main'
Mark Andrews [Tue, 22 Dec 2020 22:17:12 +0000 (22:17 +0000)] 
Merge branch '2245-bind-9-16-8-does-not-honor-cpu-affinity' into 'main'

Resolve "bind 9.16.8 does not honor CPU affinity"

Closes #2245

See merge request isc-projects/bind9!4395

5 years agoAdd CHANGES and release notes for [GL #2245]
Mark Andrews [Wed, 2 Dec 2020 05:08:39 +0000 (16:08 +1100)] 
Add CHANGES and release notes for [GL #2245]

5 years agoPYTHON may be null
Mark Andrews [Wed, 16 Dec 2020 02:50:57 +0000 (13:50 +1100)] 
PYTHON may be null

When Python is not present, PYTHON=$(command -v "@PYTHON@") will exit
the script with 1, prevent that by adding "|| true".

5 years agoAdd test for cpu affinity
Matthijs Mekking [Thu, 10 Dec 2020 10:57:23 +0000 (11:57 +0100)] 
Add test for cpu affinity

Add a test to check BIND 9 honors CPU affinity mask. This requires
some changes to the start script, to construct the named command.

5 years agoOnly pick CPUs that are part of the existing CPU affinity set when
Mark Andrews [Tue, 17 Nov 2020 03:59:01 +0000 (14:59 +1100)] 
Only pick CPUs that are part of the existing CPU affinity set when

assigning a thread to a CPU.

5 years agoMerge branch '2348-bin-tools-mdig-compile-link-failure-because-of-missing-isccfg...
Mark Andrews [Mon, 21 Dec 2020 02:07:45 +0000 (02:07 +0000)] 
Merge branch '2348-bin-tools-mdig-compile-link-failure-because-of-missing-isccfg-dependency-3' into 'main'

Resolve "bin/tools/mdig: compile/link failure because of missing isccfg dependency"

Closes #2348

See merge request isc-projects/bind9!4497

5 years agoHandle shared library platforms that don't support inter library dependancies
Mark Andrews [Wed, 16 Dec 2020 00:04:43 +0000 (11:04 +1100)] 
Handle shared library platforms that don't support inter library dependancies

5 years agoReorder in library dependancy order
Mark Andrews [Wed, 16 Dec 2020 00:02:36 +0000 (11:02 +1100)] 
Reorder in library dependancy order

5 years agoMerge branch 'jpmens-main-patch-60230' into 'main'
Ondřej Surý [Sun, 20 Dec 2020 16:50:03 +0000 (16:50 +0000)] 
Merge branch 'jpmens-main-patch-60230' into 'main'

Adjust number of rule types from 13 to the 16 there are. (16 is accurately...

See merge request isc-projects/bind9!4507

5 years agoAdjust number of rule types from 13 to the 16 there are. (16 is accurately specified...
JP Mens [Sun, 20 Dec 2020 09:56:44 +0000 (09:56 +0000)] 
Adjust number of rule types from 13 to the 16 there are. (16 is accurately specified further down in the section.)

5 years agoMerge branch 'v9_17_8-release' into 'main'
Michał Kępień [Wed, 16 Dec 2020 21:15:24 +0000 (21:15 +0000)] 
Merge branch 'v9_17_8-release' into 'main'

Merge 9.17.8 release branch

See merge request isc-projects/bind9!4500

5 years agoSet up release notes for BIND 9.17.9
Michał Kępień [Wed, 16 Dec 2020 21:09:14 +0000 (22:09 +0100)] 
Set up release notes for BIND 9.17.9

5 years agoBump BIND_BASELINE_VERSION for ABI checks
Michał Kępień [Wed, 16 Dec 2020 21:09:14 +0000 (22:09 +0100)] 
Bump BIND_BASELINE_VERSION for ABI checks

5 years agoUpdate BIND version to 9.17.8
Michał Kępień [Fri, 4 Dec 2020 10:36:58 +0000 (11:36 +0100)] 
Update BIND version to 9.17.8

5 years agoAdd a CHANGES marker
Michał Kępień [Fri, 4 Dec 2020 10:36:58 +0000 (11:36 +0100)] 
Add a CHANGES marker

5 years agoUpdate library API versions
Michał Kępień [Fri, 4 Dec 2020 10:36:58 +0000 (11:36 +0100)] 
Update library API versions

5 years agoMerge branch 'michal/prepare-release-notes-for-bind-9.17.8' into 'v9_17_8-release'
Michał Kępień [Fri, 4 Dec 2020 10:34:38 +0000 (10:34 +0000)] 
Merge branch 'michal/prepare-release-notes-for-bind-9.17.8' into 'v9_17_8-release'

Prepare release notes for BIND 9.17.8

See merge request isc-private/bind9!224

5 years agoPrepare release notes for BIND 9.17.8
Michał Kępień [Fri, 4 Dec 2020 10:07:22 +0000 (11:07 +0100)] 
Prepare release notes for BIND 9.17.8

5 years agoAdd release note for GL #2321
Michał Kępień [Fri, 4 Dec 2020 10:07:22 +0000 (11:07 +0100)] 
Add release note for GL #2321

5 years agoAdd release note for GL #1816
Michał Kępień [Fri, 4 Dec 2020 10:07:22 +0000 (11:07 +0100)] 
Add release note for GL #1816

5 years agoReorder release notes
Michał Kępień [Fri, 4 Dec 2020 10:07:22 +0000 (11:07 +0100)] 
Reorder release notes

5 years agoTweak and reword release notes
Michał Kępień [Fri, 4 Dec 2020 10:07:22 +0000 (11:07 +0100)] 
Tweak and reword release notes

5 years agoTweak and reword recent CHANGES entries
Michał Kępień [Fri, 4 Dec 2020 10:07:22 +0000 (11:07 +0100)] 
Tweak and reword recent CHANGES entries

5 years agoFix formatting of "dnssec-policy" documentation
Michał Kępień [Fri, 4 Dec 2020 10:07:22 +0000 (11:07 +0100)] 
Fix formatting of "dnssec-policy" documentation

5 years agoMiscellaneous minor documentation updates
Michal Nowak [Thu, 3 Dec 2020 15:53:22 +0000 (16:53 +0100)] 
Miscellaneous minor documentation updates

5 years agoMerge branch 'mnowak/fix-rndc-8-reference-in-named-8-man-page' into 'main'
Michal Nowak [Mon, 14 Dec 2020 12:12:54 +0000 (12:12 +0000)] 
Merge branch 'mnowak/fix-rndc-8-reference-in-named-8-man-page' into 'main'

Fix a reference to rndc(8) in named(8) manual page

See merge request isc-projects/bind9!4478

5 years agoFix a reference to rndc(8) in named(8) manual page
Michal Nowak [Tue, 8 Dec 2020 15:11:04 +0000 (16:11 +0100)] 
Fix a reference to rndc(8) in named(8) manual page

5 years agoMerge branch '2058-print-warning-when-fallback-to-soaserial-increment' into 'main'
Ondřej Surý [Sat, 12 Dec 2020 06:52:50 +0000 (06:52 +0000)] 
Merge branch '2058-print-warning-when-fallback-to-soaserial-increment' into 'main'

Resolve "`dnssec-signzone -N unixtime` behaves like `increment`"

Closes #2058

See merge request isc-projects/bind9!4487

5 years agoAdd CHANGES and release notes for GL #2058
Ondřej Surý [Thu, 10 Dec 2020 09:39:48 +0000 (10:39 +0100)] 
Add CHANGES and release notes for GL #2058

5 years agoUpdate dnssec-signzone -N soa-serial-format description
Mark Andrews [Fri, 11 Dec 2020 03:07:31 +0000 (14:07 +1100)] 
Update dnssec-signzone -N soa-serial-format description

document the autoincrement when the serial would go backwards.

5 years agoPrint warning when falling back to increment soa serial method
Ondřej Surý [Thu, 10 Dec 2020 09:31:31 +0000 (10:31 +0100)] 
Print warning when falling back to increment soa serial method

When using the `unixtime` or `date` method to update the SOA serial,
`named` and `dnssec-signzone` would silently fallback to `increment`
method to prevent the new serial number to be smaller than the old
serial number (using the serial number arithmetics).  Add a warning
message when such fallback happens.

5 years agoMerge branch '385-add-a-built-in-ipv4only-arpa-default-zone' into 'main'
Mark Andrews [Fri, 11 Dec 2020 06:04:47 +0000 (06:04 +0000)] 
Merge branch '385-add-a-built-in-ipv4only-arpa-default-zone' into 'main'

Resolve "Add a built-in ipv4only.arpa default zone."

Closes #385

See merge request isc-projects/bind9!479

5 years agoAdd CHANGES note
Mark Andrews [Tue, 1 Sep 2020 00:30:45 +0000 (10:30 +1000)] 
Add CHANGES note

5 years agoAdd release note entry
Mark Andrews [Tue, 1 Sep 2020 00:32:44 +0000 (10:32 +1000)] 
Add release note entry

5 years agoAdd RFC 7050 and RFC 8880 to rfc-compliance
Mark Andrews [Tue, 8 Dec 2020 22:47:48 +0000 (09:47 +1100)] 
Add RFC 7050 and RFC 8880 to rfc-compliance

5 years agoDocument ipv4only-enable, ipv4only-contact and ipv4only-server.
Mark Andrews [Wed, 11 Jul 2018 02:18:27 +0000 (12:18 +1000)] 
Document ipv4only-enable, ipv4only-contact and ipv4only-server.

5 years agoGenerate PTR records for DNS64 mapped ipv4only.arpa reverses.
Mark Andrews [Tue, 1 Sep 2020 02:03:59 +0000 (12:03 +1000)] 
Generate PTR records for DNS64 mapped ipv4only.arpa reverses.

Rather than generating CNAMES records pointing into IN-ADDR.ARPA,
generate PTR records directly as the names are known as per RFC 8880.

5 years agoChecking synthesis of AAAA of builtin ipv4only.arpa
Mark Andrews [Thu, 5 Jul 2018 06:45:05 +0000 (16:45 +1000)] 
Checking synthesis of AAAA of builtin ipv4only.arpa

5 years agoImplement ipv4only.arpa forward and reverse zones as per RFC 8880.
Mark Andrews [Thu, 5 Jul 2018 05:29:30 +0000 (15:29 +1000)] 
Implement ipv4only.arpa forward and reverse zones as per RFC 8880.

5 years agoMerge branch 'marka-placeholder' into 'main'
Mark Andrews [Thu, 10 Dec 2020 02:43:41 +0000 (02:43 +0000)] 
Merge branch 'marka-placeholder' into 'main'

Add placeholders for [GL !4454] and [GL #2324]

See merge request isc-projects/bind9!4485

5 years agoAdd placeholders for [GL !4454] and [GL #2324]
Mark Andrews [Thu, 10 Dec 2020 02:40:56 +0000 (13:40 +1100)] 
Add placeholders for [GL !4454] and [GL #2324]

5 years agoMerge branch 'ondrej/release-notes-doesnt-need-copyright' into 'main'
Ondřej Surý [Wed, 9 Dec 2020 09:48:53 +0000 (09:48 +0000)] 
Merge branch 'ondrej/release-notes-doesnt-need-copyright' into 'main'

Remove the requirement for the release notes to have copyright

See merge request isc-projects/bind9!4483

5 years agoRemove the requirement for the release notes to have copyright
Ondřej Surý [Wed, 9 Dec 2020 09:35:13 +0000 (10:35 +0100)] 
Remove the requirement for the release notes to have copyright

The release notes doesn't have to have copyright header, it doesn't add
any value there as the release notes are useless outside the project.

5 years agoMerge branch 'ondrej/clang-format-11' into 'main'
Ondřej Surý [Tue, 8 Dec 2020 18:35:25 +0000 (18:35 +0000)] 
Merge branch 'ondrej/clang-format-11' into 'main'

Update the clang version to new stable llvm/clang 11

See merge request isc-projects/bind9!4003

5 years agoBump the clang version to 11 (stable)
Ondřej Surý [Mon, 24 Aug 2020 07:24:25 +0000 (09:24 +0200)] 
Bump the clang version to 11 (stable)

5 years agoReformat sources using clang-format-11
Ondřej Surý [Mon, 24 Aug 2020 07:23:19 +0000 (09:23 +0200)] 
Reformat sources using clang-format-11

5 years agoExplicitly configure new clang-format-11 options
Ondřej Surý [Mon, 24 Aug 2020 07:23:06 +0000 (09:23 +0200)] 
Explicitly configure new clang-format-11 options

5 years agoMerge branch 'placeholder' into 'main'
Evan Hunt [Fri, 4 Dec 2020 19:40:42 +0000 (19:40 +0000)] 
Merge branch 'placeholder' into 'main'

placeholder for change 5546

See merge request isc-projects/bind9!4473

5 years agoplaceholder for change 5546
Evan Hunt [Fri, 4 Dec 2020 19:37:58 +0000 (11:37 -0800)] 
placeholder for change 5546

5 years agoMerge branch 'ondrej/fix-using-the-load-balanced-sockets' into 'main'
Ondřej Surý [Fri, 4 Dec 2020 13:55:56 +0000 (13:55 +0000)] 
Merge branch 'ondrej/fix-using-the-load-balanced-sockets' into 'main'

Fix s/HAVE_REUSEPORT_LB/HAVE_SO_REUSEPORT_LB/ typo in #define

See merge request isc-projects/bind9!4472

5 years agoFix HAVE_SO_REUSEPORT_LB macro name definition
Ondřej Surý [Fri, 4 Dec 2020 12:19:44 +0000 (13:19 +0100)] 
Fix HAVE_SO_REUSEPORT_LB macro name definition

A typo in macro definition caused the load-balanced sockets to be
disabled even on platforms with existing support for load-balanced
sockets.

5 years agoMerge branch 'ondrej/fix-the-windows-nchildren-problem' into 'main'
Ondřej Surý [Thu, 3 Dec 2020 17:42:53 +0000 (17:42 +0000)] 
Merge branch 'ondrej/fix-the-windows-nchildren-problem' into 'main'

Use sock->nchildren instead of mgr->nworkers when initializing NM

See merge request isc-projects/bind9!4469

5 years agoUse sock->nchildren instead of mgr->nworkers when initializing NM
Ondřej Surý [Thu, 3 Dec 2020 16:58:10 +0000 (17:58 +0100)] 
Use sock->nchildren instead of mgr->nworkers when initializing NM

On Windows, we were limiting the number of listening children to just 1,
but we were then iterating on mgr->nworkers.  That lead to scheduling
more async_*listen() than actually allocated and out-of-bound read-write
operation on the heap.

5 years agoMerge branch '2314-fix-datarace-in-nm-connect-functions' into 'main'
Ondřej Surý [Thu, 3 Dec 2020 14:41:57 +0000 (14:41 +0000)] 
Merge branch '2314-fix-datarace-in-nm-connect-functions' into 'main'

Fix datarace when UDP/TCP connect fails and we are in nmthread

Closes #2332 and #2314

See merge request isc-projects/bind9!4468

5 years agoMerge branch 'ondrej/set-openbsd-system-connection-timeout' into 'main'
Ondřej Surý [Thu, 3 Dec 2020 13:02:57 +0000 (13:02 +0000)] 
Merge branch 'ondrej/set-openbsd-system-connection-timeout' into 'main'

Configure the system-wide TCP connection timeout on OpenBSD

See merge request isc-projects/bind9!4466

5 years agoConfigure the system-wide TCP connection timeout on OpenBSD
Ondřej Surý [Thu, 3 Dec 2020 10:24:57 +0000 (11:24 +0100)] 
Configure the system-wide TCP connection timeout on OpenBSD

As there's no TCP connection timeout socket option that we can use, we
need to configure the TCP connection timeout system-wide in the CI, so
the netmgr unit tests doesn't cause assertion failure when there stuck
outgoing TCP connection waiting for 150 second timeout.

5 years agoFix datarace when UDP/TCP connect fails and we are in nmthread
Ondřej Surý [Thu, 3 Dec 2020 12:00:33 +0000 (13:00 +0100)] 
Fix datarace when UDP/TCP connect fails and we are in nmthread

When we were in nmthread, the isc__nm_async_<proto>connect() function
executes in the same thread as the isc__nm_<proto>connect() and on a
failure, it would block indefinitely because the failure branch was
setting sock->active to false before the condition around the wait had a
chance to skip the WAIT().

This also fixes the zero system test being stuck on FreeBSD 11, so we
re-enable the test in the commit.

5 years agoMerge branch '2333-temporarily-disable-the-legacy-test-on-windows' into 'main'
Michał Kępień [Thu, 3 Dec 2020 11:49:43 +0000 (11:49 +0000)] 
Merge branch '2333-temporarily-disable-the-legacy-test-on-windows' into 'main'

Temporarily disable the "legacy" test on Windows

See merge request isc-projects/bind9!4462

5 years agoTemporarily disable the "legacy" test on Windows
Michał Kępień [Thu, 3 Dec 2020 11:48:43 +0000 (12:48 +0100)] 
Temporarily disable the "legacy" test on Windows

The current issues with the way dig handles TCP "connection refused"
errors cause the "legacy" system test to consistently fail on Windows
due to the expected strings not being present in dig output.
Temporarily disable the "legacy" system test on Windows by moving it
from the PARALLEL_COMMON list to the PARALLEL_UNIX list until the
situation is rectified.

5 years agoMerge branch '2137-so_reuseport-doesn-t-distribute-udp-queries-to-multiple-netmgr...
Ondřej Surý [Thu, 3 Dec 2020 09:58:02 +0000 (09:58 +0000)] 
Merge branch '2137-so_reuseport-doesn-t-distribute-udp-queries-to-multiple-netmgr-workers-on-macos' into 'main'

Distribute queries among threads even on platforms without SO_REUSEPORT_LB

Closes #2137

See merge request isc-projects/bind9!4459

5 years agoAdd CHANGES and release note for GL #2137
Ondřej Surý [Wed, 2 Dec 2020 15:24:15 +0000 (16:24 +0100)] 
Add CHANGES and release note for GL #2137

5 years agoAdd FreeBSD connection timeout socket option
Ondřej Surý [Wed, 2 Dec 2020 20:54:25 +0000 (21:54 +0100)] 
Add FreeBSD connection timeout socket option

On FreeBSD, the option to configure connection timeout is called
TCP_KEEPINIT, use it to configure the connection timeout there.

This also fixes the dangling socket problems in the unit test, so
re-enable them.

5 years agoMerge branch '2332-fix-use-after-free-in-tcpdns_send_direct' into 'main'
Ondřej Surý [Thu, 3 Dec 2020 08:21:10 +0000 (08:21 +0000)] 
Merge branch '2332-fix-use-after-free-in-tcpdns_send_direct' into 'main'

Don't use stack allocated buffer for uv_write()

Closes #2332

See merge request isc-projects/bind9!4465

5 years agoDistribute queries among threads even on platforms without lb sockets
Ondřej Surý [Wed, 2 Dec 2020 14:37:18 +0000 (15:37 +0100)] 
Distribute queries among threads even on platforms without lb sockets

On platforms without load-balancing socket all the queries would be
handle by a single thread.  Currently, the support for load-balanced
sockets is present in Linux with SO_REUSEPORT and FreeBSD 12 with
SO_REUSEPORT_LB.

This commit adds workaround for such platforms that:

1. setups single shared listening socket for all listening nmthreads for
   UDP, TCP and TCPDNS netmgr transports

2. Calls uv_udp_bind/uv_tcp_bind on the underlying socket just once and
   for rest of the nmthreads only copy the internal libuv flags (should
   be just UV_HANDLE_BOUND and optionally UV_HANDLE_IPV6).

3. start reading on UDP socket or listening on TCP socket

The load distribution among the nmthreads is uneven, but it's still
better than utilizing just one thread for processing all the incoming
queries

5 years agoDon't use stack allocated buffer for uv_write()
Ondřej Surý [Thu, 3 Dec 2020 07:33:21 +0000 (08:33 +0100)] 
Don't use stack allocated buffer for uv_write()

On FreeBSD, the stack is destroyed more aggressively than on Linux and
that revealed a bug where we were allocating the 16-bit len for the
TCPDNS message on the stack and the buffer got garbled before the
uv_write() sendback was executed.  Now, the len is part of the uvreq, so
we can safely pass it to the uv_write() as the req gets destroyed after
the sendcb is executed.

5 years agoMerge branch 'artem/random-additions-to-the-gitignore' into 'main'
Artem Boldariev [Wed, 2 Dec 2020 22:25:55 +0000 (22:25 +0000)] 
Merge branch 'artem/random-additions-to-the-gitignore' into 'main'

Some small, random additions to the .gitignore.

See merge request isc-projects/bind9!4463

5 years agoSome small, random additions to the .gitignore.
Artem Boldariev [Wed, 2 Dec 2020 22:15:22 +0000 (00:15 +0200)] 
Some small, random additions to the .gitignore.

Ignores some auxiliary files generated/used by the following tools: -

- clangd
- GNU Global
- Emacs

5 years agoMerge branch '2328-make-netmgr-initialize-and-cleanup-winsock-itself' into 'main'
Michał Kępień [Wed, 2 Dec 2020 21:39:14 +0000 (21:39 +0000)] 
Merge branch '2328-make-netmgr-initialize-and-cleanup-winsock-itself' into 'main'

Make netmgr initialize and cleanup Winsock itself

Closes #2328

See merge request isc-projects/bind9!4458

5 years agoMake netmgr initialize and cleanup Winsock itself
Michał Kępień [Wed, 2 Dec 2020 21:36:23 +0000 (22:36 +0100)] 
Make netmgr initialize and cleanup Winsock itself

On Windows, WSAStartup() needs to be called to initialize Winsock before
any sockets are created or else socket() calls will return error code
10093 (WSANOTINITIALISED).  Since BIND's Network Manager is intended to
work as a reusable networking library, it should take care of calling
WSAStartup() - and its cleanup counterpart, WSACleanup() - itself rather
than relying on external code to do it.  Add the necessary WSAStartup()
and WSACleanup() calls to isc_nm_start() and isc_nm_destroy(),
respectively.

5 years agoExtend log message for unexpected socket() errors
Michał Kępień [Wed, 2 Dec 2020 21:36:23 +0000 (22:36 +0100)] 
Extend log message for unexpected socket() errors

Make sure the error code is included in the message logged for
unexpected socket creation errors in order to facilitate troubleshooting
on Windows.

5 years agoMerge branch '2327-error-uv_wrap-h-no-such-file-or-directory-on-unit-gcc-tarball...
Michal Nowak [Wed, 2 Dec 2020 15:09:45 +0000 (15:09 +0000)] 
Merge branch '2327-error-uv_wrap-h-no-such-file-or-directory-on-unit-gcc-tarball-ci-job' into 'main'

Add uv_wrap.h to libisctest_la_SOURCES

Closes #2327

See merge request isc-projects/bind9!4451

5 years agoAdd uv_wrap.h to libisctest_la_SOURCES
Michal Nowak [Wed, 2 Dec 2020 07:57:46 +0000 (08:57 +0100)] 
Add uv_wrap.h to libisctest_la_SOURCES

uv_wrap.h is included in tcp_test.c and udp_test.c and therefore should
be listed in lib/isc/tests/Makefile.am, otherwise unit test run from
distribution tarball fails to compile:

tcp_test.c:37:10: fatal error: uv_wrap.h: No such file or directory
 #include "uv_wrap.h"
          ^~~~~~~~~~~

udp_test.c:37:10: fatal error: uv_wrap.h: No such file or directory
 #include "uv_wrap.h"
          ^~~~~~~~~~~

5 years agoMerge branch '2250-dns-flag-day-2020-revert-nocookie-udp-size' into 'main'
Ondřej Surý [Wed, 2 Dec 2020 11:01:16 +0000 (11:01 +0000)] 
Merge branch '2250-dns-flag-day-2020-revert-nocookie-udp-size' into 'main'

Resolve "DNS Flag Day 2020 - EDNS buffer size configuring does not work anymore"

Closes #2250

See merge request isc-projects/bind9!4449

5 years agoAdd CHANGES and release not for GL #2250
Ondřej Surý [Tue, 1 Dec 2020 18:01:30 +0000 (19:01 +0100)] 
Add CHANGES and release not for GL #2250

5 years agoChange the default value for nocookie-udp-size back to 4096
Ondřej Surý [Tue, 1 Dec 2020 17:53:26 +0000 (18:53 +0100)] 
Change the default value for nocookie-udp-size back to 4096

The DNS Flag Day 2020 reduced all the EDNS buffer sizes to 1232.  In
this commit, we revert the default value for nocookie-udp-size back to
4096 because the option is too obscure and most people don't realize
that they also need to change this configuration option in addition to
max-udp-size.

5 years agoMerge branch '2320-avoid-netievent-allocations-if-not-needed' into 'main'
Ondřej Surý [Wed, 2 Dec 2020 10:04:25 +0000 (10:04 +0000)] 
Merge branch '2320-avoid-netievent-allocations-if-not-needed' into 'main'

Avoid netievent allocations when the callbacks can be called directly

Closes #2320

See merge request isc-projects/bind9!4452

5 years agoAdd CHANGES note for GL #2320
Ondřej Surý [Wed, 2 Dec 2020 08:56:11 +0000 (09:56 +0100)] 
Add CHANGES note for GL #2320

5 years agoFix the data race in accessing the isc_nm_t timers
Ondřej Surý [Wed, 2 Dec 2020 08:52:39 +0000 (09:52 +0100)] 
Fix the data race in accessing the isc_nm_t timers

The following TSAN report about accessing the mgr timers (mgr->init,
mgr->idle, mgr->keepalive and mgr->advertised) has been fixed in this
commit:

    ==================
    WARNING: ThreadSanitizer: data race (pid=2746)
    Read of size 4 at 0x7b440008a948 by thread T18:
    #0 isc__nm_tcpdns_read /home/ondrej/Projects/bind9/lib/isc/netmgr/tcpdns.c:849:25 (libisc.so.1706+0x2ba0f)
    #1 isc_nm_read /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1679:3 (libisc.so.1706+0x22258)
    #2 tcpdns_connect_connect_cb /home/ondrej/Projects/bind9/lib/isc/tests/tcpdns_test.c:363:2 (tcpdns_test+0x4bc5fb)
    #3 isc__nm_async_connectcb /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1816:2 (libisc.so.1706+0x228c9)
    #4 isc__nm_connectcb /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1791:3 (libisc.so.1706+0x22713)
    #5 tcpdns_connect_cb /home/ondrej/Projects/bind9/lib/isc/netmgr/tcpdns.c:343:2 (libisc.so.1706+0x2d89d)
    #6 uv__stream_connect /home/ondrej/Projects/tsan/libuv/src/unix/stream.c:1381:5 (libuv.so.1+0x27c18)
    #7 uv__stream_io /home/ondrej/Projects/tsan/libuv/src/unix/stream.c:1298:5 (libuv.so.1+0x25977)
    #8 uv__io_poll /home/ondrej/Projects/tsan/libuv/src/unix/linux-core.c:462:11 (libuv.so.1+0x2e795)
    #9 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:385:5 (libuv.so.1+0x158ec)
    #10 nm_thread /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:530:11 (libisc.so.1706+0x1c94a)

    Previous write of size 4 at 0x7b440008a948 by main thread:
    #0 isc_nm_settimeouts /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:490:12 (libisc.so.1706+0x1dda5)
    #1 tcpdns_recv_two /home/ondrej/Projects/bind9/lib/isc/tests/tcpdns_test.c:601:2 (tcpdns_test+0x4bad0e)
    #2 cmocka_run_one_test_or_fixture <null> (libcmocka.so.0+0x70be)
    #3 __libc_start_main /build/glibc-vjB4T1/glibc-2.28/csu/../csu/libc-start.c:308:16 (libc.so.6+0x2409a)

    Location is heap block of size 281 at 0x7b440008a840 allocated by main thread:
    #0 malloc <null> (tcpdns_test+0x42864b)
    #1 default_memalloc /home/ondrej/Projects/bind9/lib/isc/mem.c:713:8 (libisc.so.1706+0x6d261)
    #2 mem_get /home/ondrej/Projects/bind9/lib/isc/mem.c:622:8 (libisc.so.1706+0x69b9c)
    #3 isc___mem_get /home/ondrej/Projects/bind9/lib/isc/mem.c:1044:9 (libisc.so.1706+0x6d379)
    #4 isc__mem_get /home/ondrej/Projects/bind9/lib/isc/mem.c:2432:10 (libisc.so.1706+0x6889e)
    #5 isc_nm_start /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:203:8 (libisc.so.1706+0x1c219)
    #6 nm_setup /home/ondrej/Projects/bind9/lib/isc/tests/tcpdns_test.c:244:11 (tcpdns_test+0x4baaa4)
    #7 cmocka_run_one_test_or_fixture <null> (libcmocka.so.0+0x70fd)
    #8 __libc_start_main /build/glibc-vjB4T1/glibc-2.28/csu/../csu/libc-start.c:308:16 (libc.so.6+0x2409a)

    Thread T18 'isc-net-0000' (tid=3513, running) created by main thread at:
    #0 pthread_create <null> (tcpdns_test+0x429e7b)
    #1 isc_thread_create /home/ondrej/Projects/bind9/lib/isc/pthreads/thread.c:73:8 (libisc.so.1706+0x8476a)
    #2 isc_nm_start /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:271:3 (libisc.so.1706+0x1c66a)
    #3 nm_setup /home/ondrej/Projects/bind9/lib/isc/tests/tcpdns_test.c:244:11 (tcpdns_test+0x4baaa4)
    #4 cmocka_run_one_test_or_fixture <null> (libcmocka.so.0+0x70fd)
    #5 __libc_start_main /build/glibc-vjB4T1/glibc-2.28/csu/../csu/libc-start.c:308:16 (libc.so.6+0x2409a)

    SUMMARY: ThreadSanitizer: data race /home/ondrej/Projects/bind9/lib/isc/netmgr/tcpdns.c:849:25 in isc__nm_tcpdns_read
    ==================
    ThreadSanitizer: reported 1 warnings

5 years agoAvoid netievent allocations when the callbacks can be called directly
Ondřej Surý [Wed, 2 Dec 2020 07:54:51 +0000 (08:54 +0100)] 
Avoid netievent allocations when the callbacks can be called directly

After turning the users callbacks to be asynchronous, there was a
visible performance drop.  This commit prevents the unnecessary
allocations while keeping the code paths same for both asynchronous and
synchronous calls.

The same change was done to the isc__nm_udp_{read,send} as those two
functions are in the hot path.

5 years agoMerge branch '2321-netmgr-v2' into 'main'
Ondřej Surý [Tue, 1 Dec 2020 17:07:06 +0000 (17:07 +0000)] 
Merge branch '2321-netmgr-v2' into 'main'

Refactor netmgr and add more unit tests

Closes #2321, #2061, #1920, #2034, #2266, #2318, #2283, and #2194

See merge request isc-projects/bind9!4444

5 years agoDisable the new netmgr tests on non-Linux platforms
Ondřej Surý [Tue, 1 Dec 2020 15:08:44 +0000 (16:08 +0100)] 
Disable the new netmgr tests on non-Linux platforms

The new netmgr tests are not-yet fine-tuned for non-Linux platforms.
Disable them now, so we can move forward and fix the tests of *BSD
in the next iteration.

This commit will get reverted when we add support for netmgr
multi-threading.

5 years agoSkip the zero, xfer and ixfr tests on non-Linux platforms
Ondřej Surý [Tue, 1 Dec 2020 14:18:10 +0000 (15:18 +0100)] 
Skip the zero, xfer and ixfr tests on non-Linux platforms

Due to the platform differences, on non-Linux platforms, the xfer and
ixfr tests fails and zero test gets stuck.

This commit will get reverted when we add support for netmgr
multi-threading.

5 years agoThe cmocka.h header MUST be included before isc/util.h gets included
Ondřej Surý [Tue, 1 Dec 2020 14:08:49 +0000 (15:08 +0100)] 
The cmocka.h header MUST be included before isc/util.h gets included

The isc/util.h header redefine the DbC checks (REQUIRE, INSIST, ...)  to
be cmocka "fake" assertions.  However that means that cmocka.h needs to
be included after UNIT_TESTING is defined but before isc/util.h is
included.  Because isc/util.h is included in most of the project headers
this means that the sequence MUST be:

    #define UNIT_TESTING
    #include <cmocka.h>

    #include <isc/_anything_.h>

See !2204 for other header requirements for including cmocka.h.

5 years agoAdd release note for known issue #2137
Ondřej Surý [Tue, 1 Dec 2020 12:57:25 +0000 (13:57 +0100)] 
Add release note for known issue #2137

5 years agoAdd CHANGES note for multiple netmgr issues
Ondřej Surý [Tue, 1 Dec 2020 12:01:53 +0000 (13:01 +0100)] 
Add CHANGES note for multiple netmgr issues

5 years agoRefactor netmgr and add more unit tests
Ondřej Surý [Thu, 12 Nov 2020 09:32:18 +0000 (10:32 +0100)] 
Refactor netmgr and add more unit tests

This is a part of the works that intends to make the netmgr stable,
testable, maintainable and tested.  It contains a numerous changes to
the netmgr code and unfortunately, it was not possible to split this
into smaller chunks as the work here needs to be committed as a complete
works.

NOTE: There's a quite a lot of duplicated code between udp.c, tcp.c and
tcpdns.c and it should be a subject to refactoring in the future.

The changes that are included in this commit are listed here
(extensively, but not exclusively):

* The netmgr_test unit test was split into individual tests (udp_test,
  tcp_test, tcpdns_test and newly added tcp_quota_test)

* The udp_test and tcp_test has been extended to allow programatic
  failures from the libuv API.  Unfortunately, we can't use cmocka
  mock() and will_return(), so we emulate the behaviour with #define and
  including the netmgr/{udp,tcp}.c source file directly.

* The netievents that we put on the nm queue have variable number of
  members, out of these the isc_nmsocket_t and isc_nmhandle_t always
  needs to be attached before enqueueing the netievent_<foo> and
  detached after we have called the isc_nm_async_<foo> to ensure that
  the socket (handle) doesn't disappear between scheduling the event and
  actually executing the event.

* Cancelling the in-flight TCP connection using libuv requires to call
  uv_close() on the original uv_tcp_t handle which just breaks too many
  assumptions we have in the netmgr code.  Instead of using uv_timer for
  TCP connection timeouts, we use platform specific socket option.

* Fix the synchronization between {nm,async}_{listentcp,tcpconnect}

  When isc_nm_listentcp() or isc_nm_tcpconnect() is called it was
  waiting for socket to either end up with error (that path was fine) or
  to be listening or connected using condition variable and mutex.

  Several things could happen:

    0. everything is ok

    1. the waiting thread would miss the SIGNAL() - because the enqueued
       event would be processed faster than we could start WAIT()ing.
       In case the operation would end up with error, it would be ok, as
       the error variable would be unchanged.

    2. the waiting thread miss the sock->{connected,listening} = `true`
       would be set to `false` in the tcp_{listen,connect}close_cb() as
       the connection would be so short lived that the socket would be
       closed before we could even start WAIT()ing

* The tcpdns has been converted to using libuv directly.  Previously,
  the tcpdns protocol used tcp protocol from netmgr, this proved to be
  very complicated to understand, fix and make changes to.  The new
  tcpdns protocol is modeled in a similar way how tcp netmgr protocol.
Closes: #2194, #2283, #2318, #2266, #2034, #1920
* The tcp and tcpdns is now not using isc_uv_import/isc_uv_export to
  pass accepted TCP sockets between netthreads, but instead (similar to
  UDP) uses per netthread uv_loop listener.  This greatly reduces the
  complexity as the socket is always run in the associated nm and uv
  loops, and we are also not touching the libuv internals.

  There's an unfortunate side effect though, the new code requires
  support for load-balanced sockets from the operating system for both
  UDP and TCP (see #2137).  If the operating system doesn't support the
  load balanced sockets (either SO_REUSEPORT on Linux or SO_REUSEPORT_LB
  on FreeBSD 12+), the number of netthreads is limited to 1.

* The netmgr has now two debugging #ifdefs:

  1. Already existing NETMGR_TRACE prints any dangling nmsockets and
     nmhandles before triggering assertion failure.  This options would
     reduce performance when enabled, but in theory, it could be enabled
     on low-performance systems.

  2. New NETMGR_TRACE_VERBOSE option has been added that enables
     extensive netmgr logging that allows the software engineer to
     precisely track any attach/detach operations on the nmsockets and
     nmhandles.  This is not suitable for any kind of production
     machine, only for debugging.

* The tlsdns netmgr protocol has been split from the tcpdns and it still
  uses the old method of stacking the netmgr boxes on top of each other.
  We will have to refactor the tlsdns netmgr protocol to use the same
  approach - build the stack using only libuv and openssl.

* Limit but not assert the tcp buffer size in tcp_alloc_cb
Closes: #2061
5 years agoMerge branch '2305-adjust-recursion-limits' into 'main'
Mark Andrews [Tue, 1 Dec 2020 13:51:16 +0000 (13:51 +0000)] 
Merge branch '2305-adjust-recursion-limits' into 'main'

Adjust recursion limits

Closes #2305

See merge request isc-projects/bind9!4424

5 years agoAdjust default value of "max-recursion-queries"
Mark Andrews [Thu, 26 Nov 2020 04:59:14 +0000 (15:59 +1100)] 
Adjust default value of "max-recursion-queries"

Since the queries sent towards root and TLD servers are now included in
the count (as a result of the fix for CVE-2020-8616),
"max-recursion-queries" has a higher chance of being exceeded by
non-attack queries.  Increase its default value from 75 to 100.

5 years agoMerge branch '2315-bind-9-11-22-9-11-25-fails-to-build-for-aep-hsm-native-pkcs11...
Mark Andrews [Tue, 1 Dec 2020 12:15:57 +0000 (12:15 +0000)] 
Merge branch '2315-bind-9-11-22-9-11-25-fails-to-build-for-aep-hsm-native-pkcs11' into 'main'

Resolve "BIND 9.11.22 - 9.11.25 fails to build for AEP HSM native pkcs11"

Closes #2315

See merge request isc-projects/bind9!4441

5 years agoAdd release note for [GL #2315]
Mark Andrews [Mon, 30 Nov 2020 23:39:41 +0000 (10:39 +1100)] 
Add release note for [GL #2315]

5 years agoAdd CHANGES
Mark Andrews [Mon, 30 Nov 2020 01:16:41 +0000 (12:16 +1100)] 
Add CHANGES

5 years agoFix misplaced declaration
Mark Andrews [Fri, 27 Nov 2020 21:13:44 +0000 (08:13 +1100)] 
Fix misplaced declaration

5 years agoMerge branch 'mnowak/drop_headerdep_test.sh.in' into 'main'
Michal Nowak [Fri, 27 Nov 2020 12:14:29 +0000 (12:14 +0000)] 
Merge branch 'mnowak/drop_headerdep_test.sh.in' into 'main'

Drop bin/tests/headerdep_test.sh.in, revise OPTIONS.md

See merge request isc-projects/bind9!4401

5 years agoDrop bin/tests/headerdep_test.sh.in
Michal Nowak [Thu, 19 Nov 2020 11:33:27 +0000 (12:33 +0100)] 
Drop bin/tests/headerdep_test.sh.in

The bin/tests/headerdep_test.sh script has not been updated since it was
first created and it cannot be used as-is with the current BIND source
code.  Better tools (e.g. "include-what-you-use") emerged since the
script was committed back in 2000, so instead of trying to bring it up
to date, remove it from the source repository.

5 years agoRevise OPTIONS.md
Michal Nowak [Thu, 19 Nov 2020 09:35:57 +0000 (10:35 +0100)] 
Revise OPTIONS.md

  - The STD_CDEFINES build-time variable was dropped when the build
    system was migrated to Automake.  CPPFLAGS is the variable which
    should now be used for setting preprocessor macros.

  - Sort the list of preprocessor macros which affect BIND behavior.
    Remove ISC_BUFFER_USEINLINE from the list as it can be controlled
    using its relevant ./configure option (--enable-buffer-useinline).
    Rename NS_RUN_PID_DIR to NAMED_RUN_PID_DIR to match the source code.

  - Tweak Markdown formatting.

5 years agoMerge branch '2275-tighten-dns-cookie-response-handling' into 'main'
Mark Andrews [Thu, 26 Nov 2020 21:10:28 +0000 (21:10 +0000)] 
Merge branch '2275-tighten-dns-cookie-response-handling' into 'main'

Resolve "Tighten DNS COOKIE response handling"

Closes #2275

See merge request isc-projects/bind9!4391

5 years agoAdd release note for [GL #2275]
Mark Andrews [Tue, 24 Nov 2020 14:00:19 +0000 (01:00 +1100)] 
Add release note for [GL #2275]

5 years agoAdd CHANGES note for [GL #2275]
Mark Andrews [Fri, 13 Nov 2020 04:44:39 +0000 (15:44 +1100)] 
Add CHANGES note for [GL #2275]

5 years agoAdd comment about cookie sizes
Mark Andrews [Tue, 24 Nov 2020 13:12:00 +0000 (00:12 +1100)] 
Add comment about cookie sizes