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

38512 Commits

Author SHA1 Message Date
Evan Hunt
106da9c190 refactor dns_request to use loopmgr callbacks
dns_request_create() and _createraw() now take a 'loop' parameter
and run the callback event on the specified loop.

as the task manager is no longer used, it has been removed from
the dns_requestmgr structure.  the dns_resolver_taskmgr() function
is also no longer used and has been removed.
2023-02-16 14:55:06 +01:00
Tony Finch
d3e2b680d0 Merge branch 'fanf-simplify-view-detach' into 'main'
Simplify locking in dns_view_detach()

See merge request isc-projects/bind9!7538
2023-02-16 13:44:28 +00:00
Tony Finch
eb6b31b6f2 Simplify locking in dns_view_detach()
Lock just once, and shut down the resolver, adb, and requestmgr after
unlocking, like the zone table, managed keys zone, and redirect zone.
2023-02-16 13:44:17 +00:00
Tony Finch
97663836ea Merge branch 'fanf-avoid-fortify-source-redefinition' into 'main'
Avoid redefining _FORTIFY_SOURCE

See merge request isc-projects/bind9!7539
2023-02-16 13:43:56 +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
Michal Nowak
3203d6c549 Merge tag 'v9_19_10'
BIND 9.19.10
2023-02-16 13:38:33 +01:00
Mark Andrews
cf002b41b0 Merge branch '3869-dig-fails-to-cleanup-openssl-references' into 'main'
Resolve "Dig fails to cleanup OpenSSL references"

Closes #3869

See merge request isc-projects/bind9!7535
2023-02-16 00:16:49 +00:00
Mark Andrews
e27fc4bbc5 Cleanup OpenSSL reference on bad option
Another exit path that needs to be cleaned up.
2023-02-16 10:55:42 +11:00
Mark Andrews
4c2525c418 Cleanup OpenSSL reference on bad domain name
Free/detach tsigkey and sig0key when exiting and then call
dst_lib_destroy if we have previously called dst_lib_init.  This will,
in theory, allow OPENSSL_cleanup to free all memory.
2023-02-16 10:55:41 +11:00
Tony Finch
997fde6179 Merge branch 'fanf-prune-isc-headers' into 'main'
Remove several do-nothing headers from libisc

See merge request isc-projects/bind9!7464
2023-02-15 16:45:51 +00:00
Tony Finch
9892ac791c Add CHANGES note
[cleanup]	Several nugatory headers have been removed from libisc
2023-02-15 16:44:47 +00:00
Tony Finch
f9c725d7d4 Remove do-nothing header <isc/stat.h>
Use <sys/stat.h> instead
2023-02-15 16:44:47 +00:00
Tony Finch
6927a30926 Remove do-nothing header <isc/print.h>
This one really truly did nothing. No lines added!
2023-02-15 16:44:47 +00:00
Tony Finch
c7615bc28d Remove do-nothing header <isc/offset.h>
And replace all uses of isc_offset_t with standard off_t
2023-02-15 16:44:47 +00:00
Tony Finch
bed09c1676 Remove do-nothing header <isc/netdb.h>
Not needed since we dropped Windows support
2023-02-15 16:44:47 +00:00
Tony Finch
9bcc434dad Merge branch 'fanf-clarify-strerror' into 'main'
Explain <isc/strerr.h> a little more

See merge request isc-projects/bind9!7465
2023-02-15 16:44:30 +00:00
Tony Finch
b0893ae09a Explain <isc/strerr.h> a little more
The purpose of the `strerror_r()` wrapper was not obvious.
2023-02-15 16:44:09 +00:00
Tony Finch
fe8e7e5958 Merge branch 'fanf-deprecate-deprecated' into 'main'
Deprecate <isc/deprecated.h>

See merge request isc-projects/bind9!7466
2023-02-15 16:04:28 +00:00
Tony Finch
75f7a85a39 Deprecate <isc/deprecated.h>
We refactor more freely these days.
2023-02-15 15:36:20 +00:00
Tony Finch
97b64f4970 Remove deprecated dns_db_rpz_*() methods
As well as the function wrappers, their slots have been removed from
the dns_dbmethods table.
2023-02-15 15:35:50 +00:00
Ondřej Surý
137bb3cf8f Merge branch '1609-add-modified-C-RW-WP-rwlock' into 'main'
Add the reader-writer synchronization with modified C-RW-WP

Closes #1609

See merge request isc-projects/bind9!7528
2023-02-15 09:22:15 +00:00
Ondřej Surý
459db4462f Add CHANGES note for [GL #1609] 2023-02-15 09:30:21 +01:00
Ondřej Surý
c194ff5d77 Use C-RW-WP lock in the dns_adb unit
Replace the isc_mutex in the dns_adb unit with isc_rwlock for better
performance.  Both ADB names and ADB entries hashtables and LRU are now
using isc_rwlock.
2023-02-15 09:30:04 +01:00
Ondřej Surý
3d3d3b8c58 Use C-RW-WP lock in the dns_resolver unit
Replace the isc_mutex with isc_rwlock in the dns_resolver unit,
specifically, both fetch context and fetch counters now uses the C-RW-WP
locks.
2023-02-15 09:30:04 +01:00
Ondřej Surý
6ffda5920e Add the reader-writer synchronization with modified C-RW-WP
This changes the internal isc_rwlock implementation to:

  Irina Calciu, Dave Dice, Yossi Lev, Victor Luchangco, Virendra
  J. Marathe, and Nir Shavit.  2013.  NUMA-aware reader-writer locks.
  SIGPLAN Not. 48, 8 (August 2013), 157–166.
  DOI:https://doi.org/10.1145/2517327.24425

(The full article available from:
  http://mcg.cs.tau.ac.il/papers/ppopp2013-rwlocks.pdf)

The implementation is based on the The Writer-Preference Lock (C-RW-WP)
variant (see the 3.4 section of the paper for the rationale).

The implemented algorithm has been modified for simplicity and for usage
patterns in rbtdb.c.

The changes compared to the original algorithm:

  * We haven't implemented the cohort locks because that would require a
    knowledge of NUMA nodes, instead a simple atomic_bool is used as
    synchronization point for writer lock.

  * The per-thread reader counters are not being used - this would
    require the internal thread id (isc_tid_v) to be always initialized,
    even in the utilities; the change has a slight performance penalty,
    so we might revisit this change in the future.  However, this change
    also saves a lot of memory, because cache-line aligned counters were
    used, so on 32-core machine, the rwlock would be 4096+ bytes big.

  * The readers use a writer_barrier that will raise after a while when
    readers lock can't be acquired to prevent readers starvation.

  * Separate ingress and egress readers counters queues to reduce both
    inter and intra-thread contention.
2023-02-15 09:30:04 +01:00
Ondřej Surý
af12241f67 Add missing <isc/atomic.h> include to dns/badcache.c
The dns_badcache was pulling the <isc/atomic.h> header only indirectly
via <isc/rwlock.h>, add the direct include as the <isc/rwlock.h> no
longer pulls the header when pthread_rwlock is used.
2023-02-15 09:30:04 +01:00
Ondřej Surý
28fe8104ee Add isc_hashmap_find() DbC check for valuep
This adds DbC check, so we don't pass non-NULL memory for a valued to
the isc_hashmap_find() function.
2023-02-15 09:30:04 +01:00
Mark Andrews
998252c6dc Merge branch 'feature/main/fips-tests' into 'main'
FIPS tests changes for RHEL

Closes #3871

See merge request isc-projects/bind9!7417
2023-02-15 08:16:52 +00:00
Mark Andrews
55a6b15087 Add CHANGES note for [GL !7417] 2023-02-15 18:55:18 +11:00
Petr Menšík
6ad794a8cd FIPS tests changes for RHEL
Include MD5 feature detection in featuretest tool and use it in some
places. When RHEL distribution or Fedora ELN is in FIPS mode, then MD5
algorithm is unavailable completely and even hmac-md5 algorithm usage
will always fail. Work that around by checking MD5 works and if not,
skipping its usage.

Those changes were dragged as downstream patch bind-9.11-fips-tests.patch
in Fedora and RHEL.
2023-02-15 15:44:28 +11:00
Ondřej Surý
4787adfd33 Merge branch '3862-recusive-stress-crash' into 'main'
Fix change 6093 which broke rbtdb when it grew too large

Closes #3862

See merge request isc-projects/bind9!7533
2023-02-14 18:19:54 +00:00
Tony Finch
9d7b224201 Fix change 6093 which broke rbtdb when it grew too large
I misunderstood the purpose of the `heap_index` rdataset header
member; I thought it identified which heap to use, and could therefore
be smaller, the same size as `locknum` indexes. But in fact it is a
position within a heap, so it needs to be able to count up to the
total number of rdatasets in the rbtdb.

So this changes `heap_index` from `uint16_t` back to `unsigned int`.

To avoid re-embiggening the rdatasetheader, shrink the `count` member
from `uint32` to `uint16`. The `count` is used to rotate RRsets in
`dns_rdataset_towiresorted()`, so 16 bits is more than large enough.
This change also means we no longer need to avoid colliding with
`DNS_RDATASET_COUNT_UNDEFINED` i.e. UINT32_MAX.

Closes #3862
2023-02-14 18:19:46 +00:00
Tony Finch
49db4fb60f Merge branch 'fanf-arm-spinloop' into 'main'
Improve the spinloop pause / yield hint

See merge request isc-projects/bind9!7469
2023-02-14 17:53:26 +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
Tom Krizek
f32d334e41 Merge branch '3849-relax-diff-on-dig-short-output' into 'main'
Ignore dig errors in +short comparisons in tests

Closes #3849

See merge request isc-projects/bind9!7488
2023-02-14 12:39:38 +00:00
Tom Krizek
bd1ef66f83 Ignore dig errors in +short comparisons in tests
Tests using diff to compare outputs of dig +short shall ignore lines
starting with ";". In dig +short output, such lines should only be
present for errors such as network issues. Since we utilize dig's
default timeout/retry mechanisms, these transitory issues should be
ignored and only the final output should be considered during the diff
comparison.
2023-02-14 13:10:49 +01:00
Arаm Sаrgsyаn
f5b77e734a Merge branch '3866-fix-rpz-reference-counting-bug' into 'main'
Fix RPZ reference counting error on shutdown

Closes #3866

See merge request isc-projects/bind9!7526
2023-02-14 09:59:41 +00:00
Aram Sargsyan
a5927f1151 Add a CHANGES note for [GL #3866] 2023-02-14 09:13:18 +00:00
Aram Sargsyan
afbe63565f Fix RPZ reference counting error on shutdown
A dns_rpz_unref_rpzs() call is missing when taking the 'goto unlock;'
path on shutdown, in order to compensate for the earlier
dns_rpz_ref_rpzs() call.

Move the dns_rpz_ref_rpzs() call after the shutdown check.
2023-02-14 09:12:53 +00:00
Mark Andrews
b274d388f1 Merge branch '3662-extend-mkeys-system-test-to-handle-islands-of-trust' into 'main'
Resolve "Extend mkeys system test to handle islands of trust"

Closes #3662

See merge request isc-projects/bind9!7049
2023-02-13 23:32:05 +00:00
Mark Andrews
2928f21733 Add CHANGES note for [GL #3662] 2023-02-14 10:10:39 +11:00
Mark Andrews
41bdb5b9fe Add islands of trust to mkeys test
This adds an island of trust that is reachable from the root
where the trust anchors are added to island.conf.

This add an island of trust that is not reachable from the root
where the trust anchors are added to private.conf.
2023-02-14 10:10:05 +11:00
Mark Andrews
fb7b7ac495 Report the key name that failed in retry_keyfetch
When there are multiple managed trust anchors we need to know the
name of the trust anchor that is failing.  Extend the error message
to include the trust anchor name.
2023-02-14 10:10:05 +11:00
Evan Hunt
2f54ba3977 Merge branch '2971-cleanup-dead-functions' into 'main'
remove some unused functions

Closes #2971

See merge request isc-projects/bind9!7521
2023-02-13 19:52:05 +00:00
Evan Hunt
3a1bb8dac8 remove some unused functions
removed some functions that are no longer used and unlikely to
be resurrected, and also some that were only used to support Windows
and can now be replaced with generic versions.
2023-02-13 11:50:59 -08:00
Tom Krizek
6b8b9c0b02 Merge branch '3848-increase-wait-time-runtime-test' into 'main'
Increase named startup wait time for runtime test

Closes #3848

See merge request isc-projects/bind9!7487
2023-02-13 14:22:24 +00:00
Tom Krizek
b8bb4233e8 Increase named startup wait time for runtime test
Occasionally, the allotted 10 seconds for the "running" line to appear
in log after named is started proved insufficient in CI, especially
during increased load. Give named up to 60 seconds to start up to
mitigate this issue.
2023-02-13 14:54:12 +01:00
Michal Nowak
e9272f3cdc Merge branch 'mnowak/pairwise-test-auth-recursive-servers' into 'main'
Test authoritative and recursive servers in pairwise

See merge request isc-projects/bind9!7397
2023-02-13 12:24:25 +00:00
Michal Nowak
a708c2f93d Start named as auth and recursive server in pairwise
The script will start the named process configured as both an
authoritative and recursive server for each pairwise ./configure
configuration. The test is considered successful if the named process
runs until the 5-second timeout is triggered, and there is no named.lock
file present, indicating that named did not crash on shutdown.
2023-02-13 12:45:20 +01:00
Ondřej Surý
18f6213dc7 Merge branch '3814-tighten-the-locking-around-fctxcount' into 'main'
Add magic to fctxcount and replace the atomics with integers

Closes #3814

See merge request isc-projects/bind9!7515
2023-02-11 20:22:01 +00:00