Commit Graph

40049 Commits

Author SHA1 Message Date
Michal Nowak
dd234c60fe Update the source code formatting using clang-format-17 2023-10-17 17:47:46 +02:00
Michal Nowak
625a4ffc7a Update clang to version 17 2023-10-17 17:47:46 +02:00
Matthijs Mekking
591d7c32d1 Merge branch '4349-document-inline-signing-defaults' into 'main'
Resolve "Document the complex defaults of inline-signing"

Closes #4349

See merge request isc-projects/bind9!8372
2023-10-17 09:26:09 +00:00
Matthijs Mekking
a97e088ec5 Add release note and CHANGES for #4349 2023-10-17 10:52:43 +02:00
Matthijs Mekking
ca6171b2f5 Update addzone test
Now that inline-signing is ignored when there is no dnssec-policy,
add 'dnssec-policy default;' to the zones when attempting to add them
via 'rndc addzone'.
2023-10-17 10:52:43 +02:00
Matthijs Mekking
0512ca0ad8 Update inline-signing documentation
Add the missing documentation for 'dnssec-policy/inline-signing'.
Update the zone-only option 'inline-signing' to indicate that the
use of inline signing should be set in 'dnssec-policy' and that this
is merely a way to override the value for the given zone.

(cherry picked from commit 2b7381950d17fe4d289959e5f76f020cc462200a)
2023-10-17 10:52:43 +02:00
Matthijs Mekking
e6a454ad12 Ignore inline-signing by default
Ignore the option 'inline-signing' unless there is a 'dnssec-policy'
configured for the zone. Having inline signing enabled while the zone
is not DNSSEC signed does not make sense.

If there is a 'dnssec-policy' the 'inline-signing' zone-only option
can be used to override the value for the given zone.
2023-10-17 10:52:36 +02:00
Mark Andrews
0d58ce93e5 Merge branch '4365-update-dangerfile-py-to-know-about-cve' into 'main'
Resolve "Update dangerfile.py to know about `:cve:`"

Closes #4365

See merge request isc-projects/bind9!8387
2023-10-17 01:58:06 +00:00
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