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

37123 Commits

Author SHA1 Message Date
Mark Andrews
73cc9a3232 Merge branch 'bug/main/sha1-disabled-fedora-rhbz2122841' into 'main'
Engine pkcs11 cannot work with OSSL_PARAM on OpenSSL 3.0

See merge request isc-projects/bind9!6711
2022-09-23 03:50:50 +00:00
Mark Andrews
e27b063f67 Add release note for [GL !6711] 2022-09-23 13:18:29 +10:00
Mark Andrews
54916b4e45 Add a CHANGES note for [GL !6711] 2022-09-23 13:18:28 +10:00
Mark Andrews
979062ee5d Report how named was built 2022-09-23 13:17:55 +10:00
Mark Andrews
9b13dd7b4d Build against OpenSSL 3.0 in OpenSSL 1.1.0 compatibility mode 2022-09-23 13:17:55 +10:00
Michal Nowak
3dec2deebc Let Debian sid image leverage PKCS#11 with OpenSSL 3 2022-09-23 13:17:55 +10:00
Mark Andrews
6d668b8c34 Update reference to point to doc/arm/build.inc.rst 2022-09-23 13:17:55 +10:00
Mark Andrews
f32c52c5ca Document -DOPENSSL_API_COMPAT=10100 in OPTIONS.md 2022-09-23 13:17:55 +10:00
Petr Menšík
6c55ea17c6 Remove engine related parts for OpenSSL 3.0
OpenSSL just cannot work with mixing ENGINE_* api mixed with OSSL_PARAM
builders. But it can be built in legacy mode, where deprecated but still
working API would be used.

It can work under OpenSSL 3.0, but only if using legacy code paths
matching OpenSSL 1.1 calls and functions.

Remove fromlabel processing by OpenSSL 3.0 only functions. They can
return later with a proper provider support for pkcs11.
2022-09-23 13:17:55 +10:00
Petr Menšík
f92950bb64 Do not use OSSL_PARAM when engine API is compiled
OpenSSL has deprecated many things in version 3.0. If pkcs11 engine
should work then no builder from OpenSSL 3.0 API can be used.

Allow switching to OpenSSL 1.1 like calls even on OpenSSL 3.0 when
OPENSSL_API_COMPAT=10100 is defined. It would still compile and allow
working keys loading from the engine passed on command line.
2022-09-23 13:17:53 +10:00
Petr Menšík
71a8f1e7cd Add ENGINE_init and ENGINE_finish calls
According to manual page of ENGINE_init, it should be called explicitly
before any key operations happens. Make it active whole lifetime.
2022-09-23 13:15:16 +10:00
Petr Špaček
5bfec15ad4 Merge branch 'pspacek/fix-out-of-tree-junit' into 'main'
Improve JUnit test status generator for Gitlab CI

See merge request isc-projects/bind9!6166
2022-09-22 14:16:05 +00:00
Petr Špaček
8d095550a8 Unify Python interpreter used by TSAN and JUnit helpers
Reportedly we don't have python2-enabled TSAN builds, so we can remove
one more hardcoded python3 call from .gitlab-ci.yaml.
2022-09-22 15:20:26 +02:00
Petr Špaček
c46ad4aec2 Fix JUnit test status generator for out-of-tree system tests
- Use separate paths for tests results and test script
- For tarball tests include the conversion script in the `make dist`
2022-09-22 15:20:23 +02:00
Ondřej Surý
e5ff78dfbd Merge branch 'ondrej-loopmgr-cleanup-tcp-implementation' into 'main'
Cleanup the asychronous code in the TCP implementation

See merge request isc-projects/bind9!6703
2022-09-22 12:58:32 +00:00
Ondřej Surý
fffd444440 Cleanup the asychronous code in the stream implementations
After the loopmgr work has been merged, we can now cleanup the TCP and
TLS protocols a little bit, because there are stronger guarantees that
the sockets will be kept on the respective loops/threads.  We only need
asynchronous call for listening sockets (start, stop) and reading from
the TCP (because the isc_nm_read() might be called from read callback
again.

This commit does the following changes (they are intertwined together):

1. Cleanup most of the asynchronous events in the TCP code, and add
   comments for the events that needs to be kept asynchronous.

2. Remove isc_nm_resumeread() from the netmgr API, and replace
   isc_nm_resumeread() calls with existing isc_nm_read() calls.

3. Remove isc_nm_pauseread() from the netmgr API, and replace
   isc_nm_pauseread() calls with a new isc_nm_read_stop() call.

4. Disable the isc_nm_cancelread() for the streaming protocols, only the
   datagram-like protocols can use isc_nm_cancelread().

5. Add isc_nmhandle_close() that can be used to shutdown the socket
  earlier than after the last detach.  Formerly, the socket would be
  closed only after all reading and sending would be finished and the
  last reference would be detached.  The new isc_nmhandle_close() can
  be used to close the underlying socket earlier, so all the other
  asynchronous calls would call their respective callbacks immediately.

Co-authored-by: Ondřej Surý <ondrej@isc.org>
Co-authored-by: Artem Boldariev <artem@isc.org>
2022-09-22 14:51:15 +02:00
Michał Kępień
62813df44b Merge branch '1967-prevent-generating-broken-glueless-referrals' into 'main'
Prevent generating broken glueless referrals

Closes #1967

See merge request isc-projects/bind9!4122
2022-09-22 12:23:22 +00:00
Michał Kępień
07721836a4 Add CHANGES and release notes for [GL #1967] 2022-09-22 14:03:17 +02:00
Michał Kępień
68a004501a Ensure required cached glue is rendered
When looking for required glue, dns_message_rendersection() only
processes the first rdataset associated with the first name added to the
ADDITIONAL section.  If the DNS_RDATASETATTR_REQUIRED attribute is set
for an rdataset which is located somewhere else (i.e. the name it is
associated with is preceded by another name in the ADDITIONAL section),
it will not be honored, i.e. the TC bit will not be set even if the
rdataset does not fit into the response.

Check the attributes of each processed rdataset while appending names to
a referral response based on a glue cache entry.  If a given rdataset is
marked with DNS_RDATASETATTR_REQUIRED, make sure the name it is
associated with is added to the response at the beginning of the
ADDITIONAL section, not its end.

Note that using ISC_LIST_PREPEND() instead of ISC_LIST_APPEND() is not
necessary when associating the rdataset with its owner name because the
dns_name_t structures are initialized just before the glue rdatasets are
associated with them and therefore they are empty at that point, which
means no other (non-required) rdataset can precede the glue rdatasets
within the dns_name_t structure owning them.
2022-09-22 14:03:17 +02:00
Michał Kępień
d977eae211 Mark required glue during glue cache processing
If an NS RRset at the parent side of a delegation point only contains
in-bailiwick NS records, at least one glue record should be included in
every referral response sent for such a delegation point or else clients
will need to send follow-up queries in order to determine name server
addresses.  In certain edge cases (when the total size of a referral
response without glue records was just below to the UDP packet size
limit), named failed to adhere to that rule by sending non-truncated,
glueless referral responses.

Fix the problem by marking all in-bailiwick NS records processed by
glue_nsdname_cb() (the dns_rdataset_additionaldata() callback used by
RBTDB code while iterating over an NS RRset when dns_rdataset_addglue()
is called) with the DNS_RDATASETATTR_REQUIRED flag.  Note that for
simplicity, glue RRsets for all in-bailiwick NS records are marked this
way, even though dns_message_rendersection() only checks the attributes
for the first rdataset associated with the first name added to the
ADDITIONAL section.
2022-09-22 14:03:17 +02:00
Michał Kępień
1814349374 Add tests for broken glueless referrals
If an NS RRset at the parent side of a delegation point only contains
in-bailiwick NS records, at least one glue record should be included in
every referral response sent for such a delegation point or else clients
will need to send follow-up queries in order to determine name server
addresses.  In certain edge cases (when the total size of a referral
response without glue records was just below to the UDP packet size
limit), named failed to adhere to that rule by sending non-truncated,
glueless referral responses.

Add tests attempting to trigger that bug in several different scenarios,
covering all possible combinations of the following factors:

  - type of zone (signed, unsigned),
  - glue record type (A, AAAA, both).
2022-09-22 14:03:17 +02:00
Michał Kępień
791d26b99e Clean up the "glue" system test
Bring the "glue" system test up to speed with other system tests: add
check numbering, ensure test artifacts are preserved upon failure,
improve error reporting, make the test fail upon unexpected errors,
address ShellCheck warnings.
2022-09-22 14:03:17 +02:00
Tony Finch
ea57da8717 Merge branch '3548-without-system-jemalloc' into 'main'
A more helpful error when --without-jemalloc is impossible

Closes #3548

See merge request isc-projects/bind9!6796
2022-09-22 08:40:02 +00:00
Tony Finch
f0e79458be A more helpful error when --without-jemalloc is impossible
When jemalloc is the system allocator (on FreeBSD and NetBSD), trying
to build --without-jemalloc caused an obscure compiler error. Instead,
complain at configure time that --without-jemalloc cannot work. (It
needs to remain an error because it is vexing when configure quietly
ignores an explicit direction.)
2022-09-22 08:39:47 +00:00
Ondřej Surý
c7e2263ec0 Merge branch '3202-convert-isc_timer-to-use-uv_loop' into 'main'
Resolve "Convert the isc_timer API to use isc_nm loops"

Closes #3202 and #3532

See merge request isc-projects/bind9!6763
2022-09-22 08:21:35 +00:00
Ondřej Surý
e2043768b6 Add CHANGES note for [GL #3202] 2022-09-22 09:46:25 +02:00
Ondřej Surý
8d7f173e7c Add more unit tests for isc_timer
Add more tests that deal with rescheduling and restarting the existing
timer and measure that the timer fired at the expected intervals.
2022-09-22 09:46:25 +02:00
Ondřej Surý
6797ca49cf Wait for the telemetry check to finish
Instead of expecting that telemetry check has already finished,
wait for it for maximum of three seconds, because named is run with
-tat=3, so the telemetry check must happen with 3 second window.

Co-authored-by: Evan Hunt <each@isc.org>
2022-09-22 09:45:54 +02:00
Ondřej Surý
5319d4f6c5 Require isc_timer to be manipulated on the timer loop
Each isc_timer needs to be created, started and destroyed on the current
loop.  The isc_timer_stop() can be run on any loop, but when run from
different loop than the one associated with the timer, the request to
stop the timer will be recorded in atomic variable and the underlying
uv_timer_t will be stopped on next uv_timer_t callback call.  This
allows any thread to stop the timer.
2022-09-21 14:25:33 -07:00
Ondřej Surý
5a473b305d Create the negative trust anchor timer on the current loop
Instead of always creating the trust anchor timer (dns_nta_t) on the
main loop, create the timer on the current loop and associate each
dns_nta_t object to the loop it was created on.  This simplifies the
timer handling as everything is run on the associated loop.

During the change, the dns_nta_t structure was renamed to dns__nta_t
and changed to be fully internal to the nta.c compilation unit, and the
dns_ntatable_t structure was made opaque.  This required no change to
code using the API as dns_nta_t never had any external users and the
dns_ntatable_t was properly accessed only by using function calls.
2022-09-21 14:25:33 -07:00
Ondřej Surý
a93882b50c Create the response policy zones update timer on demand
Instead of creating the response policy zone deferred update timer when
creating the response policy zone object, create it on demand on the
current loop and destroy it as soon as the timer has finished its job.
There's a side-effect - the processing of the response policy zone
update is now done on the current loop - previously, it was always on
the main loop.
2022-09-21 14:25:33 -07:00
Ondřej Surý
1c7295af46 Create the catalog zones update timer on demand
Instead of creating the catalog zone deferred update timer when creating
the catalog zone object, create it on demand on the current loop and
destroy it as soon as the timer has finished its job.  There's a
side-effect - the processing of the catalog zone update is now done on
the current loop - previously, it was always on the main loop.
2022-09-21 14:25:33 -07:00
Ondřej Surý
a56f9d5061 Create the spillattimer when needed and destroy it early
Instead of creating dns_resolver .spillattimer when the dns_resolver_t
object is created, create it on the current loop as needed and destroy
it as soon as the timer has finished its job.  This avoids the need to
manipulate the timer from a different thread.
2022-09-21 14:25:33 -07:00
Ondřej Surý
f16c46173c Create the fetch context timer on the matching thread
In the dns_resolver API, delay creating the fetch context timer, so it
is created on the thread/loop associated to the fetch context.
2022-09-21 14:25:33 -07:00
Ondřej Surý
76be9a329a Create the zone timers on the zone->loop
Instead of creating the zone timers at the zone creation time (which
could be any thread), create the zone timer from the isc_loop that has
beena assigned to the zone (zone->loop);
2022-09-21 14:25:33 -07:00
Ondřej Surý
869c6d77a2 Convert isc_ratelimiter API to use on-loop timers
In preparation for the on-loop timers, the isc_ratelimiter API was
converted to use the timer on main loop and start and stop the timer
asynchronously on the main loop.
2022-09-21 14:25:33 -07:00
Ondřej Surý
27d1e498b8 Add isc_timer_async_destroy() helper function
As it sometimes happens that the object using isc_timer_t is destroyed
via detaching all the references with no guarantee that the last thread
will be matching thread, add a helper isc_timer_async_destroy() function
that stops the timer and runs the destroy function via isc_async_run()
on the matching thread.
2022-09-21 14:25:33 -07:00
Evan Hunt
3a735998bc Merge branch '3553-httpd-cleanup' into 'main'
additional code cleanups in httpd.c

See merge request isc-projects/bind9!6798
2022-09-21 19:53:50 +00:00
Evan Hunt
4b7248545e additional code cleanups in httpd.c
- use isc_buffer functions when appropriate, rather than converting
  to and from isc_region unnecessarily
- use the zlib total_out value instead of calculating it
- use c99 struct initialization
2022-09-21 11:45:12 -07:00
Tony Finch
7f4889e159 Merge branch 'fanf-random-init-fuzz' into 'main'
Ensure the first random number is non-zero when fuzzing

See merge request isc-projects/bind9!6794
2022-09-21 15:02:04 +00:00
Tony Finch
4b9af22830 Ensure the first random number is non-zero when fuzzing
In fuzzing mode, `isc_random` uses a fixed seed for reproducibility.
The particular seed chosen happened to produce zero as its first
number, however commit bd251de0 introduced an initialization check in
`random_test` that required it to be non-zero. This change adjusts the
seed to avoid spurious test failures.

Also, remove the temporary variable that was used for initialization
because it did not match the type of the thread-local seed array.
2022-09-21 12:47:26 +01:00
Michał Kępień
2ee16067c5 Merge tag 'v9_19_5'
BIND 9.19.5
2022-09-21 13:04:58 +02:00
Arаm Sаrgsyаn
b574904041 Merge branch '3529-tls-transport-support-in-dns_request-and-dns_dispatch' into 'main'
Resolve "Implement TLS transport support for dns_request"

Closes #3529

See merge request isc-projects/bind9!6751
2022-09-19 17:14:18 +00:00
Aram Sargsyan
f113bc8142 Add CHANGES note for [GL #3529] 2022-09-19 16:36:29 +00:00
Aram Sargsyan
91a0595019 Test TLS transport in dispatch_test.c
Add a new check in dispatch_test.c unit test to confirm that sending
and receiving data using TLS transport works.
2022-09-19 16:36:28 +00:00
Aram Sargsyan
90959f6166 Implement TLS transport support for dns_request and dns_dispatch
This change prepares ground for sending DNS requests using DoT,
which, in particular, will be used for forwarding dynamic updates
to TLS-enabled primaries.
2022-09-19 16:36:28 +00:00
Aram Sargsyan
881747218b Convert xfrin.c:get_create_tlsctx() into a library function
In order to make xfrin.c:get_create_tlsctx() reusable, move the function
into transport.c, and make changes into its prototype to not use the
'dns_xfrin_ctx_t' type, thus making it more universal.

This change prepares ground for adding transport support into the
dispatch manager.

Also, move the typedefs for 'dns_transport_t' and 'dns_transport_list_t'
from transport.h into types.h.
2022-09-19 15:50:06 +00:00
Ondřej Surý
1d153a8db4 Merge branch 'ondrej-move-random-number-re-seeding-out-of-the-hot-path' into 'main'
Move random number re-seeding out of the hot path

See merge request isc-projects/bind9!6173
2022-09-19 14:47:38 +00:00
Tony Finch
bd251de035 Move random number re-seeding out of the hot path
Instead of checking if we need to re-seed for every isc_random call,
seed the random number generator in the libisc global initializer
and the per-thread initializer.
2022-09-19 16:27:12 +02:00
Ondřej Surý
de75595575 Merge branch 'ondrej-unsigned-to-unsigned_int' into 'main'
Add semantic patch to use 'unsigned int' instead of 'unsigned'

See merge request isc-projects/bind9!6741
2022-09-19 14:02:00 +00:00