Commit Graph

32923 Commits

Author SHA1 Message Date
Patrick McLean
702edde73a dig: Use high resolution clocks when microsecond accuracy is requested
The TIME_NOW macro calls isc_time_now which uses CLOCK_REALTIME_COARSE
for getting the current time. This is perfectly fine for millisecond,
however when the user request microsecond resolutiuon, they are going
to get very inaccurate results. This is especially true on a server
class machine where the clock ticks may be set to 100HZ.

This changes dig to use the new TIME_NOW_HIRES macro that uses the
CLOCK_MONOTONIC_RAW that is more expensive, but gets the *actual*
current time rather than the at the last kernel time tick.

(cherry picked from commit 56cef1495f)
2021-03-20 12:00:59 -07:00
Patrick McLean
c5c9c9b83f Add isc_time_now_hires function to get current time with high resolution
The current isc_time_now uses CLOCK_REALTIME_COARSE which only updates
on a timer tick. This clock is generally fine for millisecond accuracy,
but on servers with 100hz clocks, this clock is nowhere near accurate
enough for microsecond accuracy.

This commit adds a new isc_time_now_hires function that uses
CLOCK_REALTIME, which gives the current time, though it is somewhat
expensive to call. When microsecond accuracy is required, it may be
required to use extra resources for higher accuracy.

(cherry picked from commit ebced74b19)
2021-03-20 11:59:21 -07:00
Michal Nowak
a0db1ac26c Merge branch 'v9_16_13-release' into 'v9_16'
Merge 9.16.13 release branch

See merge request isc-projects/bind9!4821
2021-03-19 09:36:09 +00:00
Michal Nowak
63cb814f3c Set up release notes for BIND 9.16.14 2021-03-19 10:10:59 +01:00
Tinderbox User
cfb6cca52d Merge branch 'prep-release' into v9_16_13-release 2021-03-19 09:57:51 +01:00
Michal Nowak
4bbc3587e0 Merge branch 'mnowak/prepare-documentation-for-bind-9.16.13' into 'v9_16_13-release'
Prepare documentation for BIND 9.16.13

See merge request isc-private/bind9!267
2021-03-19 09:57:51 +01:00
Tinderbox User
0525112928 prep 9.16.13 2021-03-19 09:57:51 +01:00
Michal Nowak
d0444472d8 Prepare release notes for BIND 9.16.13 2021-03-19 09:57:51 +01:00
Michal Nowak
7ce5609e8b Add release note for GL #2041 2021-03-19 09:57:51 +01:00
Michal Nowak
ed42c89938 Reorder release notes 2021-03-19 09:57:51 +01:00
Michal Nowak
4af8825c27 Tweak and reword release notes 2021-03-19 09:57:36 +01:00
Michal Nowak
3ef42ca6db Tweak and reword recent CHANGES entries 2021-03-19 09:54:30 +01:00
Diego dos Santos Fronza
706c8c6a12 Merge branch '2575-memory-leak-when-named-attempts-to-listen-on-freebsd-virtual-interface' into 'v9_16'
Resolve "memory leak when named attempts to listen on FreeBSD virtual interface"

See merge request isc-projects/bind9!4823
2021-03-18 21:40:49 +00:00
Diego Fronza
392a08bc95 Add CHANGES and release notes 2021-03-18 18:20:18 -03:00
Witold Kręcicki
a6c4702796 Fix a startup/shutdown crash in ns_clientmgr_create 2021-03-18 15:33:28 -03:00
Witold Kręcicki
dd564da286 Shutdown interface if we can't listen on it to avoid shutdown hang 2021-03-18 15:27:28 -03:00
Ondřej Surý
2d2ac820ef Merge branch '2573-dont-timeout-when-sending-data-v9_16' into 'v9_16'
Resolve "Fix TCPDNS and TLSDNS timers" (v9.16)

See merge request isc-projects/bind9!4819
2021-03-18 15:59:48 +00:00
Ondřej Surý
121641686c Temporarily disable tlsdns_test until it gets refactored
The tlsdns API is not yet used in the 9.16 branch and the tlsdns_test
fails too often.  Temporarily disable running the test until it is
actually needed.
2021-03-18 15:42:03 +01:00
Ondřej Surý
e822b77dc0 Add CHANGES and release note for GL #2573 2021-03-18 15:16:13 +01:00
Ondřej Surý
db49ffca20 Change the isc_nm_(get|set)timeouts() to work with milliseconds
The RFC7828 specifies the keepalive interval to be 16-bit, specified in
units of 100 milliseconds and the configuration options tcp-*-timeouts
are following the suit.  The units of 100 milliseconds are very
unintuitive and while we can't change the configuration and presentation
format, we should not follow this weird unit in the API.

This commit changes the isc_nm_(get|set)timeouts() functions to work
with milliseconds and convert the values to milliseconds before passing
them to the function, not just internally.
2021-03-18 15:16:13 +01:00
Ondřej Surý
5d0647e067 Merge the common parts between udp, tcpdns and tlsdns protocol
The udp, tcpdns and tlsdns contained lot of cut&paste code or code that
was very similar making the stack harder to maintain as any change to
one would have to be copied to the the other protocols.

In this commit, we merge the common parts into the common functions
under isc__nm_<foo> namespace and just keep the little differences based
on the socket type.
2021-03-18 15:16:13 +01:00
Ondřej Surý
a017ba2615 Fix TCPDNS and TLSDNS timers
After the TCPDNS refactoring the initial and idle timers were broken and
only the tcp-initial-timeout was always applied on the whole TCP
connection.

This broke any TCP connection that took longer than tcp-initial-timeout,
most often this would affect large zone AXFRs.

This commit changes the timeout logic in this way:

  * On TCP connection accept the tcp-initial-timeout is applied
    and the timer is started
  * When we are processing and/or sending any DNS message the timer is
    stopped
  * When we stop processing all DNS messages, the tcp-idle-timeout
    is applied and the timer is started again
2021-03-18 15:16:13 +01:00
Ondřej Surý
94a32eaf29 Add TCP timeouts system test
The system tests were missing a test that would test tcp-initial-timeout
and tcp-idle-timeout.

This commit adds new "timeouts" system test that adds:

  * Test that waits longer than tcp-initial-timeout and then checks
    whether the socket was closed

  * Test that sends and receives DNS message then waits longer than
    tcp-initial-timeout but shorter time than tcp-idle-timeout than
    sends DNS message again than waits longer than tcp-idle-timeout
    and checks whether the socket was closed

  * Similar test, but bursting 25 DNS messages than waiting longer than
    tcp-initial-timeout and shorter than tcp-idle-timeout than do second
    25 DNS message burst

  * Check whether transfer longer than tcp-initial-timeout succeeds
2021-03-18 15:16:13 +01:00
Mark Andrews
30f749cdf3 Merge branch '2580-does-not-compile-without-deprecated-openssl-apis-v9_16' into 'v9_16'
Stop using deprecated calls in lib/isc/tls.c

See merge request isc-projects/bind9!4815
2021-03-17 23:39:13 +00:00
Mark Andrews
3f9d7227b3 Stop using deprecated calls in lib/isc/tls.c
from Rosen Penev @neheb

(cherry picked from commit a9f883cbc2)
2021-03-18 10:15:44 +11:00
Matthijs Mekking
bcfdb0a6f6 Merge branch '2523-thaw-dnssec-policy-zone-v9_16' into 'v9_16'
Resolve "Unable to thaw a frozen dynamic zone when KASP is configured."

See merge request isc-projects/bind9!4811
2021-03-17 10:56:19 +00:00
Matthijs Mekking
937e10a5f4 Add test for thaw dynamic kasp zone
Add a test for freezing, manually updating, and then thawing a dynamic
zone with "dnssec-policy". In the kasp system test we add parameters
to the "update_is_signed" check to signal the indicated IP addresses
for the labels "a" and "d". If set to '-', the test is skipped.

After nsupdating the dynamic.kasp zone, we revert the update (with
nsupdate) and update the zone again, but now with the freeze/thaw
approach.

(cherry picked from commit 0cae3249e3)
2021-03-17 11:12:48 +01:00
Matthijs Mekking
1a29d7ae7d Fully sign a thawed zone
When thawing a zone, we don't know what changes have been made. If we
do DNSSEC maintenance on this zone, schedule a full sign.

(cherry picked from commit b90846f222)
2021-03-17 11:12:39 +01:00
Matthijs Mekking
3ae16d0480 Fix "unable to thaw dynamic kasp zone"
Dynamic zones with dnssec-policy could not be thawed because KASP
zones were considered always dynamic. But a dynamic KASP zone should
also check whether updates are disabled.

(cherry picked from commit b518ed9f46)
2021-03-17 11:12:29 +01:00
Matthijs Mekking
aba7f9856b Merge branch '2561-dnssec-guide-signing-type-v9_16' into 'v9_16'
Fix typo in DNSSEC Guide

See merge request isc-projects/bind9!4808
2021-03-17 08:00:06 +00:00
Matthijs Mekking
8bcb642049 Fix typo in DNSSEC Guide
The "dnssec-policy" example should say "keys" instead of "key".

(cherry picked from commit d45af8877a)
2021-03-16 14:38:25 +01:00
Mark Andrews
17e7f3643f Merge branch '2569-nsupdate-on-solaris-produces-different-failure-text-than-expected-v9_16' into 'v9_16'
Ignore the actual error code returned by getaddrinfo

See merge request isc-projects/bind9!4805
2021-03-16 00:37:51 +00:00
Mark Andrews
8dc5d63e1d Ignore the actual error code returned by getaddrinfo
when testing if interactive mode continues or not on
invalid hostname.  We only need to detect that getaddrinfo
failed and that we continued or not.

(cherry picked from commit 25d1276170)
2021-03-16 11:12:47 +11:00
Michal Nowak
9d9f8e4436 Merge branch '2565-servestale-fetchlimits-crash-v9_16' into 'v9_16'
[v9_16] Fix servestale fetchlimits crash

See merge request isc-projects/bind9!4798
2021-03-11 13:16:54 +00:00
Matthijs Mekking
96953fc293 Fix servestale fetchlimits crash
When we query the resolver for a domain name that is in the same zone
for which is already one or more fetches outstanding, we could
potentially hit the fetch limits. If so, recursion fails immediately
for the incoming query and if serve-stale is enabled, we may try to
return a stale answer.

If the resolver is also is authoritative for the parent zone (for
example the root zone), first a delegation is found, but we first
check the cache for a better response.

Nothing is found in the cache, so we try to recurse to find the
answer to the query.

Because of fetch-limits 'dns_resolver_createfetch()' returns an error,
which 'ns_query_recurse()' propagates to the caller,
'query_delegation_recurse()'.

Because serve-stale is enabled, 'query_usestale()' is called,
setting 'qctx->db' to the cache db, but leaving 'qctx->version'
untouched. Now 'query_lookup()' is called to search for stale data
in the cache database with a non-NULL 'qctx->version'
(which is set to a zone db version), and thus we hit an assertion
in rbtdb.

This crash was introduced in 'v9_16' by commit
2afaff75ed.

(cherry picked from commit 87591de6f7)
2021-03-11 13:47:20 +01:00
Michał Kępień
f31291d885 Merge branch '2556-fix-documentation-for-the-max-ixfr-ratio-option-v9_16' into 'v9_16'
[v9_16] Fix documentation for the "max-ixfr-ratio" option

See merge request isc-projects/bind9!4790
2021-03-08 11:35:32 +00:00
Michał Kępień
f78ce6ebb4 Fix documentation for the "max-ixfr-ratio" option
Commit 9fb6d11abb (which converted BIND 9
documentation from DocBook to Sphinx) inadvertently removed a paragraph
from the description of the "max-ixfr-ratio" option.  Add the missing
paragraph back.

(cherry picked from commit 3878cf4ac5)
2021-03-08 12:29:10 +01:00
Ondřej Surý
5207d07852 Merge branch '2555-workaround-truncated-64-bit-enum-in-journal-on-windows-v9_16' into 'v9_16'
Resolve "journal test fails on Windows"

See merge request isc-projects/bind9!4786
2021-03-08 09:45:27 +00:00
Evan Hunt
401642cbb4 fix automatic journal upgrade on windows
- use a value less than 2^32 for DNS_ZONEFLG_FIXJOURNAL; a larger value
  could cause problems in some build environments. the zone flag
  DNS_ZONEFLG_DIFFONRELOAD, which was no longer in use, has now been
  deleted and its value reused for _FIXJOURNAL.

(cherry picked from commit 990dd9dbff)
2021-03-08 09:43:00 +01:00
Evan Hunt
2aed5c5954 add start and end serial numbers to 'named-printjournal -x'
add the starting and ending serial number from the journal
header to the output of dns_journal_print().

(cherry picked from commit 46c11726d4)
2021-03-08 09:43:00 +01:00
Mark Andrews
b5aaacf77a Merge branch '2559-cid-329159-logically-dead-code-in-lib-dns-journal-c-v9_16' into 'v9_16'
Silence CID 329159: Logically dead code in lib/dns/journal.c

See merge request isc-projects/bind9!4783
2021-03-08 07:20:27 +00:00
Mark Andrews
898e9989f9 Silence CID 329159: Logically dead code in lib/dns/journal.c
*** CID 329159:    (DEADCODE)
    /lib/dns/journal.c: 1719 in dns_journal_print()
    1713     		}
    1714     		CHECK(dns_difftuple_create(
    1715     			diff.mctx, n_soa == 1 ? DNS_DIFFOP_DEL : DNS_DIFFOP_ADD,
    1716     			name, ttl, rdata, &tuple));
    1717     		dns_diff_append(&diff, &tuple);
    1718
    >>>     CID 329159:    (DEADCODE)
    >>>     Execution cannot reach the expression "printxhdr" inside this statement: "if (++n_put != 0U || printx...".
    1719     		if (++n_put != 0 || printxhdr) {
    1720     			result = dns_diff_print(&diff, file);
    1721     			dns_diff_clear(&diff);
    1722     			n_put = 0;
    1723     			if (result != ISC_R_SUCCESS) {
    1724     				break;
    /lib/dns/journal.c: 1734 in dns_journal_print()
    1728     	if (result == ISC_R_NOMORE) {
    1729     		result = ISC_R_SUCCESS;
    1730     	}
    1731     	CHECK(result);
    1732
    1733     	if (!printxhdr && n_put != 0) {
    >>>     CID 329159:    (DEADCODE)
    >>>     Execution cannot reach this statement: "result = dns_diff_print(&di...".
    1734     		result = dns_diff_print(&diff, file);
    1735     		dns_diff_clear(&diff);
    1736     	}
    1737     	goto cleanup;
    1738
    1739     failure:

(cherry picked from commit 848e336db4)
2021-03-08 16:44:43 +11:00
Mark Andrews
33c925476d Merge branch '2560-cid-329157-dereference-before-null-check-in-lib-dns-journal-c-v9_16' into 'v9_16'
Silence CID 329157: Dereference before null check in lib/dns/journal.c

See merge request isc-projects/bind9!4782
2021-03-08 05:43:12 +00:00
Mark Andrews
fb7e38cca2 Silence CID 329157: Dereference before null check in lib/dns/journal.c
*** CID 329157:  Null pointer dereferences  (REVERSE_INULL)
    /lib/dns/journal.c: 754 in journal_open()
    748     			    j->header.index_size * sizeof(journal_rawpos_t));
    749     	}
    750     	if (j->index != NULL) {
    751     		isc_mem_put(j->mctx, j->index,
    752     			    j->header.index_size * sizeof(journal_pos_t));
    753     	}
       CID 329157:  Null pointer dereferences  (REVERSE_INULL)
       Null-checking "j->filename" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
    754     	if (j->filename != NULL) {
    755     		isc_mem_free(j->mctx, j->filename);
    756     	}
    757     	if (j->fp != NULL) {
    758     		(void)isc_stdio_close(j->fp);
    759     	}

(cherry picked from commit 4054405909)
2021-03-08 16:12:01 +11:00
Ondřej Surý
ccb21b3f79 Merge branch '1529-add-threadsanitizer-core-dumping-flags-when-we-are-threadsanitizer-clean-v9_16' into 'v9_16'
Resolve "Add ThreadSanitizer core dumping flags when we are ThreadSanitizer-clean"

See merge request isc-projects/bind9!4775
2021-03-04 15:58:32 +00:00
Ondřej Surý
74c537adb9 Disable allow_failure for ThreadSanitizer jobs
Since the main branch is now TSAN-clean, it's a good opportunity to
enable hard failures for the TSAN system test jobs.

(cherry picked from commit 4072cc2b93)
2021-03-04 16:25:50 +01:00
Michal Nowak
13bf49fd5d Add ThreadSanitizer core dumping flags
This should let us have core dumps from crashed system test when
ThreadSanitizer is enabled.

(cherry picked from commit a730bc47f5)
2021-03-04 16:25:50 +01:00
Ondřej Surý
d714c48be0 Merge branch '2455-tcpdns_test-c-runtime-error-load-of-misaligned-address-for-type-uint64_t-v9_16' into 'v9_16'
Assigning uint64_t from buffer might be misaligned in netmgr tests

See merge request isc-projects/bind9!4773
2021-03-04 15:09:01 +00:00
Ondřej Surý
1c2e018962 Assigning uint64_t from buffer might be misaligned in netmgr tests
Resolve possible 8-byte unaligned access when assigning the magic
value from the received buffer.

(cherry picked from commit a55bdb28f9)
2021-03-04 15:29:44 +01:00
Ondřej Surý
c196779f53 Merge branch '2533-mdig-move-cleanup-v9_16' into 'v9_16'
Move cleanup of queries to later in the shutdown sequence

See merge request isc-projects/bind9!4772
2021-03-04 14:29:07 +00:00