Commit Graph

35228 Commits

Author SHA1 Message Date
Michał Kępień
ea89ab80ae Fix error codes passed to connection callbacks
Commit 9ee60e7a17 erroneously introduced
duplicate conditions to several existing conditional statements
responsible for determining error codes passed to connection callbacks
upon failure.  Fix the affected expressions to ensure connection
callbacks are invoked with:

  - the ISC_R_SHUTTINGDOWN error code when a global netmgr shutdown is
    in progress,

  - the ISC_R_CANCELED error code when a specific operation has been
    canceled.

This does not fix any known bugs, it only adjusts the changes introduced
by commit 9ee60e7a17 so that they match
its original intent.
2021-12-28 15:09:50 +01:00
Michał Kępień
cb22ed0492 Merge branch '3068-fix-rare-control-channel-socket-reference-leak' into 'main'
Fix rare control channel socket reference leak

Closes #3068

See merge request isc-projects/bind9!5673
2021-12-28 12:42:45 +00:00
Michał Kępień
fc678b19d9 Fix rare control channel socket reference leak
Commit 9ee60e7a17 enabled netmgr shutdown
to cause read callbacks for active control channel sockets to be invoked
with the ISC_R_SHUTTINGDOWN result code.  However, control channel code
only recognizes ISC_R_CANCELED as an indicator of an in-progress netmgr
shutdown (which was correct before the above commit).  This discrepancy
enables the following scenario to happen in rare cases:

 1. A control channel request is received and responded to.  libuv
    manages to write the response to the TCP socket, but the completion
    callback (control_senddone()) is yet to be invoked.

 2. Server shutdown is initiated.  All TCP sockets are shut down, which
    i.a. causes control_recvmessage() to be invoked with the
    ISC_R_SHUTTINGDOWN result code.  As the result code is not
    ISC_R_CANCELED, control_recvmessage() does not set
    listener->controls->shuttingdown to 'true'.

 3. control_senddone() is called with the ISC_R_SUCCESS result code.  As
    neither listener->controls->shuttingdown is 'true' nor is the result
    code ISC_R_CANCELED, reading is resumed on the control channel
    socket.  However, this read can never be completed because the read
    callback on that socket was cleared when the TCP socket was shut
    down.  This causes a reference on the socket's handle to be held
    indefinitely, leading to a hang upon shutdown.

Ensure listener->controls->shuttingdown is also set to 'true' when
control_recvmessage() is invoked with the ISC_R_SHUTTINGDOWN result
code.  This ensures the send completion callback does not resume reading
after the control channel socket is shut down.
2021-12-28 08:36:01 +01:00
Michal Nowak
ab52c99843 Merge branch 'mnowak/make-debian-11-bullseye-base-image' into 'main'
Make bullseye the base image

See merge request isc-projects/bind9!5367
2021-12-23 14:41:45 +00:00
Michal Nowak
4d7e343813 Use /dev/urandom as BIND 9.11 randomness source
This prevents resolver timeouts for the reference (BIND 9.11) servers
used in respdiff tests run on Debian 11 "bullseye".
2021-12-23 11:37:59 +01:00
Michal Nowak
910d595fbc Make bullseye the base image
"buster" jobs are now only going to be run in scheduled pipelines.

"--without-gssapi" ./configure option of "bullseye" before it became
the base image is dropped from "bullseye"-the-base-image because it
reduces gcov coverage by 0.38 % (651 lines) and is used in Debian 9
"stretch".
2021-12-23 11:37:59 +01:00
Mark Andrews
3959776b02 Merge branch '3041-decide-what-to-do-with-reject-000-and-other-obscure-options-for-synth-from-dnssec-feature' into 'main'
remove reject-000 and broken-nsec options (related to synth-from-dnssec feature)

Closes #3041

See merge request isc-projects/bind9!5621
2021-12-23 05:14:50 +00:00
Mark Andrews
dc8595936c remove broken-nsec and reject-000-label options 2021-12-23 15:13:46 +11:00
Michał Kępień
7289896043 Merge branch 'rhbz/fedora/2032704' into 'main'
Avoid conflict with ldap_connect function of openldap

See merge request isc-projects/bind9!5665
2021-12-22 21:14:22 +00:00
Petr Mensik
7bce3e7791 Change all internal functions to dlz_ldap prefix
To prevent any conflict in the future, avoid ldap_ prefix in any
internal functions. Keep it reserved for openldap only.
2021-12-22 22:10:05 +01:00
Petr Mensik
49e523e56f Avoid conflict with ldap_connect function of openldap
ldap_connect is defined by OpenLDAP 2.6. Compiler complains there are
conflicting declarations. Use dlz_ldap prefix instead of ldap to avoid
conflict.
2021-12-22 22:10:05 +01:00
Michał Kępień
43d300ddaf Merge branch '2723-add-SSLKEYLOGFILE-support' into 'main'
Add SSLKEYLOGFILE support

Closes #2723

See merge request isc-projects/bind9!5661
2021-12-22 20:08:46 +00:00
Michał Kępień
35eca53647 Add CHANGES entry for GL #2723 2021-12-22 18:17:26 +01:00
Michał Kępień
9c7c48600a Add release note for GL #2723 2021-12-22 18:17:26 +01:00
Michał Kępień
e65f9b60dd Document SSLKEYLOGFILE handling
Add a section to the ARM explaining how to set the SSLKEYLOGFILE
environment variable in order to prepare a key log file for debugging
purposes.
2021-12-22 18:17:26 +01:00
Michał Kępień
9e81903171 Set up default logging for SSLKEYLOGFILE
A customary method of exporting TLS pre-master secrets used by a piece
of software (for debugging purposes, e.g. to examine decrypted traffic
in a packet sniffer) is to set the SSLKEYLOGFILE environment variable to
the path to the file in which this data should be logged.

In order to enable writing any data to a file using the logging
framework provided by libisc, a logging channel needs to be defined and
the relevant logging category needs to be associated with it.  Since the
SSLKEYLOGFILE variable is only expected to contain a path, some defaults
for the logging channel need to be assumed.  Add a new function,
named_log_setdefaultsslkeylogfile(), for setting up those implicit
defaults, which are equivalent to the following logging configuration:

    channel default_sslkeylogfile {
        file "${SSLKEYLOGFILE}" versions 10 size 100m suffix timestamp;
    };

    category sslkeylog {
    	default_sslkeylogfile;
    };

This ensures TLS pre-master secrets do not use up more than about 1 GB
of disk space, which should be enough to hold debugging data for the
most recent 1 million TLS connections.

As these values are arguably not universally appropriate for all
deployment environments, a way for overriding them needs to exist.
Suppress creation of the default logging channel for TLS pre-master
secrets when the SSLKEYLOGFILE variable is set to the string "config".
This enables providing custom logging configuration for the relevant
category via the "logging" stanza.  (Note that it would have been
simpler to only skip setting up the default logging channel for TLS
pre-master secrets if the SSLKEYLOGFILE environment variable is not set
at all.  However, libisc only logs pre-master secrets if that variable
is set.  Detecting a "magic" string enables the SSLKEYLOGFILE
environment variable to serve as a single control for both enabling TLS
pre-master secret collection and potentially also indicating where and
how they should be exported.)
2021-12-22 18:17:26 +01:00
Michał Kępień
7983d5fa7c Check for SSL_CTX_set_keylog_callback() support
The SSL_CTX_set_keylog_callback() function is a fairly recent OpenSSL
addition, having first appeared in version 1.1.1.  Add a configure.ac
check for the availability of that function to prevent build errors on
older platforms.  Sort similar checks alphabetically.

This makes the SSLKEYLOGFILE mechanism a silent no-op on unsupported
platforms, which is considered acceptable for a debugging feature.
2021-12-22 18:17:26 +01:00
Michał Kępień
060fed3097 Log TLS pre-master secrets when requested
Generate log messages containing TLS pre-master secrets when the
SSLKEYLOGFILE environment variable is set.  This only ensures such
messages are prepared using the right logging category and passed to
libisc for further processing.

The TLS pre-master secret logging callback needs to be set on a
per-context basis, so ensure it happens for both client-side and
server-side TLS contexts.
2021-12-22 18:17:26 +01:00
Michał Kępień
3081bda798 Add a logging category for TLS pre-master secrets
TLS pre-master secrets will be dumped to disk using the logging
framework provided by libisc.  Add a new logging category for this type
of debugging data in order to enable exporting it to a dedicated
channel.  Derive the name of the new category from the name of the
relevant environment variable, SSLKEYLOGFILE.
2021-12-22 18:17:26 +01:00
Michal Nowak
d7c5d09123 Merge branch 'mnowak/respdiff-job-dependency-fix' into 'main'
Execute respdiff jobs out-of-order

See merge request isc-projects/bind9!5664
2021-12-22 14:18:44 +00:00
Michal Nowak
87578efc71 Execute respdiff jobs out-of-order
Commit 2ececf2c dropped dependency of "respdiff" and
"respdiff-third-party" jobs on "tarball-create" job because these jobs
don't need to depend on in (e.g., for its artifacts). This, however,
caused that respdiff jobs weren't started out-of-order and artifacts
from all the "Build" stage jobs plus "unit:gcc:buster:amd64" job were
downloaded to project directory and caused problems with compilation:

Originally, the dependency on "tarball-create" has been added in
04f8b65a to indicate that respdiff "is meant to operate on two different
BIND versions". It seems that the intent didn't work out, and we better
make it obvious that respdiff jobs don't depend on any other job and
should be run out-of-order.
2021-12-22 14:44:51 +01:00
Michal Nowak
077f024c14 Merge branch 'mnowak/freebsd-12.3' into 'main'
Add FreeBSD 12.3

See merge request isc-projects/bind9!5619
2021-12-20 15:58:38 +00:00
Michal Nowak
a4d8571fa2 Add FreeBSD 12.3 2021-12-20 13:59:04 +01:00
Artem Boldariev
1413217fda Merge branch 'artem-doth-reconfig-fix' into 'main'
Fix flakiness in the doth reconfig test

See merge request isc-projects/bind9!5656
2021-12-20 12:46:44 +00:00
Artem Boldariev
84b2141e69 doth system test: reduce number of contexts in ns3
This commit removes unused listen-on statements from the ns3 instance
in order to reduce the startup time. That should help with occasional
system test initialisation hiccups in the CI which happen because the
required instances cannot initialise in time.
2021-12-20 14:28:53 +02:00
Artem Boldariev
2e5f9a0df5 Fix flakiness in the doth reconfig test
Due to the fact that the primary nameserver creates a lot of TLS
contexts, its reconfiguration could take too much time on the CI,
leading to spurious test failures, while in reality it works just
fine.

This commit adds a separate instance for this test which does not use
ephemeral keys (these are costly to generate) and creates minimal
amount of TLS contexts.
2021-12-20 14:28:53 +02:00
Arаm Sаrgsyаn
0ad79ab51c Merge branch '2264-tls-ephemeral-rsa-to-ecc' into 'main'
Use ECDSA P-256 instead of 4096-bit RSA for 'tls ephemeral'

Closes #2264

See merge request isc-projects/bind9!5627
2021-12-20 12:10:42 +00:00
Aram Sargsyan
7ae4bc7710 Add CHANGES for [GL #2264] 2021-12-20 10:09:40 +00:00
Aram Sargsyan
5d87725fdc Use ECDSA P-256 instead of 4096-bit RSA for 'tls ephemeral'
ECDSA P-256 performs considerably better than the previously used
4096-bit RSA (can be observed using `openssl speed`), and, according
to RFC 6605, provides a security level comparable to 3072-bit RSA.
2021-12-20 10:09:05 +00:00
Michal Nowak
4a33c43d1f Merge branch 'mnowak/add-fedora-35' into 'main'
Add Fedora 35

See merge request isc-projects/bind9!5554
2021-12-17 14:37:56 +00:00
Michal Nowak
668be42965 Add Fedora 35 2021-12-17 15:34:46 +01:00
Ondřej Surý
cbfd092f0d Merge branch 'ondrej/simplify-address-sanitizer-use-in-mem.c' into 'main'
Simplify Address Sanitizer tweaks in mem.c

See merge request isc-projects/bind9!5643
2021-12-17 14:25:54 +00:00
Ondřej Surý
ee1f8b60c5 Simplify Address Sanitizer tweaks in mem.c
Previously, whole isc_mempool_get() and isc_mempool_set() would be
replaced by simpler version when run with address sanitizer.

Change the code to limit the fillcount to 1 and freemax to 0.  This
change will make isc_mempool_get() to always allocate and use a single
new item and isc_mempool_put() will always return the item to the
allocator.
2021-12-17 14:43:05 +01:00
Michal Nowak
88bce03b93 Merge branch 'mnowak/drop-freebsd-11' into 'main'
Drop FreeBSD 11

See merge request isc-projects/bind9!5606
2021-12-17 11:48:34 +00:00
Michal Nowak
981579f379 Drop FreeBSD 11
Support for FreeBSD 11.4, the last FreeBSD 11.x release, ended on
September 30, 2021.

The "--with-readline" ./configure option has been added to gcc:sid:amd64
CI job; otherwise, it would be lost with the FreeBSD 11 removal.

Link: https://www.freebsd.org/security/unsupported/
2021-12-17 12:40:48 +01:00
Mark Andrews
7020e2b457 Merge branch '3057-evp_digestsignfinal-needs-the-buffer-length-passed-in' into 'main'
Resolve "EVP_DigestSignFinal needs the buffer length passed in"

Closes #3057

See merge request isc-projects/bind9!5642
2021-12-17 10:27:41 +00:00
Mark Andrews
7b4bff7947 Add CHANGES for [GL #3057] 2021-12-17 20:31:35 +11:00
Mark Andrews
a23507c4fa Pass the digest buffer length to EVP_DigestSignFinal
OpenSSL 3.0.1 does not accept 0 as a digest buffer length when
calling EVP_DigestSignFinal as it now checks that the digest buffer
length is large enough for the digest.  Pass the digest buffer
length instead.
2021-12-17 20:28:01 +11:00
Michal Nowak
9e77e51f72 Merge branch 'mnowak/alpine-3.15' into 'main'
Add Alpine Linux 3.15

See merge request isc-projects/bind9!5595
2021-12-16 15:52:18 +00:00
Michal Nowak
d43127a387 Add Alpine Linux 3.15 2021-12-16 16:43:00 +01:00
Petr Špaček
102c77d6ec Merge branch 'pspacek/ci-api-triggers' into 'main'
Enable regular pipeline jobs to be triggered from Gitlab API

See merge request isc-projects/bind9!5648
2021-12-16 15:00:29 +00:00
Petr Špaček
eb8c8753ad Enable regular pipeline jobs to be triggered from Gitlab API 2021-12-16 15:55:07 +01:00
Petr Špaček
5039a636f0 Merge branch 'v9_17_21-release' into 'main'
Merge 9.17.21 release branch

See merge request isc-projects/bind9!5644
2021-12-16 12:22:45 +00:00
Petr Špaček
3c21d8d499 Set up release notes for BIND 9.17.22 2021-12-16 13:17:13 +01:00
Petr Špaček
c0c023c49a Update BIND version to 9.17.21 2021-12-16 13:17:13 +01:00
Petr Špaček
884d86e754 Add a CHANGES marker 2021-12-16 13:17:13 +01:00
Petr Špaček
e7e18792ba Merge branch 'michal/prepare-documentation-for-bind-9.17.21' into 'v9_17_21-release'
Prepare documentation for BIND 9.17.21

See merge request isc-private/bind9!338
2021-12-16 13:17:12 +01:00
Michał Kępień
7d42bee183 Prepare release notes for BIND 9.17.21 2021-12-16 13:17:12 +01:00
Michał Kępień
513dfd4fcc Reorder release notes 2021-12-16 13:17:12 +01:00
Michał Kępień
a8d5fd88e3 Mention GL #3040 in the release notes 2021-12-16 13:17:12 +01:00