Commit graph

32315 commits

Author SHA1 Message Date
Witold Kręcicki
b4e27a075a Don't crash if isc_uv_export returns an error in accept_connection.
isc_uv_export can return an error - e.g. EMFILE (from dup), handle this
nicely.

(cherry picked from commit ae9a6befa8)
2020-10-22 14:59:00 -07:00
Ondřej Surý
81085bbeca Fix the way udp_send_direct() is used
There were two problems how udp_send_direct() was used:

1. The udp_send_direct() can return ISC_R_CANCELED (or translated error
   from uv_udp_send()), but the isc__nm_async_udpsend() wasn't checking
   the error code and not releasing the uvreq in case of an error.

2. In isc__nm_udp_send(), when the UDP send is already in the right
   netthread, it uses udp_send_direct() to send the UDP packet right
   away.  When that happened the uvreq was not freed, and the error code
   was returned to the caller.  We need to return ISC_R_SUCCESS and
   rather use the callback to report an error in such case.

(cherry picked from commit afca2e3b21)
2020-10-22 14:59:00 -07:00
Michal Nowak
970e1821cc Merge branch '2218-ensure-use-of-echo_i-where-possible-in-system-tests-v9_16' into 'v9_16'
[v9_16] Ensure use of "echo_i" where possible

See merge request isc-projects/bind9!4290
2020-10-22 10:50:27 +00:00
Michal Nowak
47862fc559
Ensure use of "echo_i" where possible
In many instances 'echo "I:' construct was used where echo_i function
should have been.
2020-10-22 12:15:15 +02:00
Michał Kępień
216273c73b Merge branch 'v9_16_8-release' into 'v9_16'
Merge 9.16.8 release branch

See merge request isc-projects/bind9!4288
2020-10-22 07:16:08 +00:00
Michał Kępień
09b9dffd46 Set up release notes for BIND 9.16.9 2020-10-22 09:14:31 +02:00
Michał Kępień
f8c9f78684 Bump BIND_BASELINE_VERSION for ABI checks 2020-10-22 09:14:31 +02:00
Michał Kępień
3f28a134cf Bump BIND_BASELINE_VERSION for respdiff tests 2020-10-22 09:14:31 +02:00
Tinderbox User
48760b31f5 Merge branch 'prep-release' into v9_16_8-release 2020-10-22 09:09:07 +02:00
Michał Kępień
b8b7b55f3f Merge branch 'michal/prepare-release-notes-for-bind-9.16.8' into 'v9_16_8-release'
Prepare release notes for BIND 9.16.8

See merge request isc-private/bind9!217
2020-10-22 09:09:07 +02:00
Tinderbox User
44e91206a4 prep 9.16.8 2020-10-22 09:09:07 +02:00
Michał Kępień
a38a76d455 Prepare release notes for BIND 9.16.8 2020-10-22 09:09:07 +02:00
Michał Kępień
7adc616d7e Reorder release notes 2020-10-22 09:09:07 +02:00
Michał Kępień
92d513c235 Tweak and reword release notes 2020-10-22 09:09:07 +02:00
Michał Kępień
df8fd53b0f Tweak and reword recent CHANGES entries 2020-10-22 09:09:07 +02:00
Michał Kępień
6cf77e7c26 Minor ARM formatting tweak 2020-10-22 09:09:07 +02:00
Diego dos Santos Fronza
7280362005 Merge branch '1736-stub-zone-foiled-by-minimal-responses-v9_16' into 'v9_16'
Resolve "stub zone foiled by minimal-responses"

See merge request isc-projects/bind9!4282
2020-10-21 17:41:57 +00:00
Diego Fronza
34f1196f36 Add CHANGES entry 2020-10-21 14:04:43 -03:00
Diego Fronza
be98c78802 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.
2020-10-21 12:12:57 -03:00
Diego Fronza
69e6bea835 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.
2020-10-21 12:12:36 -03:00
Diego Fronza
d5355b8105 Always return address records in additional section for NS queries 2020-10-21 12:12:22 -03:00
Diego Fronza
7a3dbbc395 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.
2020-10-21 12:11:31 -03:00
Matthijs Mekking
aff8cb334d Merge branch '2208-tcp4recverr-stat-miscount-v9_16' into 'v9_16'
Don't increment network error stats on UV_EOF

See merge request isc-projects/bind9!4277
2020-10-21 06:34:19 +00:00
Matthijs Mekking
5c0b5b64e5 Don't increment network error stats on UV_EOF
When networking statistics was added to the netmgr (in commit
5234a8e00a), 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.

(cherry picked from commit 6c5ff94218)
2020-10-20 14:05:09 +00:00
Diego dos Santos Fronza
b4ad8cb93d Merge branch '2195-freebsd-dnstap-system-test-failure-v9_16' into 'v9_16'
Fix dnstap system test on FreeBSD

See merge request isc-projects/bind9!4275
2020-10-20 13:57:41 +00:00
Diego Fronza
64ae91c62a 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.
2020-10-20 10:22:50 -03:00
Mark Andrews
35df5e7a31 Merge branch 'marka-fix-not-enough-categories-v9_16' into 'v9_16'
Drop the expected minimum number of buckets to 4.

See merge request isc-projects/bind9!4265
2020-10-15 02:14:15 +00:00
Mark Andrews
7147e4f93a Drop the expected minimum number of buckets to 4.
The previous value of 5 produced too many false errors.

(cherry picked from commit 0abb49034e)
2020-10-15 12:32:11 +11:00
Mark Andrews
a5965e80ed Merge branch 'marka-rrl-mdig-burst-v9_16' into 'v9_16'
Try to improve rrl timing

See merge request isc-projects/bind9!4263
2020-10-15 01:11:06 +00:00
Mark Andrews
07017d0a8e 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.

(cherry picked from commit 92cdc7b6c7)
2020-10-15 11:41:20 +11:00
Mark Andrews
55eacc6945 Merge branch '2209-tsan-error-bin-named-controlconf-c-related-v9_16' into 'v9_16'
Complete the isc_nmhandle_detach() in the worker thread.

See merge request isc-projects/bind9!4262
2020-10-15 00:39:43 +00:00
Mark Andrews
da0a7a34ec 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>

(cherry picked from commit f95ba8aa20)
2020-10-15 11:03:47 +11:00
Ondřej Surý
51a1303646 Merge branch 'ondrej/little-socket-fixes-v9_16' into 'v9_16'
Clean the last remnant of ISC_PLATFORM_HAVEIPV6 macro

See merge request isc-projects/bind9!4254
2020-10-08 07:05:58 +00:00
Ondřej Surý
dbf2d0b15f 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.

(cherry picked from commit 96ac91a18a)
2020-10-08 09:03:08 +02:00
Ondřej Surý
cb49657a10 Merge branch 'ondrej/clean-netmgr-callback-locks-v9_16' into 'v9_16'
Clean netmgr callback locks (v9.16)

See merge request isc-projects/bind9!4252
2020-10-08 06:50:23 +00:00
Ondřej Surý
53d6a11a0e 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.

(cherry picked from commit e8b56acb49)
2020-10-08 08:16:54 +02:00
Ondřej Surý
69e6c8467c 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.

(cherry picked from commit d86a74d8a4)
2020-10-08 08:16:53 +02:00
Mark Andrews
9708b644ae Merge branch '2204-investigate-pipeline-system-test-failure-v9_16' into 'v9_16'
Restore the dns_message_reset() call before the dns_dispatch_getnext()

See merge request isc-projects/bind9!4249
2020-10-08 05:43:19 +00:00
Mark Andrews
84922b2dc7 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.

(cherry picked from commit 1f63bb15b3)
2020-10-08 16:27:10 +11:00
Michał Kępień
35c3f4b7f3 Merge branch 'matthijs-kasp-test-requires-python-v9_16' into 'v9_16'
The kasp system test requires Python

See merge request isc-projects/bind9!4244
2020-10-07 20:20:47 +00:00
Matthijs Mekking
1b99fa8683 Merge branch 'he32-test-fix-v9_16' into 'v9_16'
Avoid a non-standard bashism: use of "==" in "test".

See merge request isc-projects/bind9!4236
2020-10-07 13:30:41 +00:00
Havard Eidnes
cf19c9d3ba Avoid a non-standard bashism: use of "==" in "test".
(cherry picked from commit 7c3f62082bb0c6776ff560f0aef09ad2dfdf77ea)
2020-10-07 13:29:55 +00:00
Matthijs Mekking
5d3c4baad0 The kasp system test requires Python
Only run the "kasp" system test if the path to the Python interpreter is
set.
2020-10-07 14:14:14 +02:00
Mark Andrews
c913ac48d0 Merge branch 'marka-create_query-fix-REVERSE_INULL-v9_16' into 'v9_16'
Silence Coverity REVERSE_INULL report

See merge request isc-projects/bind9!4238
2020-10-06 12:56:03 +00:00
Mark Andrews
33d7b5b56f Silence Coverity REVERSE_INULL report
message does not need to be tested to NULL

(cherry picked from commit f0a66cb5aa)
2020-10-06 23:37:13 +11:00
Ondřej Surý
b618d41fae Merge branch '2183-dns-flag-day-2020-v9_16' into 'v9_16'
Resolve "DNS Flag Day 2020"

See merge request isc-projects/bind9!4229
2020-10-06 12:22:05 +00:00
Ondřej Surý
45b081f406 Add text describing the changes done in the MR in more detail
(cherry picked from commit 096d41b4e2)
2020-10-06 09:35:21 +02:00
Ondřej Surý
4d2390c0b9 Adjust legacy tests for default 1232 EDNS Buffer Size
* legacy test was just expecting default server EDNS buffer size to be 4096,
  the test needed the adjustment to reset the buffer sizes back to 4096.

(cherry picked from commit 354a2e102d5b8b0a73c9bcea14a4af7091ed6e31)
2020-10-06 09:35:21 +02:00
Ondřej Surý
b2ebbaf4a0 Adjust digdelv tests for default 1232 EDNS Buffer Size
* digdelv test was just expecting default server EDNS buffer size to be
  4096, the test needed only slight adjustment

(cherry picked from commit f1556f8c41)
2020-10-06 09:35:20 +02:00
Ondřej Surý
58a518adca Change the default ENDS buffer size to 1232 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 minimal
required changes by changing the defaults for `edns-udp-size`,
`max-udp-size` and `nocookie-udp-size` to `1232` (the value picked by
DNS Flag Day 2020).

(cherry picked from commit bb990030d3)
2020-10-06 09:35:20 +02:00