]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
5 years agoAdd CHANGES entry
Diego Fronza [Thu, 10 Sep 2020 18:51:46 +0000 (15:51 -0300)] 
Add CHANGES entry

5 years agoAdjusted additional system test (NS, non-root zone)
Diego Fronza [Fri, 2 Oct 2020 15:07:59 +0000 (12:07 -0300)] 
Adjusted additional system test (NS, non-root zone)

After the updates from this branch, BIND now sends glue records for
NS queries even when configured with minimal-responses yes.

5 years agoAdded test for the proposed fix
Diego Fronza [Thu, 10 Sep 2020 18:33:15 +0000 (15:33 -0300)] 
Added test for the proposed fix

This test is very simple, two nameserver instances are created:
    - ns4: master, with 'minimal-responses yes', authoritative
        for example. zone
    - ns5: slave, stub zone

The first thing verified is the transfer of zone data from master
to slave, which should be saved in ns5/example.db.

After that, a query is issued to ns5 asking for target.example.
TXT, a record present in the master database with the "test" string
as content.

If that query works, it means stub zone successfully request
nameserver addresses from master, ns4.example. A/AAAA

The presence of both A/AAAA records for ns4 is also verified in the
stub zone local file, ns5/example.db.

5 years agoAlways return address records in additional section for NS queries
Diego Fronza [Wed, 30 Sep 2020 20:22:39 +0000 (17:22 -0300)] 
Always return address records in additional section for NS queries

5 years agoFix transfer of glue records in stub zones if master has minimal-responses set
Diego Fronza [Thu, 10 Sep 2020 18:09:14 +0000 (15:09 -0300)] 
Fix transfer of glue records in stub zones if master has minimal-responses set

Stub zones don't make use of AXFR/IXFR for the transfering of zone
data, instead, a single query is issued to the master asking for
their nameserver records (NS).

That works fine unless master is configured with 'minimal-responses'
set to yes, in which case glue records are not provided by master
in the answer with nameservers authoritative for the zone, leaving
stub zones with incomplete databases.

This commit fix this problem in a simple way, when the answer with
the authoritative nameservers is received from master (stub_callback),
for each nameserver listed (save_nsrrset), a A and AAAA records for
the name is verified in the additional section, and if not present
a query is created to resolve the corresponsing missing glue.

A struct 'stub_cb_args' was added to keep relevant information for
performing a query, like TSIG key, udp size, dscp value, etc, this
information is borrowed from, and created within function 'ns_query',
where the resolving of nameserver from master starts.

A new field was added to the struct 'dns_stub', an atomic integer,
namely pending_requests, which is used to keep how many queries are
created when resolving nameserver addresses that were missing in
the glue.

When the value of pending_requests is zero we know we can release
resources, adjust zone timers, dump to zone file, etc.

5 years agoMerge branch '1490-run-unit-tests-on-openbsd-in-ci' into 'main'
Michal Nowak [Wed, 21 Oct 2020 11:15:23 +0000 (11:15 +0000)] 
Merge branch '1490-run-unit-tests-on-openbsd-in-ci' into 'main'

Add OpenBSD unit tests to CI

Closes #1490

See merge request isc-projects/bind9!4269

5 years agoRun unit tests on OpenBSD in GitLab CI
Michal Nowak [Mon, 19 Oct 2020 05:47:57 +0000 (07:47 +0200)] 
Run unit tests on OpenBSD in GitLab CI

Unlike other maintained BIND branches, the "main" BIND branch does not
require Kyua for running unit tests, which has been an obstacle for
adding an OpenBSD unit test job to GitLab CI.  Experiments show that a
complete BIND unit test suite completes in a few minutes on OpenBSD and
that unit tests are not as severely affected by OpenBSD performance
issues as system tests are.  Add a GitLab CI job which runs unit tests
on OpenBSD to every pipeline.

5 years agoMerge branch '2195-freebsd-dnstap-system-test-failure' into 'main'
Diego dos Santos Fronza [Tue, 20 Oct 2020 13:20:04 +0000 (13:20 +0000)] 
Merge branch '2195-freebsd-dnstap-system-test-failure' into 'main'

Resolve "FreeBSD dnstap system test failure"

Closes #2195

See merge request isc-projects/bind9!4213

5 years agoFix dnstap system test on FreeBSD
Diego Fronza [Thu, 1 Oct 2020 17:04:05 +0000 (14:04 -0300)] 
Fix dnstap system test on FreeBSD

This commit ensures that dnstap output files captured
by fstrm_capture are properly flushed before any attempt
on reading them with dnstap-read is done.

By reading fstrm-capture source code it was noticed that
signal SIGHUP is used to flush the capture file.

5 years agoMerge branch '2208-tcp4recverr-stat-miscount' into 'main'
Matthijs Mekking [Tue, 20 Oct 2020 11:57:35 +0000 (11:57 +0000)] 
Merge branch '2208-tcp4recverr-stat-miscount' into 'main'

Don't increment network error stats on UV_EOF

Closes #2208

See merge request isc-projects/bind9!4274

5 years agoDon't increment network error stats on UV_EOF
Matthijs Mekking [Tue, 20 Oct 2020 08:57:16 +0000 (10:57 +0200)] 
Don't increment network error stats on UV_EOF

When networking statistics was added to the netmgr (in commit
5234a8e00a6ae1df738020f27544594ccb8d5215), two lines were added that
increment the 'STATID_RECVFAIL' statistic: One if 'uv_read_start'
fails and one at the end of the 'read_cb'.  The latter happens
if 'nread < 0'.

According to the libuv documentation, I/O read callbacks (such as for
files and sockets) are passed a parameter 'nread'. If 'nread' is less
than 0, there was an error and 'UV_EOF' is the end of file error, which
you may want to handle differently.

In other words, we should not treat EOF as a RECVFAIL error.

5 years agoMerge branch 'marka-fix-not-enough-categories' into 'main'
Mark Andrews [Thu, 15 Oct 2020 01:02:49 +0000 (01:02 +0000)] 
Merge branch 'marka-fix-not-enough-categories' into 'main'

Tune the minimum number of expected categories.

See merge request isc-projects/bind9!4216

5 years agoDrop the expected minimum number of buckets to 4.
Mark Andrews [Fri, 2 Oct 2020 02:27:54 +0000 (12:27 +1000)] 
Drop the expected minimum number of buckets to 4.

The previous value of 5 produced too many false errors.

5 years agoMerge branch 'marka-rrl-mdig-burst' into 'main'
Mark Andrews [Thu, 15 Oct 2020 00:37:59 +0000 (00:37 +0000)] 
Merge branch 'marka-rrl-mdig-burst' into 'main'

Try to improve rrl timing

See merge request isc-projects/bind9!4126

5 years agoTry to improve rrl timing
Mark Andrews [Wed, 16 Sep 2020 02:40:52 +0000 (12:40 +1000)] 
Try to improve rrl timing

Add a +burst option to mdig so that we have a second to setup the
mdig calls then they run at the start of the next second.

RRL uses 'queries in a second' as a approximation to
'queries per second'. Getting the bursts of traffic to all happen in
the same second should prevent false negatives in the system test.

We now have a second to setup the traffic in.  Then the traffic should
be sent at the start of the next second.  If that still fails we
should move to +burst=<now+2> (further extend mdig) instead of the
implicit <now+1> as the trigger second.

5 years agoMerge branch '2209-tsan-error-bin-named-controlconf-c-related' into 'main'
Mark Andrews [Thu, 15 Oct 2020 00:01:36 +0000 (00:01 +0000)] 
Merge branch '2209-tsan-error-bin-named-controlconf-c-related' into 'main'

Resolve "TSAN error bin/named/controlconf.c related."

Closes #2209

See merge request isc-projects/bind9!4257

5 years agoComplete the isc_nmhandle_detach() in the worker thread.
Mark Andrews [Mon, 12 Oct 2020 06:51:09 +0000 (17:51 +1100)] 
Complete the isc_nmhandle_detach() in the worker thread.

isc_nmhandle_detach() needs to complete in the same thread
as shutdown_walk_cb() to avoid a race.  Clear the caller's
pointer then pass control to the worker if necessary.

    WARNING: ThreadSanitizer: data race
    Write of size 8 at 0x000000000001 by thread T1:
    #0 isc_nmhandle_detach lib/isc/netmgr/netmgr.c:1258:15
    #1 control_command bin/named/controlconf.c:388:3
    #2 dispatch lib/isc/task.c:1152:7
    #3 run lib/isc/task.c:1344:2

    Previous read of size 8 at 0x000000000001 by thread T2:
    #0 isc_nm_pauseread lib/isc/netmgr/netmgr.c:1449:33
    #1 recv_data lib/isccc/ccmsg.c:109:2
    #2 isc__nm_tcp_shutdown lib/isc/netmgr/tcp.c:1157:4
    #3 shutdown_walk_cb lib/isc/netmgr/netmgr.c:1515:3
    #4 uv_walk <null>
    #5 process_queue lib/isc/netmgr/netmgr.c:659:4
    #6 process_normal_queue lib/isc/netmgr/netmgr.c:582:10
    #7 process_queues lib/isc/netmgr/netmgr.c:590:8
    #8 async_cb lib/isc/netmgr/netmgr.c:548:2
    #9 <null> <null>

5 years agoMerge branch 'ondrej/little-socket-fixes' into 'main'
Ondřej Surý [Thu, 8 Oct 2020 07:02:15 +0000 (07:02 +0000)] 
Merge branch 'ondrej/little-socket-fixes' into 'main'

Various little fixes in the old socket code

See merge request isc-projects/bind9!4253

5 years agoClean the last remnant of ISC_PLATFORM_HAVEIPV6 macro
Ondřej Surý [Thu, 8 Oct 2020 06:26:28 +0000 (08:26 +0200)] 
Clean the last remnant of ISC_PLATFORM_HAVEIPV6 macro

In set_sndbuf() we were using ISC_PLATFORM_HAVEIPV6 macro that doesn't
exist anymore, because we assume that IPv6 support is always available.

5 years agoAlways set the DF flag (not only when CMSG is available)
Ondřej Surý [Thu, 8 Oct 2020 06:26:28 +0000 (08:26 +0200)] 
Always set the DF flag (not only when CMSG is available)

By mistake, we were setting the DF flag only when CMSG was available for
said platform.

5 years agoMerge branch 'ondrej/clean-netmgr-callback-locks' into 'main'
Ondřej Surý [Thu, 8 Oct 2020 05:42:39 +0000 (05:42 +0000)] 
Merge branch 'ondrej/clean-netmgr-callback-locks' into 'main'

Clean the locking around nm callbacks

See merge request isc-projects/bind9!4220

5 years agoClone the csock in accept_connection(), not in callback
Ondřej Surý [Fri, 18 Sep 2020 10:27:40 +0000 (12:27 +0200)] 
Clone the csock in accept_connection(), not in callback

If we clone the csock (children socket) in TCP accept_connection()
instead of passing the ssock (server socket) to the call back and
cloning it there we unbreak the assumption that every socket is handled
inside it's own worker thread and therefore we can get rid of (at least)
callback locking.

5 years agoChange the isc__nm_tcpdns_stoplistening() to be asynchronous event
Ondřej Surý [Fri, 2 Oct 2020 07:28:29 +0000 (09:28 +0200)] 
Change the isc__nm_tcpdns_stoplistening() to be asynchronous event

The isc__nm_tcpdns_stoplistening() would call isc__nmsocket_clearcb()
that would clear the .accept_cb from non-netmgr thread.  Change the
tcpdns_stoplistening to enqueue ievent that would get processed in the
right netmgr thread to avoid locking.

5 years agoMerge branch '2204-investigate-pipeline-system-test-failure' into 'main'
Mark Andrews [Thu, 8 Oct 2020 05:21:52 +0000 (05:21 +0000)] 
Merge branch '2204-investigate-pipeline-system-test-failure' into 'main'

Resolve "Investigate pipeline system test failure"

Closes #2204

See merge request isc-projects/bind9!4247

5 years agoRestore the dns_message_reset() call before the dns_dispatch_getnext()
Mark Andrews [Wed, 7 Oct 2020 23:55:35 +0000 (10:55 +1100)] 
Restore the dns_message_reset() call before the dns_dispatch_getnext()

This was accidentally lost in the process of moving rmessage from fctx
to query.  Without this dns_message_setclass() will fail.

5 years agoMerge branch 'matthijs-kasp-test-requires-python' into 'main'
Matthijs Mekking [Wed, 7 Oct 2020 15:22:23 +0000 (15:22 +0000)] 
Merge branch 'matthijs-kasp-test-requires-python' into 'main'

The kasp system test requires Python

See merge request isc-projects/bind9!4241

5 years agoThe kasp system test requires Python
Matthijs Mekking [Wed, 7 Oct 2020 07:39:06 +0000 (09:39 +0200)] 
The kasp system test requires Python

Only run the kasp system test if HAVE_PYTHON.

5 years agoMerge branch 'marka-wait-for-isc_nm_stoplistening' into 'main'
Mark Andrews [Wed, 7 Oct 2020 08:15:44 +0000 (08:15 +0000)] 
Merge branch 'marka-wait-for-isc_nm_stoplistening' into 'main'

Wait for isc_nm_stoplistening() to complete

See merge request isc-projects/bind9!4217

5 years agoFix the data race on shutdown/reconfig in control channel
Mark Andrews [Fri, 2 Oct 2020 06:17:51 +0000 (16:17 +1000)] 
Fix the data race on shutdown/reconfig in control channel

The controllistener could be freed before the event posted by
isc_nm_stoplistening() has been processed. This commit adds
a reference counter to the controllistener to determine when
to free the listener.

5 years agoMerge branch '2200-the-fuzzer-dns_message_parser-c-is-leaking-memory' into 'main'
Mark Andrews [Tue, 6 Oct 2020 13:20:36 +0000 (13:20 +0000)] 
Merge branch '2200-the-fuzzer-dns_message_parser-c-is-leaking-memory' into 'main'

Resolve "The fuzzer dns_message_parse.c is leaking memory."

Closes #2200

See merge request isc-projects/bind9!4239

5 years agoinvalidate cctx on error
Mark Andrews [Tue, 6 Oct 2020 12:50:01 +0000 (23:50 +1100)] 
invalidate cctx on error

5 years agoMerge branch 'marka-create_query-fix-REVERSE_INULL' into 'main'
Mark Andrews [Tue, 6 Oct 2020 12:33:56 +0000 (12:33 +0000)] 
Merge branch 'marka-create_query-fix-REVERSE_INULL' into 'main'

Silence Coverity REVERSE_INULL report

Closes #2198

See merge request isc-projects/bind9!4234

5 years agoSilence Coverity REVERSE_INULL report
Mark Andrews [Tue, 6 Oct 2020 06:34:09 +0000 (17:34 +1100)] 
Silence Coverity REVERSE_INULL report

message does not need to be tested to NULL

5 years agoMerge branch 'he32-test-fix' into 'main'
Matthijs Mekking [Tue, 6 Oct 2020 08:28:12 +0000 (08:28 +0000)] 
Merge branch 'he32-test-fix' into 'main'

Avoid a non-standard bashism: use of "==" in "test".

See merge request isc-projects/bind9!4235

5 years agoAvoid a non-standard bashism: use of "==" in "test".
Havard Eidnes [Fri, 2 Oct 2020 12:54:57 +0000 (14:54 +0200)] 
Avoid a non-standard bashism: use of "==" in "test".

5 years agoMerge branch 'marka-render_buf-was-too-big' into 'main'
Mark Andrews [Tue, 6 Oct 2020 07:37:30 +0000 (07:37 +0000)] 
Merge branch 'marka-render_buf-was-too-big' into 'main'

render_buf was too big

See merge request isc-projects/bind9!4231

5 years agorender buf was too big
Mark Andrews [Mon, 5 Oct 2020 22:49:28 +0000 (09:49 +1100)] 
render buf was too big

It was misdeclared as a array of pointers (uint8_t*[]) and there
where too many elements (64 * 1024) instead of (64 * 1024 - 1).

5 years agoMerge branch '2183-dns-flag-day-2020' into 'main'
Ondřej Surý [Mon, 5 Oct 2020 15:13:12 +0000 (15:13 +0000)] 
Merge branch '2183-dns-flag-day-2020' into 'main'

Resolve "DNS Flag Day 2020"

Closes #2183

See merge request isc-projects/bind9!4179

5 years agoAdd text describing the changes done in the MR in more detail
Ondřej Surý [Wed, 30 Sep 2020 16:38:32 +0000 (18:38 +0200)] 
Add text describing the changes done in the MR in more detail

5 years agoEnable DF (don't fragment) flag on listening UDP sockets
Ondřej Surý [Mon, 5 Oct 2020 08:51:40 +0000 (10:51 +0200)] 
Enable DF (don't fragment) flag on listening UDP sockets

This commits uses the isc__nm_socket_dontfrag() helper function to
enable setting DF bit on the outgoing UDP packets.

5 years agoChange the default EDNS buffer size for dig, mdig and host to 1232
Ondřej Surý [Wed, 30 Sep 2020 16:18:05 +0000 (18:18 +0200)] 
Change the default EDNS buffer size for dig, mdig and host to 1232

The dig should behave closely to how the resolver code in `named` work,
so we need to change the buffer size in dig, mdig and host too.

5 years agoAdjust legacy and digdelv tests for default 1232 EDNS Buffer Size
Ondřej Surý [Wed, 23 Sep 2020 14:36:44 +0000 (16:36 +0200)] 
Adjust legacy and digdelv tests for default 1232 EDNS Buffer Size

* the legacy test with -T maxudp512 will just fail, e.g. if the packets
  larger than 512 octets are dropped along the path, the proper response
  is to fail

* digdelv test was just expecting default server EDNS buffer size to be
  4096, the test needed only slight adjustment

5 years agoSimplify the EDNS buffer size logic for DNS Flag Day 2020
Ondřej Surý [Wed, 23 Sep 2020 12:47:26 +0000 (14:47 +0200)] 
Simplify the EDNS buffer size logic for DNS Flag Day 2020

The DNS Flag Day 2020 aims to remove the IP fragmentation problem from
the UDP DNS communication.  In this commit, we implement the required
changes and simplify the logic for picking the EDNS Buffer Size.

1. The defaults for `edns-udp-size`, `max-udp-size` and
   `nocookie-udp-size` have been changed to `1232` (the value picked by
   DNS Flag Day 2020).

2. The probing heuristics that would try 512->4096->1432->1232 buffer
   sizes has been removed and the resolver will always use just the
   `edns-udp-size` value.

3. Instead of just disabling the PMTUD mechanism on the UDP sockets, we
   now set IP_DONTFRAG (IPV6_DONTFRAG) flag.  That means that the UDP
   packets won't get ever fragmented.  If the ICMP packets are lost the
   UDP will just timeout and eventually be retried over TCP.

5 years agoMerge branch 'ondrej/refactor-setsockopt' into 'main'
Ondřej Surý [Mon, 5 Oct 2020 14:11:55 +0000 (14:11 +0000)] 
Merge branch 'ondrej/refactor-setsockopt' into 'main'

Refactor the setsockopt() code in network manager into helper functions

See merge request isc-projects/bind9!4227

5 years agoSplit reusing the addr/port and load-balancing socket options
Ondřej Surý [Mon, 5 Oct 2020 11:14:04 +0000 (13:14 +0200)] 
Split reusing the addr/port and load-balancing socket options

The SO_REUSEADDR, SO_REUSEPORT and SO_REUSEPORT_LB has different meaning
on different platform. In this commit, we split the function to set the
reuse of address/port and setting the load-balancing into separate
functions.

The libuv library already have multiplatform support for setting
SO_REUSEADDR and SO_REUSEPORT that allows binding to the same address
and port, but unfortunately, when used after the load-balancing socket
options have been already set, it overrides the previous setting, so we
need our own helper function to enable the SO_REUSEADDR/SO_REUSEPORT
first and then enable the load-balancing socket option.

5 years agoUse uv_os_sock_t instead of uv_os_fd_t for sockets
Ondřej Surý [Mon, 5 Oct 2020 10:25:19 +0000 (12:25 +0200)] 
Use uv_os_sock_t instead of uv_os_fd_t for sockets

On POSIX based systems both uv_os_sock_t and uv_os_fd_t are both typedef
to int.  That's not true on Windows, where uv_os_sock_t is SOCKET and
uv_os_fd_t is HANDLE and they differ in level of indirection.

5 years agoRefactor isc__nm_socket_freebind() to take fd and sa_family as args
Ondřej Surý [Mon, 5 Oct 2020 09:17:52 +0000 (11:17 +0200)] 
Refactor isc__nm_socket_freebind() to take fd and sa_family as args

The isc__nm_socket_freebind() has been refactored to match other
isc__nm_socket_...() helper functions and take uv_os_fd_t and
sa_family_t as function arguments.

5 years agoAdd helper function to enable DF (don't fragment) flag on UDP sockets
Ondřej Surý [Mon, 5 Oct 2020 08:51:40 +0000 (10:51 +0200)] 
Add helper function to enable DF (don't fragment) flag on UDP sockets

This commits add isc__nm_socket_dontfrag() helper functions.

5 years agoAdd SO_REUSEPORT and SO_INCOMING_CPU helper functions
Ondřej Surý [Mon, 5 Oct 2020 08:40:02 +0000 (10:40 +0200)] 
Add SO_REUSEPORT and SO_INCOMING_CPU helper functions

The setting of SO_REUSE**** and SO_INCOMING_CPU have been moved into a
separate helper functions.

5 years agoMerge branch '1749-rndc-dnssec-rollover' into 'main'
Matthijs Mekking [Mon, 5 Oct 2020 09:46:48 +0000 (09:46 +0000)] 
Merge branch '1749-rndc-dnssec-rollover' into 'main'

Resolve "rndc trigger rollover"

Closes #1749

See merge request isc-projects/bind9!4004

5 years agoUse default algorithm in kasp test if possible
Matthijs Mekking [Fri, 4 Sep 2020 14:35:01 +0000 (16:35 +0200)] 
Use default algorithm in kasp test if possible

These tests don't require a specific algorithm so they should use
the DEFAULT_ALGORITHM from 'conf.sh.common'.

5 years agoUse explicit result codes for 'rndc dnssec' cmd
Matthijs Mekking [Fri, 4 Sep 2020 09:42:52 +0000 (11:42 +0200)] 
Use explicit result codes for 'rndc dnssec' cmd

It is better to add new result codes than to overload existing codes.

5 years agoVarious rndc dnssec -checkds fixes
Matthijs Mekking [Mon, 24 Aug 2020 08:05:28 +0000 (10:05 +0200)] 
Various rndc dnssec -checkds fixes

While working on 'rndc dnssec -rollover' I noticed the following
(small) issues:

- The key files where updated with hints set to "-when" and that
  should always be "now.
- The kasp system test did not properly update the test number when
  calling 'rndc dnssec -checkds' (and ensuring that works).
- There was a missing ']' in the rndc.c help output.

5 years agoTest rndc rollover inactive key
Matthijs Mekking [Mon, 24 Aug 2020 08:03:02 +0000 (10:03 +0200)] 
Test rndc rollover inactive key

When users (accidentally) try to roll an inactive key, throw an error.

5 years agoAdd rndc dnssec -rollover command
Matthijs Mekking [Fri, 21 Aug 2020 13:38:00 +0000 (15:38 +0200)] 
Add rndc dnssec -rollover command

This command is similar in arguments as -checkds so refactor the
'named_server_dnssec' function accordingly.  The only difference
are that:

- It does not take a "publish" or "withdrawn" argument.
- It requires the key id to be set (add a check to make sure).

Add tests that will trigger rollover immediately and one that
schedules a test in the future.

5 years agoAdd manual key rollover logic
Matthijs Mekking [Fri, 21 Aug 2020 13:31:57 +0000 (15:31 +0200)] 
Add manual key rollover logic

Add to the keymgr a function that will schedule a rollover. This
basically means setting the time when the key needs to retire,
and updating the key lifetime, then update the state file. The next
time that named runs the keymgr the new lifetime will be taken into
account.

5 years agoMerge branch '1870-fix-after-backport-to-9_11_s' into 'main'
Matthijs Mekking [Mon, 5 Oct 2020 08:47:07 +0000 (08:47 +0000)] 
Merge branch '1870-fix-after-backport-to-9_11_s' into 'main'

Change condition for rndc dumpdb -expired

See merge request isc-projects/bind9!4219

5 years agoChange condition for rndc dumpdb -expired
Matthijs Mekking [Fri, 2 Oct 2020 07:12:23 +0000 (09:12 +0200)] 
Change condition for rndc dumpdb -expired

After backporting #1870 to 9.11-S I saw that the condition check there
is different than in the main branch. In 9.11-S "stale" can mean
stale and serve-stale, or not active (awaiting cleanup). In 9.16 and
later versions, "stale" is stale and serve-stale, and "ancient" means
not active (awaiting cleanup). An "ancient" RRset is one that is not
active (TTL expired) and is not eligble for serve-stale.

Update the condition for rndc dumpdb -expired to closer match what is
in 9.11-S.

5 years agoMerge branch '2171-dnssec-policy-weird-algo-15-bug' into 'main'
Matthijs Mekking [Fri, 2 Oct 2020 08:06:45 +0000 (08:06 +0000)] 
Merge branch '2171-dnssec-policy-weird-algo-15-bug' into 'main'

Resolve "dnssec-policy behaviour for algorithm 15 keys different to algorithm 8 keys"

Closes #2171

See merge request isc-projects/bind9!4199

5 years agoFix a timing issue in kasp system test
Matthijs Mekking [Thu, 1 Oct 2020 09:07:05 +0000 (11:07 +0200)] 
Fix a timing issue in kasp system test

Sometimes, not all keys have been created in time before 'check_keys'
is called. Run a 'retry_quiet' on checking the number of keys before
continuing checking the key data.

5 years agoFix kasp min key size bug
Matthijs Mekking [Thu, 1 Oct 2020 09:05:01 +0000 (11:05 +0200)] 
Fix kasp min key size bug

The minimal size for RSASHA1, RSASHA256 is 512, but due to bad
assignment it was set to 1024.

5 years agoTest migration to dnssec-policy with views
Matthijs Mekking [Wed, 30 Sep 2020 08:06:37 +0000 (10:06 +0200)] 
Test migration to dnssec-policy with views

This test case is unrelated to the fix for #2171 but was added to
reproduce the problem.

5 years agoMinor fix in kasp system test
Matthijs Mekking [Wed, 30 Sep 2020 08:04:27 +0000 (10:04 +0200)] 
Minor fix in kasp system test

The 'wait_for_nsec' does not need to add TSIG because it calls
'dig_with_opts' and that already checks for TSIG.

5 years agoAdd change and note for #2171
Matthijs Mekking [Wed, 30 Sep 2020 08:03:43 +0000 (10:03 +0200)] 
Add change and note for #2171

This is a bug that needs to be noted.

5 years agoFix Ed25519 and Ed448 in dnssec-policy keymgr
Matthijs Mekking [Wed, 30 Sep 2020 07:57:45 +0000 (09:57 +0200)] 
Fix Ed25519 and Ed448 in dnssec-policy keymgr

The kasp code had bad implicit size values for the cryptographic
algorithms Ed25519 and Ed448. When creating keys they would never
match the dnssec-policy, leading to new attempts to create keys.

These algorithms were previously not yet added to the system tests,
due to lack of availability on some systems.

5 years agoAdd kasp tests for Ed25519 and Ed448
Matthijs Mekking [Wed, 30 Sep 2020 07:53:19 +0000 (09:53 +0200)] 
Add kasp tests for Ed25519 and Ed448

Use the testcrypto script to see if these algorithms are supported by
openssl. If so, add the specific configuration to the named.conf file
and touch a file to indicate support. If the file exists, the
corresponding setup and tests are performed.

5 years agoMerge branch '2139-rrset-order-fixes-and-cleanups' into 'main'
Michał Kępień [Fri, 2 Oct 2020 06:50:02 +0000 (06:50 +0000)] 
Merge branch '2139-rrset-order-fixes-and-cleanups' into 'main'

"rrset-order" fixes and cleanups

Closes #2139

See merge request isc-projects/bind9!4195

5 years agoAdd CHANGES entries
Michał Kępień [Fri, 2 Oct 2020 06:41:43 +0000 (08:41 +0200)] 
Add CHANGES entries

5 years agoRework "rrset-order" documentation
Michał Kępień [Fri, 2 Oct 2020 06:41:43 +0000 (08:41 +0200)] 
Rework "rrset-order" documentation

Certain parts of the existing documentation for the "rrset-order"
statement are incorrect, others are ambiguous.  Rework the relevant
section of the ARM to make it clear and up-to-date with the source code.

5 years agoAdd tests for "order none" RRset ordering rules
Michał Kępień [Fri, 2 Oct 2020 06:41:43 +0000 (08:41 +0200)] 
Add tests for "order none" RRset ordering rules

Make sure "order none" RRset ordering rules are tested in the
"rrsetorder" system test just like all other rule types are.  As the
check for the case of no "rrset-order" rule matching a given RRset also
tests "order none" (rather than "order random", as the test code may
suggest at first glance), replace the test code for that case so that it
matches other "order none" tests.

5 years agoAllow "order none" in "rrset-order" rules
Michał Kępień [Fri, 2 Oct 2020 06:41:43 +0000 (08:41 +0200)] 
Allow "order none" in "rrset-order" rules

named-checkconf treats the following configuration as valid:

    options {
        rrset-order {
            order none;
        };
    };

Yet, the above configuration causes named to crash on startup with:

    order.c:74: REQUIRE(mode == 0x00000800 || mode == 0x00000400 || mode == 0x00800000) failed, back trace

Add DNS_RDATASETATTR_NONE to the list of RRset ordering modes accepted
by dns_order_add() to allow "order none" to be used in "rrset-order"
rules.  This both prevents the aforementioned crashes and addresses the
discrepancy between named-checkconf and named.

5 years agoMerge branch '2112-allow-task_test-subtests-to-be-selected-at-runtime' into 'main'
Mark Andrews [Thu, 1 Oct 2020 12:46:00 +0000 (12:46 +0000)] 
Merge branch '2112-allow-task_test-subtests-to-be-selected-at-runtime' into 'main'

Resolve "Allow task_test and rdata_tests subtests to be selected at runtime."

Closes #2112

See merge request isc-projects/bind9!4059

5 years agoAdd the ability select individual tests to rdata_test
Mark Andrews [Fri, 11 Sep 2020 04:17:36 +0000 (14:17 +1000)] 
Add the ability select individual tests to rdata_test

5 years agoAdd the ability to print out the list of test names (-l)
Mark Andrews [Tue, 8 Sep 2020 00:38:24 +0000 (10:38 +1000)] 
Add the ability to print out the list of test names (-l)

5 years agoAdd the ability to select tests to run
Mark Andrews [Wed, 2 Sep 2020 08:22:21 +0000 (18:22 +1000)] 
Add the ability to select tests to run

task_test [-t <test_name>]

5 years agoAlphabetise tests
Mark Andrews [Fri, 11 Sep 2020 03:37:56 +0000 (13:37 +1000)] 
Alphabetise tests

5 years agoMerge branch '2191-missing-locks-when-accessing-keynode-initial-and-keynode-managed...
Mark Andrews [Thu, 1 Oct 2020 08:12:29 +0000 (08:12 +0000)] 
Merge branch '2191-missing-locks-when-accessing-keynode-initial-and-keynode-managed-triggering-tsan' into 'main'

Resolve "Missing locks when accessing keynode.initial and keynode.managed triggered TSAN."

Closes #2191

See merge request isc-projects/bind9!4205

5 years agoAdd missing rwlock calls when access keynode.initial and keynode.managed
Mark Andrews [Thu, 1 Oct 2020 00:39:49 +0000 (10:39 +1000)] 
Add missing rwlock calls when access keynode.initial and keynode.managed

    WARNING: ThreadSanitizer: data race
    Write of size 1 at 0x000000000001 by thread T1 (mutexes: write M1):
    #0 dns_keynode_trust lib/dns/keytable.c:836
    #1 keyfetch_done lib/dns/zone.c:10187
    #2 dispatch lib/isc/task.c:1152
    #3 run lib/isc/task.c:1344
    #4 <null> <null>

    Previous read of size 1 at 0x000000000001 by thread T2 (mutexes: read M2):
    #0 keynode_dslist_totext lib/dns/keytable.c:682
    #1 dns_keytable_totext lib/dns/keytable.c:732
    #2 named_server_dumpsecroots bin/named/server.c:11357
    #3 named_control_docommand bin/named/control.c:264
    #4 control_command bin/named/controlconf.c:390
    #5 dispatch lib/isc/task.c:1152
    #6 run lib/isc/task.c:1344
    #7 <null> <null>

    Location is heap block of size 241 at 0x000000000010 allocated by thread T3:
    #0 malloc <null>
    #1 default_memalloc lib/isc/mem.c:713
    #2 mem_get lib/isc/mem.c:622
    #3 mem_allocateunlocked lib/isc/mem.c:1268
    #4 isc___mem_allocate lib/isc/mem.c:1288
    #5 isc__mem_allocate lib/isc/mem.c:2453
    #6 isc___mem_get lib/isc/mem.c:1037
    #7 isc__mem_get lib/isc/mem.c:2432
    #8 new_keynode lib/dns/keytable.c:346
    #9 insert lib/dns/keytable.c:393
    #10 dns_keytable_add lib/dns/keytable.c:421
    #11 process_key bin/named/server.c:955
    #12 load_view_keys bin/named/server.c:983
    #13 configure_view_dnsseckeys bin/named/server.c:1140
    #14 configure_view bin/named/server.c:5371
    #15 load_configuration bin/named/server.c:9110
    #16 loadconfig bin/named/server.c:10310
    #17 named_server_reconfigcommand bin/named/server.c:10693
    #18 named_control_docommand bin/named/control.c:250
    #19 control_command bin/named/controlconf.c:390
    #20 dispatch lib/isc/task.c:1152
    #21 run lib/isc/task.c:1344
    #22 <null> <null>

    Mutex M1 is already destroyed.

    Mutex M2 is already destroyed.

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create pthreads/thread.c:73
    #2 isc_taskmgr_create lib/isc/task.c:1434
    #3 create_managers bin/named/main.c:915
    #4 setup bin/named/main.c:1223
    #5 main bin/named/main.c:1523

    Thread T2 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create pthreads/thread.c:73
    #2 isc_taskmgr_create lib/isc/task.c:1434
    #3 create_managers bin/named/main.c:915
    #4 setup bin/named/main.c:1223
    #5 main bin/named/main.c:1523

    Thread T3 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create pthreads/thread.c:73
    #2 isc_taskmgr_create lib/isc/task.c:1434
    #3 create_managers bin/named/main.c:915
    #4 setup bin/named/main.c:1223
    #5 main bin/named/main.c:1523

    SUMMARY: ThreadSanitizer: data race lib/dns/keytable.c:836 in dns_keynode_trust

5 years agoMerge branch '2192-tsan-error-accessing-listener-connections' into 'main'
Mark Andrews [Thu, 1 Oct 2020 07:13:09 +0000 (07:13 +0000)] 
Merge branch '2192-tsan-error-accessing-listener-connections' into 'main'

Resolve "TSAN error accessing listener->connections"

Closes #2192

See merge request isc-projects/bind9!4206

5 years agoLock access to listener->connections
Mark Andrews [Thu, 1 Oct 2020 05:11:32 +0000 (15:11 +1000)] 
Lock access to listener->connections

as it is accessed from multiple threads with libuv.

    WARNING: ThreadSanitizer: data race
    Write of size 8 at 0x000000000001 by thread T1:
    #0 conn_reset bin/named/controlconf.c:574
    #1 isc_nmhandle_detach netmgr/netmgr.c:1257
    #2 isc__nm_uvreq_put netmgr/netmgr.c:1389
    #3 tcp_send_cb netmgr/tcp.c:1030
    #4 <null> <null>
    #5 <null> <null>

    Previous read of size 8 at 0x000000000001 by thread T2:
    #0 conn_reset bin/named/controlconf.c:574
    #1 isc_nmhandle_detach netmgr/netmgr.c:1257
    #2 control_recvmessage bin/named/controlconf.c:556
    #3 recv_data lib/isccc/ccmsg.c:110
    #4 isc__nm_tcp_shutdown netmgr/tcp.c:1161
    #5 shutdown_walk_cb netmgr/netmgr.c:1511
    #6 uv_walk <null>
    #7 process_queue netmgr/netmgr.c:656
    #8 process_normal_queue netmgr/netmgr.c:582
    #9 process_queues netmgr/netmgr.c:590
    #10 async_cb netmgr/netmgr.c:548
    #11 <null> <null>
    #12 <null> <null>

    Location is heap block of size 265 at 0x000000000017 allocated by thread T3:
    #0 malloc <null>
    #1 default_memalloc lib/isc/mem.c:713
    #2 mem_get lib/isc/mem.c:622
    #3 isc___mem_get lib/isc/mem.c:1044
    #4 isc__mem_get lib/isc/mem.c:2432
    #5 add_listener bin/named/controlconf.c:1127
    #6 named_controls_configure bin/named/controlconf.c:1324
    #7 load_configuration bin/named/server.c:9181
    #8 run_server bin/named/server.c:9819
    #9 dispatch lib/isc/task.c:1152
    #10 run lib/isc/task.c:1344
    #11 <null> <null>

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create pthreads/thread.c:73
    #2 isc_nm_start netmgr/netmgr.c:232
    #3 create_managers bin/named/main.c:909
    #4 setup bin/named/main.c:1223
    #5 main bin/named/main.c:1523

    Thread T2 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create pthreads/thread.c:73
    #2 isc_nm_start netmgr/netmgr.c:232
    #3 create_managers bin/named/main.c:909
    #4 setup bin/named/main.c:1223
    #5 main bin/named/main.c:1523

    Thread T3 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create pthreads/thread.c:73
    #2 isc_taskmgr_create lib/isc/task.c:1434
    #3 create_managers bin/named/main.c:915
    #4 setup bin/named/main.c:1223
    #5 main bin/named/main.c:1523

    SUMMARY: ThreadSanitizer: data race bin/named/controlconf.c:574 in conn_reset

5 years agoMerge branch 'ondrej/remove-dot-at-start-of-the-line-rst' into 'main'
Ondřej Surý [Wed, 30 Sep 2020 19:39:58 +0000 (19:39 +0000)] 
Merge branch 'ondrej/remove-dot-at-start-of-the-line-rst' into 'main'

Remove the .key from the beginning of the line in rst file

See merge request isc-projects/bind9!4203

5 years agoRemove the .key from the beginning of the line in rst file
Ondřej Surý [Wed, 30 Sep 2020 19:12:15 +0000 (21:12 +0200)] 
Remove the .key from the beginning of the line in rst file

The handling of . (dot) characted at the beginning of the line has
changed between the sphinx-doc versions, and it was constantly giving us
trouble when generating man pages when using different sphinx-doc.  This
commit just changes the source rst file, so there's no more . (dot) the
beginning of the line.

5 years agoMerge branch '2180-threadsanitizer-data-race-bin-named-server-c-9678-25-in-view_loade...
Mark Andrews [Wed, 30 Sep 2020 14:37:37 +0000 (14:37 +0000)] 
Merge branch '2180-threadsanitizer-data-race-bin-named-server-c-9678-25-in-view_loaded' into 'main'

Resolve "ThreadSanitizer: data race bin/named/server.c:9678:25 in view_loaded"

Closes #2180

See merge request isc-projects/bind9!4167

5 years agomake (named_server_t).reload_status atomic
Mark Andrews [Tue, 22 Sep 2020 23:37:35 +0000 (09:37 +1000)] 
make (named_server_t).reload_status atomic

    WARNING: ThreadSanitizer: data race
    Write of size 4 at 0x000000000001 by thread T1:
    #0 view_loaded bin/named/server.c:9678:25
    #1 call_loaddone lib/dns/zt.c:308:3
    #2 doneloading lib/dns/zt.c:582:3
    #3 zone_asyncload lib/dns/zone.c:2322:3
    #4 dispatch lib/isc/task.c:1152:7
    #5 run lib/isc/task.c:1344:2

    Previous read of size 4 at 0x000000000001 by thread T2:
    #0 named_server_status bin/named/server.c:11903:14
    #1 named_control_docommand bin/named/control.c:272:12
    #2 control_command bin/named/controlconf.c:390:17
    #3 dispatch lib/isc/task.c:1152:7
    #4 run lib/isc/task.c:1344:2

    Location is heap block of size 409 at 0x000000000011 allocated by main thread:
    #0 malloc <null>
    #1 default_memalloc lib/isc/mem.c:713:8
    #2 mem_get lib/isc/mem.c:622:8
    #3 mem_allocateunlocked lib/isc/mem.c:1268:8
    #4 isc___mem_allocate lib/isc/mem.c:1288:7
    #5 isc__mem_allocate lib/isc/mem.c:2453:10
    #6 isc___mem_get lib/isc/mem.c:1037:11
    #7 isc__mem_get lib/isc/mem.c:2432:10
    #8 named_server_create bin/named/server.c:9978:27
    #9 setup bin/named/main.c:1256:2
    #10 main bin/named/main.c:1523:2

    Thread T1 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    Thread T2 (running) created by main thread at:
    #0 pthread_create <null>
    #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
    #2 isc_taskmgr_create lib/isc/task.c:1434:3
    #3 create_managers bin/named/main.c:915:11
    #4 setup bin/named/main.c:1223:11
    #5 main bin/named/main.c:1523:2

    SUMMARY: ThreadSanitizer: data race bin/named/server.c:9678:25 in view_loaded

5 years agoMerge branch '2190-in-new-yaml-output-when-truncation-is-query-time-usec' into 'main'
Mark Andrews [Wed, 30 Sep 2020 14:11:49 +0000 (14:11 +0000)] 
Merge branch '2190-in-new-yaml-output-when-truncation-is-query-time-usec' into 'main'

dig: print timestamps with microsecond precision if "-u" is used in YAML output mode

Closes #2190

See merge request isc-projects/bind9!4193

5 years agoadd CHANGES
Mark Andrews [Tue, 29 Sep 2020 05:02:24 +0000 (15:02 +1000)] 
add CHANGES

5 years agoOutput timestamps in yaml to the microsecond if -u is specified.
Mark Andrews [Tue, 29 Sep 2020 04:59:40 +0000 (14:59 +1000)] 
Output timestamps in yaml to the microsecond if -u is specified.

5 years agoAdd ISO time stamps to the microsecond
Mark Andrews [Tue, 29 Sep 2020 04:58:56 +0000 (14:58 +1000)] 
Add ISO time stamps to the microsecond

5 years agoMerge branch '2188-bug-in-message-c-673-ensure-isc_mempool_getallocated-msg-namepool...
Mark Andrews [Wed, 30 Sep 2020 13:43:20 +0000 (13:43 +0000)] 
Merge branch '2188-bug-in-message-c-673-ensure-isc_mempool_getallocated-msg-namepool-0-failed' into 'main'

Resolve "Bug in message.c:673: ENSURE(isc_mempool_getallocated(msg->namepool) == 0) failed"

Closes #2188

See merge request isc-projects/bind9!4189

5 years agoCheck that sig0 name is the root.
Mark Andrews [Tue, 29 Sep 2020 03:25:44 +0000 (13:25 +1000)] 
Check that sig0 name is the root.

5 years agoHave -d print out the message
Mark Andrews [Tue, 29 Sep 2020 03:19:24 +0000 (13:19 +1000)] 
Have -d print out the message

5 years agoAlways clean sig0name in msgresetsigs() and dns_message_renderreset()
Mark Andrews [Mon, 28 Sep 2020 02:54:17 +0000 (12:54 +1000)] 
Always clean sig0name in msgresetsigs() and dns_message_renderreset()

The fuzzing harness operates on dns_message_t in non-standard ways
and if 'sig0name' is non-NULL when msgresetsigs() and
dns_message_renderreset() are called it should be cleaned up.

5 years agoAdd packet from issue #4189
Mark Andrews [Mon, 28 Sep 2020 02:53:09 +0000 (12:53 +1000)] 
Add packet from issue #4189

5 years agoMerge branch 'marka-regen-ddns-confgen.8in' into 'main'
Ondřej Surý [Wed, 30 Sep 2020 12:19:26 +0000 (12:19 +0000)] 
Merge branch 'marka-regen-ddns-confgen.8in' into 'main'

regenerate ddns-confgen.8in

See merge request isc-projects/bind9!4198

5 years agoregenerate ddns-confgen.8in
Mark Andrews [Wed, 30 Sep 2020 05:52:54 +0000 (15:52 +1000)] 
regenerate ddns-confgen.8in

5 years agoMerge branch '2124-fix-assertion-failure-in-dns-message' into 'main'
Ondřej Surý [Tue, 29 Sep 2020 08:14:23 +0000 (08:14 +0000)] 
Merge branch '2124-fix-assertion-failure-in-dns-message' into 'main'

Resolve "Bind 9.16.6 Assertion failure message.c:4733: REQUIRE(msg->state == (-1)) failed"

Closes #2124

See merge request isc-projects/bind9!4194

5 years agoAdd CHANGES and release note for GL #2124
Ondřej Surý [Fri, 25 Sep 2020 10:51:39 +0000 (12:51 +0200)] 
Add CHANGES and release note for GL #2124

5 years agoThe dns_message_create() cannot fail, change the return to void
Ondřej Surý [Fri, 25 Sep 2020 09:51:36 +0000 (11:51 +0200)] 
The dns_message_create() cannot fail, change the return to void

The dns_message_create() function cannot soft fail (as all memory
allocations either succeed or cause abort), so we change the function to
return void and cleanup the calls.

5 years agococci: Add semantic patch to refactor dns_message_destroy()
Diego Fronza [Mon, 21 Sep 2020 21:19:49 +0000 (18:19 -0300)] 
cocci: Add semantic patch to refactor dns_message_destroy()

dns_message_t objects are now being handled using reference counting
semantics, so now dns_message_destroy() is not called directly anymore,
dns_message_detach must be called instead.

5 years agoProperly handling dns_message_t shared references
Diego Fronza [Mon, 21 Sep 2020 20:44:29 +0000 (17:44 -0300)] 
Properly handling dns_message_t shared references

This commit fix the problems that arose when moving the dns_message_t
object from fetchctx_t to the query structure.

Since the lifetime of query objects are different than that of a fetchctx
and the dns_message_t object held by the query may be being used by some
external module, e.g. validator, even after the query may have been destroyed,
propery handling of the references to the message were added in this commit to
avoid accessing an already destroyed object.

Specifically, in rctx_done(), a reference to the message is attached at
the beginning of the function and detached at the end, since a possible call
to fctx_cancelquery() would release the dns_message_t object, and in the next
lines of code a call to rctx_nextserver() or rctx_chaseds() would require
a valid pointer to the same object.

In valcreate() a new reference is attached to the message object, this
ensures that if the corresponding query object is destroyed before the
validator attempts to access it, no invalid pointer access occurs.

In validated() we have to attach a new reference to the message, since
we destroy the validator object at the beginning of the function,
and we need access to the message in the next lines of the same function.

rctx_nextserver() and rctx_chaseds() functions were adapted to receive
a new parameter of dns_message_t* type, this was so they could receive a
valid reference to a dns_message_t since using the response context respctx_t
to access the message through rctx->query->rmessage could lead to an already
released reference due to the query being canceled.