2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00
Commit Graph

34964 Commits

Author SHA1 Message Date
Ondřej Surý
ef8aa91740 Enable IDN2_USE_STD3_ASCII_RULES to idn2 conversion functions
libidn2 defaults to UseSTD3ASCIIRules=false. That allows arbitrary ASCII
characters to show up in the toASCII output, including space and
underscore.  Enable IDN2_USE_STD3_ASCII_RULES to the libidn2 conversion
to disallow additional characters from the conversion (see Validity
Criteria[1]).
2021-10-12 12:11:52 +02:00
Ondřej Surý
efed341c2e Merge branch '2933-bump-the-default-clang-version-to-13' into 'main'
Change the LLVM tools version to 13

Closes #2933

See merge request isc-projects/bind9!5484
2021-10-12 09:29:13 +00:00
Ondřej Surý
ed95f9fba3 Update the source code formatting using clang-format-13
clang-format-13 fixed some of the formatting that clang-format-12 got
wrong.  Update the formatting.
2021-10-12 11:14:40 +02:00
Ondřej Surý
16916ab3e3 Change the LLVM tools version to 13
LLVM 13.0.0 was released on 4. October 2021, change the default version
to the current stable.
2021-10-12 11:14:40 +02:00
Michał Kępień
840e71eeae Merge branch 'michal/properly-handle-jemalloc-autoconf-variables' into 'main'
Properly handle JEMALLOC_* Autoconf variables

See merge request isc-projects/bind9!5486
2021-10-12 09:09:06 +00:00
Michał Kępień
5178ba4cf2 Properly handle JEMALLOC_* Autoconf variables
The AX_CHECK_JEMALLOC() m4 macro sets the JEMALLOC_CFLAGS variable, not
JEMALLOC_CPPFLAGS.  Furthermore, the JEMALLOC_CFLAGS and JEMALLOC_LIBS
variables should only be included in the build flags if jemalloc was
successfully configured.  Tweak lib/isc/Makefile.am accordingly.
2021-10-12 10:44:30 +02:00
Mark Andrews
60e444848c Merge branch '2935-cid-339035-1-of-1-explicit-null-dereferenced-forward_null' into 'main'
Resolve "CID 339035 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)"

Closes #2935

See merge request isc-projects/bind9!5470
2021-10-11 23:16:22 +00:00
Mark Andrews
c48ca52851 Add CHANGES for [GL #2935] 2021-10-12 09:57:24 +11:00
Mark Andrews
0378c05ba0 Fix cleanup of signature buffer in dns_dnssec_signmessage
A NULL pointer could be freed if error handling occured.
2021-10-12 09:56:44 +11:00
Michał Kępień
e112afa156 Merge branch '2899-placeholder' into 'main'
Add placeholder for GL #2899

See merge request isc-projects/bind9!5479
2021-10-08 10:07:46 +00:00
Michał Kępień
3b0b45c4bf Add placeholder for GL #2899 2021-10-08 12:04:04 +02:00
Ondřej Surý
e96e9bba10 Merge branch '719-make-isc_result-static-CHANGES' into 'main'
Update isc_result_t developer documentation and CHANGES

Closes #719

See merge request isc-projects/bind9!5475
2021-10-07 06:48:02 +00:00
Ondřej Surý
2737bca579 Add CHANGES notes for [GL #719] 2021-10-07 08:06:54 +02:00
Ondřej Surý
848fef4d4d Update isc_result_t developer documentation
There's no multiple result.{c,h} location to defining result codes,
update the documentation accordingly.
2021-10-07 08:05:16 +02:00
Ondřej Surý
3b9d9f5afb Merge branch '2934-cid-339111-memory-corruptions-use_after_free' into 'main'
Resolve "CID 339111:  Memory - corruptions  (USE_AFTER_FREE)"

Closes #2934

See merge request isc-projects/bind9!5469
2021-10-06 15:45:58 +00:00
Mark Andrews
b7c362738d Correctly call dns_dispatch_done() in dns_dispatch_cancel()
Pass '&resp' rather than 'respp' as we have already cleared '*respp'
when we took ownership of 'resp'.
2021-10-06 17:20:38 +02:00
Ondřej Surý
2705860bb3 Merge branch '719-make-isc_result-static' into 'main'
Make isc_result a static enum

Closes #719

See merge request isc-projects/bind9!5458
2021-10-06 09:40:47 +00:00
Ondřej Surý
2e3a2eecfe Make isc_result a static enum
Remove the dynamic registration of result codes.  Convert isc_result_t
from unsigned + #defines into 32-bit enum type in grand unified
<isc/result.h> header.  Keep the existing values of the result codes
even at the expense of the description and identifier tables being
unnecessary large.

Additionally, add couple of:

    switch (result) {
    [...]
    default:
        break;
    }

statements where compiler now complains about missing enum values in the
switch statement.
2021-10-06 11:22:20 +02:00
Ondřej Surý
804ec1bcaa Improve STATIC_ASSERT macro for older compilers
Previously, when using compiler without support for static assertions,
the STATIC_ASSERT() macro would be replaced with runtime assertion.
Change the STATIC_ASSERT() macro to a version that's compile time
assertion even when using pre-C11 compilers.

Courtesy of Joseph Quinsey: https://godbolt.org/z/K9RvWS
2021-10-05 22:13:29 +02:00
Ondřej Surý
9f5985bae5 Remove duplicate DE_CONST macro
Both <isccc/util.h> and <isc/util.h> defined DE_CONST() macro.  As
<isccc/util.h> header includes <isc/util.h>, remove the macro from
<isccc/util.h> header.
2021-10-05 22:13:29 +02:00
Ondřej Surý
4d85040df5 Change the ISC_R_SUCCESS to DNS_RRL_RESULT_OK in dns_rrl()
There's value mismatch between the return type of dns_rrl() that's
dns_rrl_result_t and ISC_R_SUCCESS which belongs to isc_result_t.  This
works incidentally, because DNS_RRL_RESULT_OK == ISC_R_SUCCESS.

This would break when we change isc_result_t to be static enum in
consecutive commit.  Change the value to match the type.
2021-10-05 22:13:29 +02:00
Evan Hunt
4445d0a7d6 Merge branch '2928-coverity-fixes' into 'main'
address coverity and sanitizer reports

Closes #2928

See merge request isc-projects/bind9!5456
2021-10-05 19:30:55 +00:00
Evan Hunt
436424c458 increment fctx references while waiting for validator
We need to ensure the fctx isn't freed while the validator
is pending.
2021-10-05 10:18:48 -07:00
Evan Hunt
24dbf9849e refactor dispatch cancellation
Renamed some functions for clarity and readability:

- dns_dispatch_addresponse() -> dns_dispatch_add()
- dns_dispatch_removeresponse() -> dns_dispatch_done()

The dns_dispatch_cancel() function now calls dns_dispatch_done()
directly, so it is no longer ever necessary to call both functions.

dns_dispatch_cancel() is used to terminate dispatch connections
that are still pending, while dns_dispatch_done() is used when they
are complete.
2021-10-05 10:18:48 -07:00
Evan Hunt
2653800e0b simplify sending request events
The function send_if_done() was just a front-end for req_sendevents().
2021-10-05 10:18:48 -07:00
Evan Hunt
5948aa7766 clarify fctx_cancelquery() behavior
Cleaned up dereferencing of query objects, and added a comment
explaining it better.
2021-10-05 10:18:48 -07:00
Ondřej Surý
931779b3f6 Merge branch 'ondrej/fix-missing-OPENSSL_CFLAGS-in-bind9' into 'main'
Add OPENSSL_CFLAGS to libbind9 Makefile.am

See merge request isc-projects/bind9!5465
2021-10-05 13:15:57 +00:00
Ondřej Surý
13dfc191c5 Add OPENSSL_CFLAGS to libbind9 Makefile.am
The build would fail if the OpenSSL libraries were not in default
include path because we include <openssl/opensslv.h> header in
lib/bind9/check.c.  Add $(OPENSSL_CFLAGS) to lib/bind9/Makefile.am.
2021-10-05 13:13:53 +00:00
Artem Boldariev
1af9d8d7bb Merge branch '2794-dot-alpn-for-xfrs' into 'main'
Resolve #2794, #2884: make "dot" ALPN token negotiation to be required for XoT

Closes #2884 and #2794

See merge request isc-projects/bind9!5391
2021-10-05 08:49:27 +00:00
Artem Boldariev
cdf39260a7 Add an entry to the release notes file [GL #2794]
Mention that "dot" ALPN tag is now required for XoT.
2021-10-05 11:30:22 +03:00
Artem Boldariev
d696f5dd83 Add an entry to the CHANGES [GL #2884]
Mention that the bug making dig abort during zone transfers sometimes
is resolved.
2021-10-05 11:30:22 +03:00
Artem Boldariev
abecfdc298 DoT: do not attempt to call read callback if it is not avaialble
This commit fixes a crash in DoT code when it was attempting to call a
read callback on the later stages of the connection when it is not
available.

It also fixes [GL #2884] (back-trace provided in the bug report is
exactly the same as was seen when fixing this problem).
2021-10-05 11:26:14 +03:00
Artem Boldariev
fc3a37a2ad Add an entry to the CHANGES file [GL #2794]
Mention in the CHANGES file that "dot" ALPN token is required to be
negotiated for XoT.
2021-10-05 11:26:08 +03:00
Artem Boldariev
8cd3b9ef66 Do not allow zone transfers in dig over TLS without ALPN
This commit makes dig fail with error in case a zone transfer is
attempted over a connections where ALPN was not negotiated. All other
request types will work fine.
2021-10-05 11:23:47 +03:00
Artem Boldariev
610bd2726e Add ALPN negotiation tests to TLS DNS test set
This commits adds a set of unit tests to ensure that ALPN happens over
the connections and that the result of the negotiation can be checked.
2021-10-05 11:23:47 +03:00
Artem Boldariev
79d8af7354 Require "dot" ALPN token for incoming xfrs over XoT
This commit make the code handling incoming zone transfers to verify
if they are allowed to be done over the underlying connections. As a
result the check ensures that the "dot" ALPN token has been negotiated
over the underlying connection.
2021-10-05 11:23:47 +03:00
Artem Boldariev
382098198e Make dig advertise the "dot" ALPN token for DoT connections
This commit makes dig advertise the "dot" ALPN token to make it
possible for ALPN to happen.
2021-10-05 11:23:47 +03:00
Artem Boldariev
25b2c6ad96 Require "dot" ALPN token for zone transfer requests over DoT (XoT)
This commit makes BIND verify that zone transfers are allowed to be
done over the underlying connection. Currently, it makes sense only
for DoT, but the code is deliberately made to be protocol-agnostic.
2021-10-05 11:23:47 +03:00
Artem Boldariev
eba3278e52 Add isc_nm_xfr_allowed() function
The intention of having this function is to have a predicate to check
if a zone transfer could be performed over the given handle. In most
cases we can assume that we can do zone transfers over any stream
transport except DoH, but this assumption will not work for zone
transfers over DoT (XoT), as the RFC9103 requires ALPN to happen,
which might not be the case for all deployments of DoT.
2021-10-05 11:23:47 +03:00
Artem Boldariev
56b3f5d832 Low level code to support ALPN in DoT
This commit adds low-level code necessary to support ALPN in DoT as
XoT requires "dot" ALPN token to be negotiated on a connection for
zone transfers.
2021-10-05 11:23:47 +03:00
Mark Andrews
c75d6afc1c Merge branch '2900-listenlist_test-notify_test-and-query_test-failing' into 'main'
Resolve "listenlist_test, notify_test, and query_test failing."

Closes #2900

See merge request isc-projects/bind9!5461
2021-10-05 06:44:43 +00:00
Mark Andrews
877f52b772 Increase the number of file descriptors available
The 'listenlist_test', 'notify_test', and 'query_test' tests failed
when the descriptor limit was 256 on MacOS 11.6 with 8 cpus. On the
test platform the limit needed to be increased to ~400.  Increase
the limit to at least 1024 to give some head room.
2021-10-05 17:21:30 +11:00
Evan Hunt
0261bad3df Merge branch '88-make-libs-private' into 'main'
remove libdns init/shutdown functions

Closes #88

See merge request isc-projects/bind9!5405
2021-10-04 21:16:34 +00:00
Evan Hunt
dfccfc9361 CHANGES for [GL #88] 2021-10-04 13:58:00 -07:00
Evan Hunt
e61b76292a Remove libns init/shutdown functions
as libraries are no longer exported, these functions served
no useful purpose.
2021-10-04 13:57:34 -07:00
Evan Hunt
cd8a081a4f Remove libdns init/shutdown functions
as libdns is no longer exported, it's not necessary to have
init and shutdown functions. the only purpose they served
was to create a private mctx and run dst_lib_init(), which
can be called directly instead.
2021-10-04 13:57:32 -07:00
Artem Boldariev
372d065eff Merge branch '2925-do-not-allow-default-http' into 'main'
Do not allow defining "http" clauses named "default"

Closes #2925

See merge request isc-projects/bind9!5453
2021-10-04 15:04:07 +00:00
Artem Boldariev
79ce4441e7 Modify CHANGES [GL #2925]
Mention that it is not allowed defining "http" clauses named "default"
2021-10-04 17:29:47 +03:00
Artem Boldariev
d45df0d923 Do not allow defining "http" clauses named "default"
This name is reserved for being used in 'listen-on' statements only.
2021-10-04 17:28:30 +03:00
Evan Hunt
d27d20e6d4 Merge branch '2401-use-netmgr-for-dispatch' into 'main'
Resolve "use netmgr for dispatch"

Closes #2401

See merge request isc-projects/bind9!4601
2021-10-02 19:04:03 +00:00