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

40041 Commits

Author SHA1 Message Date
Mark Andrews
dbc2167325 Update dangerfile.py to know about ':cve:' 2023-10-17 01:05:46 +00:00
Matthijs Mekking
86915a1f40 Merge branch 'matthijs-kasp-system-test-nit-fixes' into 'main'
Two minor fixes in the kasp system test

See merge request isc-projects/bind9!8389
2023-10-16 10:33:05 +00:00
Matthijs Mekking
21d04f556d Two minor fixes in the kasp system test
The 'dynamic-signed-inline-signing.kasp' zone was set up with
the environment variable 'ksktimes', but that should be 'csktimes'
which is set one line above. Since the values are currently the same
the behavior is identical, but of course it should use the correct
variable.

The 'step4.enable-dnssec.autosign' zone was set up twice. This is
unnecessary.
2023-10-16 11:08:59 +02:00
Matthijs Mekking
65d97a54ef Merge branch '4350-resign-triggered-on-raw-dnssec-zone' into 'main'
Don't schedule resign for raw version of an inline-signing zone

Closes #4350

See merge request isc-projects/bind9!8385
2023-10-16 08:21:25 +00:00
Matthijs Mekking
a8306b541b Add changes and release note for #4350 2023-10-16 09:26:56 +02:00
Matthijs Mekking
741ce2d07a Don't resign raw version of the zone
Update the function 'set_resigntime()' so that raw versions of
inline-signing zones are not scheduled to be resigned.

Also update the check in the same function for zone is dynamic, there
exists a function 'dns_zone_isdynamic()' that does a similar thing
and is more complete.

Also in 'zone_postload()' check whether the zone is not the raw
version of an inline-signing zone, preventing calculating the next
resign time.
2023-10-16 09:26:56 +02:00
Matthijs Mekking
c90b622648 Add test case for GL #4350
Add a test scenario for a dynamic zone that uses inline-signing which
accidentally has signed the raw version of the zone.

This should not trigger resign scheduling on the raw version of the
zone.
2023-10-16 09:26:56 +02:00
Ondřej Surý
7a3ba34475 Merge branch 'ondrej/convert-dns_acl-rwlock-to-rcu' into 'main'
Convert rwlock in dns_acl to RCU

See merge request isc-projects/bind9!8378
2023-10-13 12:44:53 +00:00
Ondřej Surý
96bbf95b83 Convert rwlock in dns_acl to RCU
The dns_aclenv_t contains two dns_acl_t - localhost and localnets that
can be swapped with a different ACLs as we configure BIND 9.  Instead of
protecting those two pointers with heavyweight read-write lock, use RCU
mechanism to dereference and swap the pointers.
2023-10-13 14:44:40 +02:00
Ondřej Surý
546c327349 Convert manual dns_{acl,aclenv}_{attach,detach} to ISC_REFCOUNT_IMPL
Instead of having a manual set of functions, use ISC_REFCOUNT_IMPL macro
to implement the attach, detach, ref and unref functions.
2023-10-13 14:44:40 +02:00
Ondřej Surý
b3a8f0048f Refactor dns_{acl,aclenv}_create to return void
The dns_{acl,aclenv}_create() can't fail, so change it to return void.
2023-10-13 14:44:40 +02:00
Ondřej Surý
f5b0bd9b1b Convert manual dns_iptable_{attach,detach} to ISC_REFCOUNT_IMPL
Instead of having a manual set of functions, use ISC_REFCOUNT_IMPL macro
to implement the attach, detach, ref and unref functions.
2023-10-13 14:44:40 +02:00
Ondřej Surý
613ada72b6 Refactor dns_iptable_create() to return void
The dns_iptable_create() cannot fail now, so change it to return void.
2023-10-13 14:44:40 +02:00
Ondřej Surý
d46d51be78 Refactor isc_radix_create to return void
The isc_radix_create() can't fail, so change it to return void.
2023-10-13 14:44:40 +02:00
Arаm Sаrgsyаn
b54498abf6 Merge branch '4360-fix-undefined-behaviours-detected-by-llvm-17' into 'main'
Resolve "Undefined behaviours detected by LLVM 17 (noop_accept_cb, dns__nta_shutdown_cb)"

Closes #4360

See merge request isc-projects/bind9!8376
2023-10-13 11:15:02 +00:00
Aram Sargsyan
20fdab8667 Fix undefined behaviour occurrences
The undefined behaviour was detected by LLVM 17. Fix the affected
functions definitions to match the expected function type.
2023-10-13 09:57:28 +00:00
Ondřej Surý
e17feff9a7 Merge branch 'ondrej/dont-undef-TRACE-define' into 'main'
Don't undef <unit>_TRACE, instead add comment how to enable it

See merge request isc-projects/bind9!8381
2023-10-13 09:47:11 +00:00
Ondřej Surý
6afa961534 Don't undef <unit>_TRACE, instead add comment how to enable it
In units that support detailed reference tracing via ISC_REFCOUNT
macros, we were doing:

    /* Define to 1 for detailed reference tracing */
    #undef <unit>_TRACE

This would prevent using -D<unit>_TRACE=1 in the CFLAGS.

Convert the above mentioned snippet with just a comment how to enable
the detailed reference tracing:

    /* Add -D<unit>_TRACE=1 to CFLAGS for detailed reference tracing */
2023-10-13 11:40:16 +02:00
Petr Špaček
f1aaebc53f Merge branch 'pspacek/doc-and-build-tweaks' into 'main'
Describe BIND threat model

See merge request isc-projects/bind9!8364
2023-10-13 07:25:32 +00:00
Petr Špaček
fc907baa7f Describe BIND threat model
Basically all local data is considered trusted, and proper ACLs and
limits need to be explicitly configured. We are also free to let
protocol non-compliant servers burn in flames.
2023-10-13 09:00:43 +02:00
Petr Špaček
992b87ccc1 Add qplookups test to .gitignore 2023-10-13 09:00:43 +02:00
Evan Hunt
77ea29e416 Merge branch '4362-qp-crash' into 'main'
check chain length is nonzero before examining last entry

Closes #4362

See merge request isc-projects/bind9!8370
2023-10-12 19:04:14 +00:00
Evan Hunt
3a206da456 check chain length is nonzero before examining last entry
It was possible to reach add_link() without visiting an
intermediate node first, and the check for a duplicate entry
could then cause a crash.

Credit to OSS-Fuzz for discovering this error.
2023-10-12 11:31:32 -07:00
Michał Kępień
a87436d3d5 Merge branch 'michal/remove-pdf-related-bits-from-the-build-system' into 'main'
Remove PDF-related bits from the build system

See merge request isc-projects/bind9!8350
2023-10-12 12:37:48 +00:00
Michał Kępień
561a83a291 Remove PDF-related bits from the build system
Read the Docs is capable of building the PDF version of the BIND 9 ARM
using just the contents of the doc/arm/ directory - it does not need the
build system to facilitate that.  Since the BIND 9 ARM is also built in
other formats when "make doc" is run, drop the parts of the build system
that enable building the PDF version as they pull in complexity without
bringing much added value in return.  Update related files accordingly.
2023-10-12 14:24:42 +02:00
Ondřej Surý
1da0af6d2f Merge branch '4326-remove-locking-from-copy_namehook_lists' into 'main'
Replace some ADB entry locking with atomics to reduce ADB contention

Closes #4326

See merge request isc-projects/bind9!8328
2023-10-12 10:43:50 +00:00
Ondřej Surý
6b306b9deb Add CHANGES note for [GL #4326] 2023-10-12 12:35:18 +02:00
Ondřej Surý
91f3b0edee Use mul and div instead of bitshifts to calculate srtt
There was a microoptimization for smoothing srtt with bitshifts.  Revert
the code to use * 98 / 100, it doesn't really make that difference on
modern CPUs, for comparison here:

    muldiv:
	    imul    eax, edi, 98
	    imul    rax, rax, 1374389535
	    shr     rax, 37
	    ret
    shift:
	    mov     eax, edi
	    sal     eax, 9
	    sub     eax, edi
	    shr     eax, 9
	    ret
2023-10-12 12:35:00 +02:00
Ondřej Surý
0635bd01cb Skip the no-op code in adjustsrtt()
If factor == DNS_ADB_RTTADJAGE and addr->entry->lastage == now we would
load value into new_srtt and then immediatelly store it back which
triggers the synchronization between threads using .srtt values.
2023-10-12 12:35:00 +02:00
Ondřej Surý
cb0db600e7 Replace some ADB entry locking with atomics to reduce ADB contention
Use atomics on couple of ADB entry members (.srtt, .flags, .expires, and
.lastage) to remove ADB entry locking from couple of hot spots.  The
most prominent place is copy_namehook_lists() that gets called under ADB
name lock and if the namehook list is long it acquires-releases quite a
few ADB entry locks.  Changing those ADB entry members to atomics
allowed us to new_adbaddrinfo() not require locked ADB entry and since
adbentry_overquota() already used atomics and handling lame information
was dropped in the previous commit, we could not make the
copy_namehook_lists() lockless.

The other hotspot is dns_adb_adjustsrtt() and dns_adb_agesrtt() that can
now use atomics because .srtt is already atomic_uint.

And the last place that could now use atomics is dns_adb_changeflags().
2023-10-12 12:35:00 +02:00
Ondřej Surý
2b20db05e3 Remove dns_adblameinfo from dns_adb
Keeping the information about lame server in the ADB was done in !322 to
fix following security issue:

    [CVE-2021-25219] Disable "lame-ttl" cache

The handling of the lame servers needs to be redesigned and it is not
going to be enabled any time soon, and the current code is just dead
code that takes up space, code and stands in the way of making ADB work
faster.

Remove all the internals needed for handling the lame servers in the ADB
for now.  It might get reintroduced later if and when we redesign ADB.
2023-10-12 12:35:00 +02:00
Arаm Sаrgsyаn
7fb4e354a9 Merge branch '4354-statschannel-test-opesbsd' into 'main'
Resolve "Checking zone transfer information in the statistics channel fails on OpenBSD"

Closes #4354

See merge request isc-projects/bind9!8367
2023-10-12 09:37:11 +00:00
Aram Sargsyan
39f46b8ca4 Make the statschannel system test portable
The usage of the newline in the replacement part of the 'sed' call
works in GNU systems, but not in OpenBSD. Use 'awk' instead.

Also use the extended syntax of regular expressions for 'grep', which
is similarly more portable across the supported systems.
2023-10-12 08:37:15 +00:00
Matthijs Mekking
ba20c4fbe1 Merge branch 'matthijs-fix-build-usdt' into 'main'
Fix build error related to USDT

See merge request isc-projects/bind9!8368
2023-10-10 15:43:59 +00:00
Matthijs Mekking
746e9809a8 Fix build error related to USDT
The trace.h file is listed twice in the Makefile. This incidentally
caused an error where the build refused to replace an earlier placed
trace.h file.
2023-10-10 16:57:18 +02:00
Evan Hunt
a2570851aa Merge branch 'each-qp-rpz' into 'main'
convert the RPZ summary database to to use a QP trie

See merge request isc-projects/bind9!8352
2023-10-10 06:56:21 +00:00
Evan Hunt
33a7c9b15f CHANGES for [GL !8352] 2023-10-09 13:29:02 -07:00
Evan Hunt
bf81ef3fc0 reduce search_lock coverage
now that we're using qpmulti for the summary database, we
no longer need to hold search_lock for it. we do still need
it for the radix tree and the trigger counts.
2023-10-09 13:29:02 -07:00
Evan Hunt
feea05d5c4 convert the RPZ summary database to to use a QP trie
now that we have the QP chain mechanism, we can convert the
RPZ summary database to use a QP trie instead of an RBT.

also revised comments throughout the file accordingly, and
incidentally cleaned up calls to new_node(), which can no
longer fail.
2023-10-09 13:29:02 -07:00
Evan Hunt
86fbfc22b4 fix build bug with DNS_RPZ_TRACE
nonstardard naming of ref/unref and attach/detach functions caused
build errors when using DNS_RPZ_TRACE; this has been fixed.
2023-10-09 13:29:02 -07:00
Evan Hunt
8f6a3f47db fix a QP chain bug
depending on how the QP trie is traversed during a lookup, it is
possible for a search to terminate on a leaf which is a partial
match, without that leaf being added to the chain. to ensure the
chain is correct in this case, when a partial match condition is
detected via qpkey_compare(), we will call add_link() again, just
in case.  (add_link() will check for a duplicated node, so it will
be harmless if it was already done.)
2023-10-09 13:29:02 -07:00
Ondřej Surý
8ca114ef88 Merge branch 'ondrej/fix-load_names-benchmark' into 'main'
Use read number of items instead of raw array size in load_names

See merge request isc-projects/bind9!8361
2023-10-09 19:09:25 +00:00
Ondřej Surý
1974a91e58 Add base testing set of names for load-names benchmark
This was generated from dnsperf queryfile with following script:

    #!/usr/bin/env python3
    names = {}

    import sys

    i = 0
    for line in iter(sys.stdin.readline, ''):
	name = line.rstrip('\n')
	if not name in names:
	    names[name] = line
	    print(f"{i},{name}")
	    i += 1
	if i >= 1024*1024:
	    break
2023-10-09 21:04:21 +02:00
Ondřej Surý
9a45fd6f33 Fix hashmap part of load-names benchmark
The name_match() was errorneously converting struct item into dns_name
pointer.  Correctly retype void *node to struct item * first and then
use item.fixed.name to pass the name to dns_name_equal() function.
2023-10-09 21:04:21 +02:00
Ondřej Surý
81f48e11e4 Use read number of items instead of raw array size in load_names
The load_names benchmark expected the input CSV with domains would fill
the whole item array and it would crash when the number of lines would
be less than that.

Fix the expectations by using the real number or lines read to calculate
the array start and end position for each benchmark thread.
2023-10-09 21:04:21 +02:00
Michał Kępień
1bd979167e Merge branch 'michal/move-linux-stress-tests-to-autoscaled-instances' into 'main'
Move Linux "stress" tests to autoscaled instances

See merge request isc-projects/bind9!8359
2023-10-06 11:09:41 +00:00
Michał Kępień
12ea994680 Move Linux "stress" tests to autoscaled instances
The autoscaling GitLab CI runners currently used for most GitLab CI jobs
spin up AWS EC2 instances that are at least as powerful as the dedicated
instances used for running "stress" tests.  Move all Linux-based
"stress" tests to autoscaling GitLab CI runners to enable deprovisioning
Linux AWS instances reserved for running "stress" tests.  Leave FreeBSD
"stress" tests intact as there is currently no support for autoscaling
BSD instances.
2023-10-06 13:07:55 +02:00
Michal Nowak
7339920948 Merge branch 'mnowak/monitor-stuck-system-tests' into 'main'
Report hung system tests

See merge request isc-projects/bind9!8245
2023-10-05 16:24:37 +00:00
Michal Nowak
35792b1700 Report hung system tests
At times, a problem might occur where a test is not responding,
especially in the CI, determining the specific test responsible can be
difficult. Fortunately, when running tests with the pytest runner,
pytest sets the PYTEST_CURRENT_TEST environment variable to the current
test nodeid and stage. Afterward, the variable can be examined to
identify the test that has stopped responding.

The monitoring script needs to be started in the background. Still, the
shell executor used for BSD and FIPS testing can't handle the background
process cleanly, and the script step will wait for the background
process for the entire duration of the background process (currently
3000 seconds). Therefore, run the monitoring script only when the Docker
executor is used where this is not a problem.
2023-10-05 14:57:26 +02:00
Mark Andrews
a6b5cf4c54 Merge branch '4253-detect-duplicate-controls' into 'main'
Detect duplicate "controls" configuration

Closes #4253

See merge request isc-projects/bind9!8313
2023-10-05 01:32:40 +00:00