Commit Graph

38981 Commits

Author SHA1 Message Date
Arjun Shankar
5d33446145 configure: Fix __builtin_mul_overflow() compiler support check
`UINT64_C(UINT64_MAX)' is redundant and leads to a compilation error
since UINT64_C involves token concatenation, causing the check to fail.

This change fixes that by using UINT64_MAX directly, and including the
appropriate header.

Signed-off-by: Arjun Shankar <arjun@redhat.com>
2023-05-02 15:48:26 +02:00
Petr Špaček
22329132ad Merge branch 'pspacek/post-release-tweaks' into 'main'
Post release tweaks

See merge request isc-projects/bind9!7840
2023-05-02 13:36:12 +00:00
Petr Špaček
585fde0474 Synchronize Sphinx package version on ReadTheDocs with our CI
Related: isc-projects/images!235
2023-05-02 15:35:29 +02:00
Petr Špaček
406595bcf2 Recommend -S edition rebase before starting out with release 2023-05-02 15:35:29 +02:00
Petr Špaček
302baae5c7 Provide examples and links for steps in release checklist 2023-05-02 15:35:29 +02:00
Petr Špaček
751062da3b Update release comparison scripts with liburcu and new Sphinx 2023-05-02 15:35:25 +02:00
Ondřej Surý
1b0512fa20 Merge branch 'mnowak/pairwise-fix-typo-in-with-liburcu-definition' into 'main'
Fix the typo in --with-liburcu=mb pairwise definition

See merge request isc-projects/bind9!7875
2023-04-28 10:12:38 +00:00
Michal Nowak
40440674b1 Fix the typo in --with-liburcu=mb pairwise definition
It was "ucru," but it should be "urcu". The pairwise CI job fails as a
result with:

    configure: error: unrecognized options: --with-libucru
2023-04-28 09:35:33 +02:00
Ondřej Surý
a80daf0836 Merge branch 'each-fix-mutex-test' into 'main'
fix commit error in mutex_test

See merge request isc-projects/bind9!7874
2023-04-28 05:06:44 +00:00
Evan Hunt
3460fe73e2 fix commit error in mutex_test
when the branch implementing mutex_test was rebased and merged,
a rebasing error was missed: the isc_threadresult and isc_threadarg
types no longer exist.
2023-04-28 02:37:29 +01:00
Ondřej Surý
af5ca782b7 Merge branch 'ondrej/add-isc_mutex-unit-test' into 'main'
Add mutex unit test

See merge request isc-projects/bind9!7858
2023-04-27 11:17:30 +00:00
Ondřej Surý
42c7694dfb Add mutex unit test
Add simple mutex unit test and mutex benchmark.  The benchmark compares
the pthread mutext with isc mutex implementation, so it's mainly useful
when developing a new isc mutex implementation.
2023-04-27 13:15:50 +02:00
Ondřej Surý
5b84a9492d Merge branch 'ondrej-urcu-fixes' into 'main'
Improve the Userspace RCU integration

See merge request isc-projects/bind9!7752
2023-04-27 10:39:51 +00:00
Ondřej Surý
6948060e01 Print out the Userspace-RCU flavor and version
The `named -V` now prints out the liburcu flavor used and the
compile-time version.
2023-04-27 12:38:53 +02:00
Tony Finch
7d1ceaf35d Move per-thread RCU setup into isc_thread
All the per-loop `libuv` setup remains in `isc_loop`, but the per-thread
RCU setup is moved to `isc_thread` alongside the other per-thread setup.
This avoids repeating the per-thread setup for `call_rcu()` helpers,
and explains a little better why some parts of the per-thread setup
is missing for `call_rcu()` helpers.

This also removes the per-loop `call_rcu()` helpers as we refactored the
isc__random_initialize() in the previous commit.
2023-04-27 12:38:53 +02:00
Ondřej Surý
65021dbf52 Move the isc_random API initialization to the thread_local variable
Instead of writing complicated wrappers for every thread, move the
initialization back to isc_random unit and check whether the random seed
was initialized with a thread_local variable.

Ensure that isc_entropy_get() returns a non-zero seed.

This avoids problems with thread sanitizer tests getting stuck in an
infinite loop.
2023-04-27 12:38:53 +02:00
Tony Finch
e0248bf60f Simplify isc_thread a little
Remove the `isc_threadarg_t` and `isc_threadresult_t`
typedefs which were unhelpful disguises for `void *`,
and free the dummy jemalloc allocation sooner.
2023-04-27 12:38:53 +02:00
Tony Finch
06f534fa69 Avoid spurious compilation failures in liburcu headers
When liburcu is not installed from a system package, its headers are
not treated as system headers by the compiler, so BIND's -Werror and
other warning options take effect. The liburcu headers have a lot
of inline functions, some of which do not use all their arguments,
which BIND's build treats as an error.
2023-04-27 12:38:53 +02:00
Ondřej Surý
c2c907d728 Improve the Userspace RCU integration
This commit allows BIND 9 to be compiled with different flavours of
Userspace RCU, and improves the integration between Userspace RCU and
our event loop:

- In the RCU QSBR, the thread is put offline when polling and online
  when rcu_dereference, rcu_assign_pointer (or friends) are called.

- In other RCU modes, we check that we are not reading when reaching the
  quiescent callback in the event loop.

- We register the thread before uv_work_run() callback is called and
  after it has finished.  The rcu_(un)register_thread() has a large
  overhead, but that's fine in this case.
2023-04-27 12:38:53 +02:00
Ondřej Surý
2aaf58a641 Merge branch '4018-use-server-socket-to-log-accept-failures' into 'main'
Use server socket to log TCP accept failures

Closes #4018

See merge request isc-projects/bind9!7851
2023-04-27 10:12:22 +00:00
Ondřej Surý
0bf70cb143 Add CHANGES note for [GL #4018] 2023-04-27 11:08:20 +02:00
Ondřej Surý
58663574b9 Use server socket to log TCP accept failures
The accept_connection() could detach from the child socket on a failure,
so we need to keep and use the server socket for logging the accept
failures.
2023-04-27 11:07:57 +02:00
Ondřej Surý
0f25d62a40 Merge branch '4030-fix-UAF-in-isc_httpd' into 'main'
Fix potential UAF when shutting down isc_httpd

Closes #4030

See merge request isc-projects/bind9!7865
2023-04-25 06:18:02 +00:00
Ondřej Surý
6f0d0c49f9 Add CHANGES note for [GL #4031] 2023-04-25 08:17:10 +02:00
Ondřej Surý
27ad3a65f9 Fix potential UAF when shutting down isc_httpd
Use the ISC_LIST_FOREACH_SAFE() macro to safely walk the running https
and shut them down in a manner safe from deletion.
2023-04-25 08:16:46 +02:00
Ondřej Surý
ae997d9e21 Add ISC_LIST_FOREACH(_SAFE) macros
There's a recurring pattern walking the ISC_LISTs that just repeats over
and over.  Add two macros:

 * ISC_LIST_FOREACH(list, elt, link) - walk the static list
 * ISC_LIST_FOREACH_SAFE(list, elt, link, next) - walk the list in
   a manner that's safe against list member deletions
2023-04-25 08:16:46 +02:00
Mark Andrews
f0c3881a82 Merge branch '4027-nsec3-of-removed-empty-non-terminal-remains-in-chain-breaking-validation-tools' into 'main'
Resolve "NSEC3 of removed empty-non-terminal remains in chain, breaking validation tools"

Closes #4027

See merge request isc-projects/bind9!7857
2023-04-25 05:44:08 +00:00
Mark Andrews
7dbb2b877b Add CHANGES note for [GL #4027] 2023-04-25 05:04:30 +01:00
Mark Andrews
ad91a70d15 Check removal of ENT when subdomains are removed
Empty-non-terminal NSEC records where not always removed when the
delegations generating them where removed via update. Check that
they now are.
2023-04-25 05:03:40 +01:00
Mark Andrews
27160c137f Cleanup orphaned empty-non-terminal NSEC3
When OPTOUT was in use we didn't ensure that NSEC3 records
for orphaned empty-non-terminals where removed.  Check if
there are orphaned empty-non-terminal NSEC3 even if there
wasn't an NSEC3 RRset to be removed in dns_nsec3_delnsec3.
2023-04-25 05:03:12 +01:00
Ondřej Surý
2aff1d6efc Merge branch 'jpmens-main-patch-10650' into 'main'
ARM: replace word in TLS section

See merge request isc-projects/bind9!7864
2023-04-24 15:12:12 +00:00
JP Mens
7bfffa1bd8 Fix typo in the ARM - missed -> missing 2023-04-24 16:09:48 +01:00
Ondřej Surý
b226200529 Merge branch '4004-reimplemented-max-transfer--in' into 'main'
Implement maximum global and idle time for incoming XFR

Closes #4004

See merge request isc-projects/bind9!7810
2023-04-21 11:31:04 +00:00
Ondřej Surý
713e202110 Add CHANGES note for [GL #4004] 2023-04-21 12:53:34 +02:00
Aram Sargsyan
5324f047b2 Implement new checks for the xfer system test
Check the max-transfer-time-in and max-transfer-idle-in options.
2023-04-21 12:53:02 +02:00
Aram Sargsyan
dfaecfd752 Implement new -T options for xfer system tests
'-T transferinsecs' makes named interpret the max-transfer-time-out,
max-transfer-idle-out, max-transfer-time-in and max-transfer-idle-in
configuration options as seconds instead of minutes.

'-T transferslowly' makes named to sleep for one second for every
xfrout message.

'-T transferstuck' makes named to sleep for one minute for every
xfrout message.
2023-04-21 12:53:02 +02:00
Ondřej Surý
d2377f8e04 Implement maximum global and idle time for incoming XFR
After the dns_xfrin was changed to use network manager, the maximum
global (max-transfer-time-in) and idle (max-transfer-idle-in) times for
incoming transfers were turned inoperational because of missing
implementation.

Restore this functionality by implementing the timers for the incoming
transfers.
2023-04-21 12:53:02 +02:00
Ondřej Surý
599ac5bb93 Merge branch '4005-handle-ISC_R_INVALIDPROTO-from-libuv' into 'main'
Handle ISC_R_INVALIDPROTO in the dispatch

Closes #4005

See merge request isc-projects/bind9!7860
2023-04-21 10:43:14 +00:00
Ondřej Surý
c233cd621b Add CHANGES and release note for [GL #4005] 2023-04-21 12:42:28 +02:00
Evan Hunt
2269a3e6fb check for invalid protocol when dispatch fails
treat ISC_R_INVALIDPROTO as a networking error when it occurs.
2023-04-21 12:42:11 +02:00
Evan Hunt
0393b54afb add a result code for ENOPROTOOPT, EPROTONOSUPPORT
there was no isc_result_t value for invalid protocol errors
that could be returned from libuv.
2023-04-21 12:42:10 +02:00
Ondřej Surý
abc2342372 Merge branch '3977-add-isc_spinlock-implementation' into 'main'
Add isc_spinlock unit with shim pthread_spin implementation

Closes #3977

See merge request isc-projects/bind9!7749
2023-04-21 10:10:47 +00:00
Ondřej Surý
ebd9188d42 Add CHANGES note for [GL #3977] 2023-04-21 12:10:02 +02:00
Ondřej Surý
b497e90179 Add isc_spinlock unit with shim pthread_spin implementation
The spinlock is small (atomic_uint_fast32_t at most), lightweight
synchronization primitive and should only be used for short-lived and
most of the time a isc_mutex should be used.

Add a isc_spinlock unit which is either (most of the time) a think
wrapper around pthread_spin API or an efficient shim implementation of
the simple spinlock.
2023-04-21 12:10:02 +02:00
Ondřej Surý
32a8773ab3 Always initialize the workers in the libtest
The workers variable might be needed even to tests not using
loopmgr. Split the workers initialization into setup_workers() function
and always call it from the default main loop.
2023-04-21 09:04:24 +02:00
Ondřej Surý
bd94d8c98e Merge branch '4011-fix-read_stop-in-streaming-protocols' into 'main'
Fix the streaming read callback shutdown logic

Closes #4011

See merge request isc-projects/bind9!7836
2023-04-20 12:03:52 +00:00
Ondřej Surý
9b0353e62e Add CHANGES note for [GL #4011] 2023-04-20 12:58:47 +02:00
Ondřej Surý
3b10814569 Fix the streaming read callback shutdown logic
When shutting down TCP sockets, the read callback calling logic was
flawed, it would call either one less callback or one extra.  Fix the
logic in the way:

1. When isc_nm_read() has been called but isc_nm_read_stop() hasn't on
   the handle, the read callback will be called with ISC_R_CANCELED to
   cancel active reading from the socket/handle.

2. When isc_nm_read() has been called and isc_nm_read_stop() has been
   called on the on the handle, the read callback will be called with
   ISC_R_SHUTTINGDOWN to signal that the dormant (not-reading) socket
   is being shut down.

3. The .reading and .recv_read flags are little bit tricky.  The
   .reading flag indicates if the outer layer is reading the data (that
   would be uv_tcp_t for TCP and isc_nmsocket_t (TCP) for TLSStream),
   the .recv_read flag indicates whether somebody is interested in the
   data read from the socket.

   Usually, you would expect that the .reading should be false when
   .recv_read is false, but it gets even more tricky with TLSStream as
   the TLS protocol might need to read from the socket even when sending
   data.

   Fix the usage of the .recv_read and .reading flags in the TLSStream
   to their true meaning - which mostly consist of using .recv_read
   everywhere and then wrapping isc_nm_read() and isc_nm_read_stop()
   with the .reading flag.

4. The TLS failed read helper has been modified to resemble the TCP code
   as much as possible, clearing and re-setting the .recv_read flag in
   the TCP timeout code has been fixed and .recv_read is now cleared
   when isc_nm_read_stop() has been called on the streaming socket.

5. The use of Network Manager in the named_controlconf, isccc_ccmsg, and
   isc_httpd units have been greatly simplified due to the improved design.

6. More unit tests for TCP and TLS testing the shutdown conditions have
   been added.

Co-authored-by: Ondřej Surý <ondrej@isc.org>
Co-authored-by: Artem Boldariev <artem@isc.org>
2023-04-20 12:58:32 +02:00
Michał Kępień
4fcbb078c1 Merge tag 'v9.19.12'
BIND 9.19.12
2023-04-20 12:43:46 +02:00
Ondřej Surý
654de3201c Merge branch '3986-handle-ISC_R_NOPERM-in-dns_dispatch-and-honour-the-source-port' into 'main'
Honour the source-port when retrying in dns_dispatch

Closes #3986

See merge request isc-projects/bind9!7806
2023-04-20 09:01:49 +00:00