Commit Graph

34122 Commits

Author SHA1 Message Date
Matthijs Mekking
dae42dc9d4 Add changes and notes for [#2783] 2021-06-22 09:04:11 +02:00
Matthijs Mekking
42c601ae14 Fix deadlock issue with key-directory and in-view
When locking key files for a zone, we iterate over all the views and
lock a mutex inside the zone structure. However, if we envounter an
in-view zone, we will try to lock the key files twice, one time for
the home view and one time for the in-view view. This will lead to
a deadlock because one thread is trying to get the same lock twice.
2021-06-22 09:04:11 +02:00
Matthijs Mekking
acd83881ff Add test case for in-view with dnssec-policy
Add a test case for a zone that uses 'in-view' and 'dnssec-policy'.
BIND should not deadlock.
2021-06-21 16:03:35 +02:00
Mark Andrews
fb335e4b47 Merge branch '2778-unique-key-directories-reported-as-reused-in-9-16-17-regression-vs-9-16-16' into 'main'
Resolve "Unique key directories reported as reused in 9.16.17, regression vs 9.16.16"

Closes #2778

See merge request isc-projects/bind9!5195
2021-06-18 07:21:27 +00:00
Mark Andrews
85033788d3 Add release note for [GL #2778] 2021-06-18 16:46:02 +10:00
Mark Andrews
bd1419a9e8 Add CHANGES for [GL #2778] 2021-06-18 16:46:02 +10:00
Mark Andrews
d1e283ede1 Checking of key-directory and dnssec-policy was broken
the checks failed to account for key-directory being inheritable.
2021-06-18 16:46:02 +10:00
Mark Andrews
721237efb3 Merge branch '2779-name-in-answer-doesn-t-match-the-name-in-query' into 'main'
Resolve "name in answer doesn't match the name in query"

Closes #2779

See merge request isc-projects/bind9!5194
2021-06-18 06:27:22 +00:00
Mark Andrews
7372e9a60d Add release note for [GL #2779] 2021-06-18 15:51:37 +10:00
Mark Andrews
8c60debc18 Add CHANGES note for [GL #2779] 2021-06-18 15:51:37 +10:00
Mark Andrews
c65dc2f7dc Check wild card expansions by code point 2021-06-18 15:51:36 +10:00
Mark Andrews
08eeebb6a7 Add w and W to maptoupper and maptolower tables 2021-06-18 11:29:45 +10:00
Michal Nowak
7abde2c1d7 Merge branch 'mnowak/alpine-3.14' into 'main'
Add Alpine Linux 3.14

See merge request isc-projects/bind9!5183
2021-06-17 16:17:06 +00:00
Michal Nowak
80f828bc37 Add Alpine Linux 3.14 2021-06-17 18:16:00 +02:00
Michał Kępień
992b900557 Merge branch '2770-allow-hash-tables-for-cache-rbts-to-be-grown' into 'main'
Allow hash tables for cache RBTs to be grown

Closes #2770

See merge request isc-projects/bind9!5172
2021-06-17 15:16:38 +00:00
Michał Kępień
0c59f1362c Add CHANGES entry 2021-06-17 17:09:37 +02:00
Michał Kępień
6b77583f54 Allow resetting hash table size limits for DNS DBs
When "max-cache-size" is changed to "unlimited" (or "0") for a running
named instance (using "rndc reconfig"), the hash table size limit for
each affected cache DB is not reset to the maximum possible value,
preventing those hash tables from being allowed to grow as a result of
new nodes being added.

Extend dns_rbt_adjusthashsize() to interpret "size" set to 0 as a signal
to remove any previously imposed limits on the hash table size.  Adjust
API documentation for dns_db_adjusthashsize() accordingly.  Move the
call to dns_db_adjusthashsize() from dns_cache_setcachesize() so that it
also happens when "size" is set to 0.
2021-06-17 17:09:37 +02:00
Michał Kępień
c096f91451 Allow hash tables for cache RBTs to be grown
Upon creation, each dns_rbt_t structure has its "maxhashbits" field
initialized to the value of the RBT_HASH_MAX_BITS preprocessor macro,
i.e. 32.  When the dns_rbt_adjusthashsize() function is called for the
first time for a given RBT (for cache RBTs, this happens when they are
first created, i.e. upon named startup), it lowers the value of the
"maxhashbits" field to the number of bits required to index the
requested number of hash table slots.  When a larger hash table size is
subsequently requested, the value of the "maxhashbits" field should be
increased accordingly, up to RBT_HASH_MAX_BITS.  However, the loop in
the rehash_bits() function currently ensures that the number of bits
necessary to index the resized hash table will not be larger than
rbt->maxhashbits instead of RBT_HASH_MAX_BITS, preventing the hash table
from being grown once the "maxhashbits" field of a given dns_rbt_t
structure is set to any value lower than RBT_HASH_MAX_BITS.

Fix by tweaking the loop guard condition in the rehash_bits() function
so that it compares the new number of bits used for indexing the hash
table against RBT_HASH_MAX_BITS rather than rbt->maxhashbits.
2021-06-17 17:09:37 +02:00
Michał Kępień
64acd7c8c8 Merge branch '2763-increase-timeout-in-the-rndc-deadlock-test' into 'main'
Increase timeout in the rndc deadlock test

Closes #2763

See merge request isc-projects/bind9!5163
2021-06-17 10:40:31 +00:00
Michał Kępień
ac4c58e8ce Increase timeout in the rndc deadlock test
The timeout originally picked for "rndc status" invocations (2 seconds)
in the test attempting to reproduce a deadlock caused by running
multiple "rndc addzone", "rndc modzone", and "rndc delzone" commands
concurrently causes intermittent failures of the "addzone" system test
in GitLab CI.  Increase the timeout to 10 seconds to make such failures
less probable.  Adjust code comments accordingly.
2021-06-17 12:39:32 +02:00
Ondřej Surý
023fcf3365 Merge branch 'ondrej/fix-some-spelling' into 'main'
Fix various typos in the documentation

See merge request isc-projects/bind9!4498
2021-06-17 09:39:15 +00:00
Ondřej Surý
4ab9bb63ee Fix various typos in the documentation
Generally, the issues fixed here are missing articles, wrong articles
and double articles.  We especially like "the the".
2021-06-17 11:32:04 +02:00
Ondřej Surý
2cd6ec4857 Merge branch '2606-remove-support-for-builtin-atomics-on-legacy-clang-compilers' into 'main'
Resolve "Remove support for builtin atomics on legacy clang compilers"

Closes #2606

See merge request isc-projects/bind9!4854
2021-06-17 08:52:10 +00:00
Diego Fronza
20e968b70c Add CHANGES note for [GL #2606] 2021-06-17 09:51:05 +02:00
Ondřej Surý
54c389dbc0 Drop support for clang atomic and gcc __sync builtins
The requirements for BIND 9.17+ now requires C11 support from the
compiler, so we can safely drop most of the stdatomic.h shims from
lib/isc/unix/include/stdatomic.h.

This commit removes support for clang atomic builtins (clang >= 3.6.0
includes stdatomic.h header) and for Gcc __sync builtins.

The only compatibility shim that remains is support for __atomic
builtins for Gcc >= 4.7.0 since CentOS 7 still includes only Gcc 4.8.1
and the proper stdatomic.h header was only introduced in Gcc >= 4.9.
2021-06-17 09:51:04 +02:00
Ondřej Surý
4677bb28d1 Remove atomics emulated by a mutex-locked variable
Mutex atomics were intended to be used as a debugging tool only
and it has already served its purpose and it's not needed anymore.
2021-06-17 09:51:04 +02:00
Michał Kępień
aa626c6499 Merge branch 'v9_17_14-release' into 'main'
Merge 9.17.14 release branch

See merge request isc-projects/bind9!5186
2021-06-16 20:24:43 +00:00
Michał Kępień
f9e8c8057d Set up release notes for BIND 9.17.15 2021-06-16 22:18:12 +02:00
Michał Kępień
7e0e2dd667 Update BIND version to 9.17.14 2021-06-16 22:18:12 +02:00
Michał Kępień
2f3b74dec9 Add a CHANGES marker 2021-06-16 22:18:12 +02:00
Michał Kępień
1408f3572d Merge branch 'michal/prepare-documentation-for-bind-9.17.14' into 'v9_17_14-release'
Prepare documentation for BIND 9.17.14

See merge request isc-private/bind9!298
2021-06-16 22:18:12 +02:00
Michał Kępień
652d4a74fe Prepare release notes for BIND 9.17.14 2021-06-16 22:18:12 +02:00
Michał Kępień
54842d6349 Reorder release notes 2021-06-16 22:18:12 +02:00
Michał Kępień
451b29cbbf Tweak and reword release notes 2021-06-16 22:18:12 +02:00
Michał Kępień
59a9fa4863 Tweak and reword recent CHANGES entries 2021-06-16 22:18:12 +02:00
Michał Kępień
0439e92fa0 Remove leftover release note for GL #2603 2021-06-16 22:18:12 +02:00
Artem Boldariev
3549eed088 Merge branch 'artem/doh-memmove-null-asan-fix' into 'main'
Fix undefined behaviour in DoH (passing NULL to memmove())

See merge request isc-projects/bind9!5182
2021-06-16 15:51:02 +00:00
Artem Boldariev
dc356bb196 Fix ASAN error in DoH (passing NULL to memmove())
The warning was produced by an ASAN build:

runtime error: null pointer passed as argument 2, which is declared to
never be null

This commit fixes it by checking if nghttp2_session_mem_send() has
actually returned anything.
2021-06-16 17:46:10 +03:00
Mark Andrews
629d8a3096 Merge branch '2755-bad-tkey-samples-in-genzone-sh-comment' into 'main'
Resolve "Bad TKEY samples in genzone.sh comment"

Closes #2755

See merge request isc-projects/bind9!5152
2021-06-16 05:54:30 +00:00
Mark Andrews
47ca495108 make it clear algorithm field is a domain name 2021-06-16 05:26:00 +00:00
Mark Andrews
f035a22c42 Merge branch '2739-threadsanitizer-data-race-lib-isc-task-c-435-in-task_send-unprotected-access-to-task-threadid' into 'main'
Resolve "ThreadSanitizer: data race lib/isc/task.c:435 in task_send (unprotected access to `task->threadid`)"

Closes #2739

See merge request isc-projects/bind9!5149
2021-06-15 00:39:03 +00:00
Mark Andrews
234ad2d075 Lock access to task->threadid 2021-06-15 00:01:58 +00:00
Artem Boldariev
8d36cac81a Merge branch 'artem/dig-large-doh-responses-support' into 'main'
Fix BIND and dig to support large DNS messages over DoH, disable XFRs over DoH

See merge request isc-projects/bind9!5148
2021-06-14 09:22:40 +00:00
Evan Hunt
f8caebe152 CHANGES
Mention that XFRs over DoH are explicitly disabled for now.
2021-06-14 11:38:35 +03:00
Artem Boldariev
ccd2267b1c Set sock->iface and sock->peer properly for layered connection types
This change sets the mentioned fields properly and gets rid of klusges
added in the times when we were keeping pointers to isc_sockaddr_t
instead of copies. Among other things it helps to avoid a situation
when garbage instead of an address appears in dig output.
2021-06-14 11:37:36 +03:00
Artem Boldariev
b84fa122ce Make BIND refuse to serve XFRs over DoH
We cannot use DoH for zone transfers.  According to RFC8484 a DoH
request contains exactly one DNS message (see Section 6: Definition of
the "application/dns-message" Media Type,
https://datatracker.ietf.org/doc/html/rfc8484#section-6).  This makes
DoH unsuitable for zone transfers as often (and usually!) these need
more than one DNS message, especially for larger zones.

As zone transfers over DoH are not (yet) standardised, nor discussed
in RFC8484, the best thing we can do is to return "not implemented."

Technically DoH can be used to transfer small zones which fit in one
message, but that is not enough for the generic case.

Also, this commit makes the server-side DoH code ensure that no
multiple responses could be attempted to be sent over one HTTP/2
stream. In HTTP/2 one stream is mapped to one request/response
transaction. Now the write callback will be called with failure error
code in such a case.
2021-06-14 11:37:36 +03:00
Artem Boldariev
009752cab0 Pass an HTTP handle to the read callback when finishing a stream
This commit fixes a leftover from an earlier version of the client-side
DoH code when the underlying transport handle was used directly.
2021-06-14 11:37:36 +03:00
Artem Boldariev
d5d20cebb2 Fix a crash in the client-side DoH code (header processing callback)
Support a situation in header processing callback when client side
code could receive a belated response or part of it. That could
happen when the HTTP/2 session was already closed, but there were some
response data from server in flight. Other client-side nghttp2
callbacks code already handled this case.

The bug became apparent after HTTP/2 write buffering was supported,
leading to rare unit test failures.
2021-06-14 11:37:33 +03:00
Artem Boldariev
2dfc0d9afc Nullify connect.cstream in time and keep track of all client streams
This commit ensures that sock->h2.connect.cstream gets nullified when
the object in question is deleted. This fixes a nasty crash in dig
exposed when receiving large responses leading to double free()ing.

Also, it refactors how the client-side code keeps track of client
streams (hopefully) preventing from similar errors appearing in the
future.
2021-06-14 11:37:29 +03:00
Artem Boldariev
5b507c1136 Fix BIND to serve large HTTP responses
This commit makes NM code to report HTTP as a stream protocol. This
makes it possible to handle large responses properly. Like:

dig +https @127.0.0.1 A cmts1-dhcp.longlines.com
2021-06-14 11:37:17 +03:00