2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-28 21:17:54 +00:00

367 Commits

Author SHA1 Message Date
Tom Krizek
27281955af
Use prereq.sh for statschannel system test 2023-09-19 14:47:48 +02:00
Michal Nowak
ee46748eea Update BIND version to 9.19.18-dev 2023-09-12 08:11:52 +02:00
Ondřej Surý
2e99dcefa8
Print the used jemalloc version in autoconf and named -V output
The autoconf and named -V now prints used version of jemalloc.  This
doesn't work with system supplied jemalloc, so in it prints `system`
instead in the autoconf and nothing in named -V output.
2023-09-05 18:47:21 +02:00
Ondřej Surý
784d055809
Add support for User Statically Defined Tracing (USDT) probes
This adds support for User Statically Defined Tracing (USDT).  On
Linux, this uses the header from SystemTap and dtrace utility, but the
support is universal as long as dtrace is available.

Also add the required infrastructure to add probes to libisc, libdns and
libns libraries, where most of the probes will be.
2023-08-21 18:39:53 +02:00
Michał Kępień
7fffb66891
Update BIND version to 9.19.17-dev 2023-08-07 10:23:55 +02:00
Ondřej Surý
4dacdde28f
Refactor dns_badcache to use cds_lfht lock-free hashtable
The dns_badcache unit had (yet another) own locked hashtable
implementation.  Replace the hashtable used by dns_badcache with
lock-free cds_lfht implementation from liburcu.
2023-07-31 15:51:15 +02:00
Tom Krizek
46e917a55e Update BIND version to 9.19.16-dev 2023-07-10 15:08:50 +02:00
Michal Nowak
8f6e77aee9
Update BIND version to 9.19.15-dev 2023-06-12 16:12:27 +02:00
Ondřej Surý
920dddb729
Print the libuv, liburcu and OpenSSL versions from configure script
The configure summary now prints versions of the mandatory libraries
found when configuring.
2023-06-06 12:42:02 +02:00
Ondřej Surý
f760ee3f8c
Disable URCU inlining if inlined rcu_dereference() fails to compile
In some cases, the inlined version rcu_dereference() would not compile
when working on pointer to opaque struct (namely Ubuntu Jammy).  Detect
such condition in the autoconf and disable the inlining of the small
functions if it breaks the build.
2023-06-01 16:51:38 +02:00
Ondřej Surý
051f3d612f
Remove obsolete epoll/kqueue/devpoll configure options
Since we don't use networking directly but rather via libuv, these
configure options were no-op.  Remove the configure checks for epoll
(Linux), kqueue (BSDs) and /dev/poll (Solaris).
2023-05-29 07:44:24 +02:00
Tom Krizek
4dbe8e5347
Invoke pytest runner from run.sh
Utilize developers' muscle memory to incentivize using the pytest runner
instead of the legacy one. The script also serves as basic examples of
how to run the pyest command to achieve the same results as the legacy
runner.

Invoking pytest directly should be the end goal, since it offers many
potentially useful options (refer to pytest --help).
2023-05-22 14:11:39 +02:00
Ondřej Surý
fd3522c37b
Add Userspace-RCU to global CFLAGS and LIBS
The Userspace-RCU headers are now needed for more parts of the libisc
and libdns, thus we need to add it globally to prevent compilation
failures on systems with non-standard Userspace-RCU installation path.
2023-05-12 14:16:25 +02:00
Ondřej Surý
7220851f67
Replace glue_cache hashtable with direct link in rdatasetheader
Instead of having a global hashtable with a global rwlock for the GLUE
cache, move the glue_list directly into rdatasetheader and use
Userspace-RCU to update the pointer when the glue_list is empty.

Additionally, the cached glue_lists needs to be stored in the RBTDB
version for early cleaning, otherwise the circular dependencies between
nodes and glue_lists will prevent nodes to be ever cleaned up.
2023-05-12 13:25:39 +02:00
Michał Kępień
41b54fa66e
Update BIND version to 9.19.14-dev 2023-05-10 10:41:42 +02:00
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
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ý
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
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ý
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
Petr Špaček
923eb6667f
Update BIND version to 9.19.13-dev 2023-04-14 10:51:44 +02:00
Michal Nowak
a1bd31cbae
Revert "Enable FIPS testing in Pairwise"
This reverts commit e987a0c249882af0395409310b32fce7fc997015.

--enable-fips-mode ./configure option does not work on platforms without
FIPS-enabled OpenSSL.
2023-04-05 09:20:17 +02:00
Mark Andrews
da999a7a1b Define and use DLOPEN_LIBS 2023-04-03 13:31:56 +00:00
Tony Finch
82213a48cf Add isc_histo for histogram statistics
This is an adaptation of my `hg64` experiments for use in BIND.

As well as renaming everything according to ISC style, I have
written some more extensive tests that ensure the edge cases are
correct and the fenceposts are in the right places.

I have added utility functions for working with precision in terms of
decimal significant figures as well as this code's native binary.
2023-04-03 12:08:05 +01:00
Mark Andrews
6e64ec2af4 Detect if FIPS mode is configured at the OS level
Always look for FIPS_mode and EVP_default_properties_enable_fips
rather than just when requested by --enable-fips.
2023-04-03 12:04:58 +10:00
Mark Andrews
7aa9b80f83 Probe for EVP_default_properties_enable_fips
FIPS_mode is not available in OpenSSL 3.0.0
2023-04-03 12:04:58 +10:00
Evan Hunt
c774aed465 add --enable-fips-mode to configure summary
Report when FIPS mode is enabled or disabled in the configure
summary output.
2023-04-03 12:04:58 +10:00
Michal Nowak
e987a0c249 Enable FIPS testing in Pairwise
It's useful to configure and build with FIPS mode in Pairwise testing
because it exposes some parts of the code otherwise hiden.
2023-04-03 12:04:58 +10:00
Michal Nowak
1dcfe6bfbd
Replace enable_dnsprs_dl with enable_dnsrps_dl
"enable_dnsprs_dl" is a typo where "enable_dnsrps_dl" was intended.
2023-03-30 19:44:34 +02:00
Evan Hunt
bed8f85ff2 import libdummyrpz test library for DNSRPS
libdummyrpz is a limited version of the fastrpz library for use in
testing the dnsrps API.
2023-03-28 15:44:31 -07:00
Evan Hunt
f2855cb664 allow configuration of dnsrps library path
for testing purposes, we need to be able to specify a library path from
which to load the dnsrps implementation. this can now be done with the
"dnsrps-library" option.

DNSRPS can now be enabled in configure regardless of whether librpz.so
is currently installed on the system.
2023-03-28 15:44:31 -07:00
Ondřej Surý
2532b558b4
Build with liburcu, Userspace RCU
BIND needs a collection of standard lock-free data structures,
which we can find in liburcu, along with its RCU safe memory
reclamation machinery. We will use liburcu's QSBR variant instead
of the home-grown isc_qsbr.
2023-03-10 17:31:28 +01:00
Ondřej Surý
bd4576b3ce Remove TKEY Mode 2 (Diffie-Hellman)
Completely remove the TKEY Mode 2 (Diffie-Hellman Exchanged Keying) from
BIND 9 (from named, named.conf and all the tools).  The TKEY usage is
fringe at best and in all known cases, GSSAPI is being used as it should.

The draft-eastlake-dnsop-rfc2930bis-tkey specifies that:

    4.2 Diffie-Hellman Exchanged Keying (Deprecated)

       The use of this mode (#2) is NOT RECOMMENDED for the following two
       reasons but the specification is still included in Appendix A in case
       an implementation is needed for compatibility with old TKEY
       implementations. See Section 4.6 on ECDH Exchanged Keying.

          The mixing function used does not meet current cryptographic
          standards because it uses MD5 [RFC6151].

          RSA keys must be excessively long to achieve levels of security
          required by current standards.

We might optionally implement Elliptic Curve Diffie-Hellman (ECDH) key
exchange mode 6 if the draft ever reaches the RFC status.  Meanwhile the
insecure DH mode needs to be removed.
2023-03-08 08:36:25 +01:00
Tom Krizek
ddd337f541
Update BIND version to 9.19.12-dev 2023-03-07 14:09:54 +01:00
Tony Finch
330ff06d4a Move irs_resconf into libdns and remove libirs
`libirs` used to be a reference implementation of `getaddrinfo` and
related modern resolver APIs. It was stripped down in BIND 9.18
leaving only the `irs_resconf` module, which parses
`/etc/resolv.conf`. I have kept its include path and namespace prefix,
so it remains a little fragment of libirs now embedded in libdns.
2023-02-24 09:38:59 +00:00
Tony Finch
4da9c582b8 Remove libbind9
It is now empty.
2023-02-21 13:12:26 +00:00
Tony Finch
b0377f798f Avoid redefining _FORTIFY_SOURCE
Some compilers have a built-in definition of the _FORTIFY_SOURCE macro
that differs from BIND's preferred setting. This causes errors like
the one quoted below. The solution is to undefine the macro before
defining it. A similar fix was recently committed to glibc.

    <command line>: error: '_FORTIFY_SOURCE' macro redefined
    #define _FORTIFY_SOURCE 2
            ^
    <built-in>: note: previous definition is here
    #define _FORTIFY_SOURCE 0
	    ^

https://sourceware.org/git/glibc.git/commitdiff/35bcb08eaa953c9b
2023-02-16 13:43:40 +00:00
Tony Finch
436b76bb17 Improve the spinloop pause / yield hint
Unfortunately, C still lacks a standard function for pause (x86,
sparc) or yeild (arm) instructions, for use in spin lock or CAS loops.
BIND has its own based on vendor intrinsics or inline asm.

Previously, it was buried in the `isc_rwlock` implementation. This
commit renames `isc_rwlock_pause()` to `isc_pause()` and moves
it into <isc/pause.h>.

This commit also fixes the configure script so that it detects ARM
yield support on systems that identify as `aarch*` instead of `arm*`.

On 64-bit ARM systems we now use the ISB (instruction synchronization
barrier) instruction in preference to yield. The ISB instruction
pauses the CPU for longer, several nanoseconds, which is more like the
x86 pause instruction. There are more details in a Rust pull request,
which also refers to MySQL making the same change:
https://github.com/rust-lang/rust/pull/84725
2023-02-14 17:13:24 +00:00
Petr Špaček
9110465194
Remove pregenerated manpages from the repo
We don't need them in the repo, it's sufficient if we pregenerate them
while preparing the tarball.  That way we don't have overhead while
modifying them but they are still available for installations without
Sphinx.

I assume that this will make rebases and cherry-picks across branches
easier, with less trial and error churn required in the CI.

It's implemented in the way that we build the manpages only when we
either have pregenerated pages available at the configure time or
sphinx-build is installed and working.
2023-02-10 11:24:03 +01:00
Ondřej Surý
251f411fc3 Avoid libuv 1.35 and 1.36 that have broken recvmmsg implementation
The implementation of UDP recvmmsg in libuv 1.35 and 1.36 is
incomplete and could cause assertion failure under certain
circumstances.

Modify the configure and runtime checks to report a fatal error when
trying to compile or run with the affected versions.
2023-02-09 15:04:52 +01:00
Ondřej Surý
baced007af
Require C11 Atomic Operations via <stdatomic.h>
Make the C11 Atomic Operations mandatory and drop the Gcc __atomic
builtin shims.
2023-02-08 21:33:23 +01:00
Ondřej Surý
1c456c0284
Require C11 thread_local keyword and <threads.h> header
Change the autoconf check to require C11 <threads.h> header and
thread_local keyword.
2023-02-08 21:33:23 +01:00
Michal Nowak
8965002255
Update BIND version to 9.19.11-dev 2023-02-07 10:22:26 +01:00
Michał Kępień
e688ca5316 Add DNSRPS builds to pairwise testing
The --enable-dnsrps-dl switch for ./configure enables preparing a
DNSRPS-enabled build of BIND 9 that is not directly linked against a
DNSRPS provider library (dlopen() at runtime is used instead).  Employ
this switch to test DNSRPS-enabled builds in the pairwise testing job in
GitLab CI.
2023-02-01 11:22:59 +01:00
Michał Kępień
2f39be23b1 Update BIND version to 9.19.10-dev 2023-01-13 15:35:32 +01:00
Ondřej Surý
d07c4a98da Prefer the pthread_barrier implementation over uv_barrier
Prefer the pthread_barrier implementation on platforms where it is
available over uv_barrier implementation.  This also solves the problem
with thread sanitizer builds on macOS that doesn't have pthread barrier.
2023-01-11 09:51:02 +01:00
Timo Teräs
c8bcf3a34e
Refactor OpenSSL RSA exponent bits checking to a helper function
- Make it a separate opensslrsa_check_exponent_bits() function to
  clean up the code a bit
- Always use provider API first if using openssl 3.0, and fallback
  to EVP API for older openssl or if built with engine support
- Use RSA_get0_key() (with shim for openssl 1.0) to avoid memory
  allocations
2023-01-09 14:58:55 +01:00
Tom Krizek
38a9338fe4
Update BIND version to 9.19.9-dev 2022-12-13 16:44:52 +01:00
Petr Špaček
5ec272007d
Fix configure --disable-doh help text
This is technically fixup for 2bb454182bb499990e191e098a8a33082c672a94.

Related: !4926
2022-12-08 10:48:24 +01:00
Ondřej Surý
0bf7014f85
Remove the last remnants of --with-tuning=large
The small/large tuning has been completely removed from the code with
last remnant of the dead code in ns_interfacemgr.  Remove the dead code
and the configure option.
2022-11-14 10:01:20 +01:00