]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
21 months agoRevert "Workaround temporary cross-version-config-tests limitation"
Michal Nowak [Fri, 24 May 2024 11:39:44 +0000 (13:39 +0200)] 
Revert "Workaround temporary cross-version-config-tests limitation"

With the release of BIND 9.19.25 this workaround is not needed anymore.

This reverts commit c58dd6e78f9c69667f0abb71d4c162a479a87029.

21 months agofix: usr: Fix algoritm rollover bug when there are two keys with the same keytag
Matthijs Mekking [Thu, 22 Aug 2024 10:11:29 +0000 (10:11 +0000)] 
fix: usr: Fix algoritm rollover bug when there are two keys with the same keytag

If there is an algorithm rollover and two keys of different algorithm share the same keytags, then there is a possibility that if we check that a key matches a specific state, we are checking against the wrong key. This has been fixed by not only checking for matching key tag but also key algorithm.

Closes #4878

Merge branch '4878-fix-algorithm-rollover-keytag-conflict-bug' into 'main'

Closes #4878

See merge request isc-projects/bind9!9381

21 months agoFix algorithm rollover bug wrt keytag conflicts
Matthijs Mekking [Wed, 21 Aug 2024 15:14:48 +0000 (17:14 +0200)] 
Fix algorithm rollover bug wrt keytag conflicts

If there is an algorithm rollover and two keys of different algorithm
share the same keytags, then there is a possibility that if we check
that a key matches a specific state, we are checking against the wrong
key.

Fix this by not only checking for matching key id but also key
algorithm.

21 months agoAdjust kasp system test to get keys which signed
Matthijs Mekking [Wed, 21 Aug 2024 15:12:30 +0000 (17:12 +0200)] 
Adjust kasp system test to get keys which signed

If there is a keytag conflict between keys with different algorithms,
we need to supply what key algorithm is used so we can get the right
public key.

For clarity, print the algorithm on the found keys after 'check_keys'.

21 months agochg: ci: Update Clang to version 19
Michal Nowak [Thu, 22 Aug 2024 08:06:56 +0000 (08:06 +0000)] 
chg: ci: Update Clang to version 19

These Clang 19-identified issues need to be addressed first:
- [x] isc-projects/bind9!9313
- [x] isc-projects/bind9!9317
- [x] isc-projects/bind9!9316
- [x] isc-projects/bind9!9315

Validation pipelines for backports:
- [x] ~"v9.21" - https://gitlab.isc.org/isc-projects/bind9/-/pipelines/191211
- [x] ~"v9.20" - https://gitlab.isc.org/isc-projects/bind9/-/pipelines/191512
- [x] ~"v9.18" - https://gitlab.isc.org/isc-projects/bind9/-/pipelines/191904

Prereq: isc-projects/images!328

Merge branch 'mnowak/llvm-19' into 'main'

See merge request isc-projects/bind9!9296

21 months agoUse clang-format-19 to update formatting
Ondřej Surý [Thu, 15 Aug 2024 07:36:53 +0000 (09:36 +0200)] 
Use clang-format-19 to update formatting

This is purely result of running:

    git-clang-format-19 --binary clang-format-19 origin/main

21 months agoUpdate Clang to version 19
Michal Nowak [Tue, 13 Aug 2024 09:28:41 +0000 (11:28 +0200)] 
Update Clang to version 19

21 months agonew: usr: Support for Offline KSK implemented
Matthijs Mekking [Thu, 22 Aug 2024 07:15:00 +0000 (07:15 +0000)] 
new: usr: Support for Offline KSK implemented

Add a new configuration option `offline-ksk` to enable Offline KSK key management. Signed Key Response (SKR) files created with `dnssec-ksr` (or other program) can now be imported into `named` with the new `rndc skr -import` command. Rather than creating new DNSKEY, CDS and CDNSKEY records and generating signatures covering these types, these records are loaded from the currently active bundle from the imported SKR.

The implementation is loosely based on: https://www.iana.org/dnssec/archive/files/draft-icann-dnssec-keymgmt-01.txt

Closes #1128

Merge branch '1128-offline-ksk-rndc-import-skr' into 'main'

Closes #1128

See merge request isc-projects/bind9!9119

21 months agoAdd a section for Offline KSK to the DNSSEC Guide
Matthijs Mekking [Tue, 13 Aug 2024 13:55:25 +0000 (15:55 +0200)] 
Add a section for Offline KSK to the DNSSEC Guide

This will describe in more detail the operational practices of
Offline KSK.

21 months agoAdd skr unit test
Matthijs Mekking [Tue, 13 Aug 2024 10:25:39 +0000 (12:25 +0200)] 
Add skr unit test

Add a test file for testing the skr related code.

21 months agoDisable some behavior in offline-ksk mode
Matthijs Mekking [Wed, 19 Jun 2024 12:48:04 +0000 (14:48 +0200)] 
Disable some behavior in offline-ksk mode

Some things we no longer want to do when we are in offline-ksk mode.

1. Don't check for inactive and private keys if the key is a KSK.
2. Don't update the TTL of DNSKEY, CDS and CDNSKEY RRset, these come
   from the SKR.

21 months agoRetrieve RRSIG from SKR
Matthijs Mekking [Wed, 19 Jun 2024 12:33:07 +0000 (14:33 +0200)] 
Retrieve RRSIG from SKR

When it is time to generate a new signature (dns_dnssec_sign), rather
than create a new one, retrieve it from the SKR.

21 months agoDon't read private key files for offline KSKs
Matthijs Mekking [Wed, 19 Jun 2024 12:07:06 +0000 (14:07 +0200)] 
Don't read private key files for offline KSKs

When we are appending contents of a DNSKEY rdataset to a keylist,
don't attempt to read the private key file of a KSK when we are in
offline-ksk mode.

21 months agoUpdate key states in offline-ksk mode
Matthijs Mekking [Wed, 19 Jun 2024 11:41:07 +0000 (13:41 +0200)] 
Update key states in offline-ksk mode

With offline-ksk enabled, we don't run the keymgr because the key
timings are determined by the SKR. We do update the key states but
we derive them from the timing metadata.

Then, we can skip a other tasks in offline-ksk mode, like DS checking
at the parent and CDS synchronization, because the CDS and CDNSKEY
RRsets also come from the SKR.

21 months agoApply SKR bundle on rekey
Matthijs Mekking [Wed, 19 Jun 2024 10:27:58 +0000 (12:27 +0200)] 
Apply SKR bundle on rekey

When a zone has a skr structure, lookup the currently active bundle
that contains the right key and signature material.

21 months agoImplement SKR import
Matthijs Mekking [Wed, 19 Jun 2024 10:17:31 +0000 (12:17 +0200)] 
Implement SKR import

When 'rndc skr import' is called, read the file contents and store the
data in the zone's skr structure.

21 months agoAdd code to store SKR
Matthijs Mekking [Wed, 19 Jun 2024 09:09:29 +0000 (11:09 +0200)] 
Add code to store SKR

This added source code stores SKR data. It is loosely based on:
https://www.iana.org/dnssec/archive/files/draft-icann-dnssec-keymgmt-01.txt

A SKR contains a list of signed DNSKEY RRsets. Each change in data
should be stored in a separate bundle. So if the RRSIG is refreshed that
means it is stored in the next bundle. Likewise, if there is a new ZSK
pre-published, it is in the next bundle.

In addition (not mentioned in the draft), each bundle may contain
signed CDS and CDNSKEY RRsets.

Each bundle has an inception time. These will determine when we need
to re-sign or re-key the zone.

21 months agoTest rndc skr import
Matthijs Mekking [Wed, 22 May 2024 09:19:20 +0000 (11:19 +0200)] 
Test rndc skr import

Test importing a Signed Key Response. Files should be loaded and once
loaded the correct bundle should be used. Alsoe test cases where the
bundle is not the first bundle in the SKR.

21 months agoAdd option to kasp.sh check_keys to retain found keys
Matthijs Mekking [Wed, 19 Jun 2024 13:58:19 +0000 (15:58 +0200)] 
Add option to kasp.sh check_keys to retain found keys

This will come in handy when we are testing offline-ksk where first
we check for ZSKs and then the KSK.

21 months agoImplement dummy 'rndc skr -import' command
Matthijs Mekking [Fri, 19 Apr 2024 12:41:41 +0000 (14:41 +0200)] 
Implement dummy 'rndc skr -import' command

Add the code and documentation required to provide KSR import using
rndc.  This is just the command, and the feature is at this point in
time still not implemented.

21 months agoAdd a common setup script for ksr
Matthijs Mekking [Tue, 7 May 2024 09:53:07 +0000 (11:53 +0200)] 
Add a common setup script for ksr

The previous setup.sh has been moved to ns1/setup.sh, we need a common
setup script to invoke ns1/setup.sh.

21 months agoUpdate ksr system test to include server
Matthijs Mekking [Tue, 7 May 2024 09:51:55 +0000 (11:51 +0200)] 
Update ksr system test to include server

Prepare the system test for tests that require a server to import
created SKR files. This means the test script needs adjustments to
take into account the directory test files are located.

In addition, the check_keys function is renamed to ksr_check_keys
because the name clashes with check_keys from kasp.sh. It also has an
extra parameter added, offset, that can be used to check ksr files that
are created in the past or future.

21 months agoAdd offline-ksk option
Matthijs Mekking [Fri, 22 Mar 2024 10:48:53 +0000 (11:48 +0100)] 
Add offline-ksk option

Add a new configuration option to enable Offline KSK key management.

Offline KSK cannot work with CSK because it splits how keys with the
KSK and ZSK role operate. Therefore, one key cannot have both roles.
Add a configuration check to ensure this.

21 months agochg: dev: Restore the ability to select individual unit tests
Mark Andrews [Thu, 22 Aug 2024 00:54:13 +0000 (00:54 +0000)] 
chg: dev: Restore the ability to select individual unit tests

This add the command line arguments: `-d` (debug), `-l` (list tests) and `-t test` (run this test) to the unit tests.

Closes #4579

Merge branch '4579-restore-the-ability-to-select-individual-unit-tests' into 'main'

Closes #4579

See merge request isc-projects/bind9!9384

21 months agoExtend ISC_TEST_MAIN for debugging
Mark Andrews [Fri, 7 Oct 2022 05:13:32 +0000 (16:13 +1100)] 
Extend ISC_TEST_MAIN for debugging

ISC_TEST_MAIN now supports turning on/off debugging and
running individual tests.

21 months agochg: ci: Add FreeBSD 14.1
Michal Nowak [Wed, 21 Aug 2024 16:28:48 +0000 (16:28 +0000)] 
chg: ci: Add FreeBSD 14.1

Prereq: https://gitlab.isc.org/isc-projects/images/-/merge_requests/323

Merge branch 'mnowak/freebsd-14.1' into 'main'

See merge request isc-projects/bind9!9116

21 months agoAdd FreeBSD 14.1
Michal Nowak [Thu, 20 Jun 2024 18:42:32 +0000 (20:42 +0200)] 
Add FreeBSD 14.1

21 months agochg: Merge 9.21.0 release branch
Nicki Křížek [Wed, 21 Aug 2024 15:10:37 +0000 (15:10 +0000)] 
chg: Merge 9.21.0 release branch

Merge branch 'main-merge-v9.21.0' into 'main'

Closes #4733

See merge request isc-projects/bind9!9378

21 months agoMerge tag 'v9.21.0'
Nicki Křížek [Wed, 21 Aug 2024 14:22:41 +0000 (16:22 +0200)] 
Merge tag 'v9.21.0'

21 months agofix: usr: Fix rare assertion failure when shutting down incoming transfer
Ondřej Surý [Wed, 21 Aug 2024 11:56:10 +0000 (11:56 +0000)] 
fix: usr: Fix rare assertion failure when shutting down incoming transfer

A very rare assertion failure can be triggered when the incoming transfer is either forcefully shut down or it is finished during printing the details about the statistics channel.  This has been fixed.

Closes #4860

Merge branch '4860-destroy-xfrin-timers-on-the-loop' into 'main'

Closes #4860

See merge request isc-projects/bind9!9336

21 months agoDestroy the dns_xfrin isc_timers on the correct loop
Ondřej Surý [Mon, 19 Aug 2024 08:14:19 +0000 (10:14 +0200)] 
Destroy the dns_xfrin isc_timers on the correct loop

There are few places where we attach/detach from the dns_xfrin object
while running on a different thread than the zone's assigned thread -
xfrin_xmlrender() in the statschannel and dns_zone_stopxfr() to name the
two places where it happens now.  In the rare case, when the incoming
transfer completes (or shuts down) in the brief period between the other
thread attaches and detaches from the dns_xfrin, the isc_timer_destroy()
calls would be called by the last thread calling the xfrin_detach().
In the worst case, it would be this other thread causing assertion
failure.  Move the isc_timer_destroy() call to xfrin_end() function
which is always called on the right thread and to match this move
isc_timer_create() to xfrin_start() - although this other change makes
no difference.

21 months agonew: usr: Print the full path of the working directory in startup log messages
Arаm Sаrgsyаn [Tue, 20 Aug 2024 17:30:26 +0000 (17:30 +0000)] 
new: usr: Print the full path of the working directory in startup log messages

named now prints its initial working directory during startup and the
changed working directory when loading or reloading its configuration
file if it has a valid 'directory' option defined.

Closes #4731

Merge branch '4731-log-workdir-full-path' into 'main'

Closes #4731

See merge request isc-projects/bind9!9362

21 months agoPrint the full path of the working directory in startup log messages
Aram Sargsyan [Tue, 20 Aug 2024 11:30:13 +0000 (11:30 +0000)] 
Print the full path of the working directory in startup log messages

named now prints its initial working directory during startup and the
changed working directory when loading or reloading its configuration
file if it has a valid 'directory' option defined.

21 months agochg: dev: Use seteuid()/setegid() instead of setreseuid()/setresgid()
Ondřej Surý [Tue, 20 Aug 2024 14:58:39 +0000 (14:58 +0000)] 
chg: dev: Use seteuid()/setegid() instead of setreseuid()/setresgid()

It looks like that all supported systems now have support for
_POSIX_SAVED_IDS, so it's safe to use setegid() and setegid() because
those will not change saved used/group IDs.

Closes #4862

Merge branch '4862-just-use-seteuid-and-setegid' into 'main'

Closes #4862

See merge request isc-projects/bind9!9363

21 months agoUse seteuid()/setegid() instead of setreseuid()/setresgid()
Ondřej Surý [Tue, 20 Aug 2024 11:44:06 +0000 (13:44 +0200)] 
Use seteuid()/setegid() instead of setreseuid()/setresgid()

It looks like that all supported systems now have support for
_POSIX_SAVED_IDS, so it's safe to use setegid() and setegid() because
those will not change saved used/group IDs.

21 months agofix: test: Allow TTL skew in the badcache print unit test
Ondřej Surý [Tue, 20 Aug 2024 13:57:57 +0000 (13:57 +0000)] 
fix: test: Allow TTL skew in the badcache print unit test

If the machine running the job is extra loaded (or extra slow), the
print test in the badcache unit test would fail because the TTL would be
59 (possibly even lower) and the test expects the badcache.out to only
have TTL 60.  Refactor the test to check for the expected strings and
check whether the TTL is in the expected range.

Closes #4861

Merge branch '4861-allow-TTL-skew-in-badcache_test' into 'main'

Closes #4861

See merge request isc-projects/bind9!9338

21 months agoAllow TTL skew in the badcache print unit test
Ondřej Surý [Mon, 19 Aug 2024 09:01:08 +0000 (11:01 +0200)] 
Allow TTL skew in the badcache print unit test

If the machine running the job is extra loaded (or extra slow), the
print test in the badcache unit test would fail because the TTL would be
59 (possibly even lower) and the test expects the badcache.out to only
have TTL 60.  Refactor the test to check for the expected strings and
check whether the TTL is in the expected range.

21 months agochg: dev: Use single logging context for everything
Ondřej Surý [Tue, 20 Aug 2024 12:56:04 +0000 (12:56 +0000)] 
chg: dev: Use single logging context for everything

Instead of juggling different logging context, use one single logging
context that gets initialized in the libisc constructor and destroyed in
the libisc destructor.

Closes #4848

Merge branch '4848-refactor-isc_log-api-to-use-single-global-logging-context' into 'main'

Closes #4848

See merge request isc-projects/bind9!9301

21 months agopause to let reloading complete
Evan Hunt [Mon, 19 Aug 2024 22:59:28 +0000 (15:59 -0700)] 
pause to let reloading complete

the rpz test frequently failed in DNSRPS mode and sometimes in native
mode as well because of an 'rndc reload' not being complete.

21 months agoAdd isc_log_createandusechannel() function to simplify usage
Ondřej Surý [Wed, 14 Aug 2024 12:38:07 +0000 (14:38 +0200)] 
Add isc_log_createandusechannel() function to simplify usage

The new
isc_log_createandusechannel() function combines following calls:

    isc_log_createchannel()
    isc_log_usechannel()

calls into a single call that cannot fail and therefore can be used in
places where we know this cannot fail thus simplifying the error
handling.

21 months agoConvert all categories and modules into static lists
Ondřej Surý [Wed, 14 Aug 2024 11:25:50 +0000 (13:25 +0200)] 
Convert all categories and modules into static lists

Remove the complicated mechanism that could be (in theory) used by
external libraries to register new categories and modules with
statically defined lists in <isc/log.h>.  This is similar to what we
have done for <isc/result.h> result codes.  All the libraries are now
internal to BIND 9, so we don't need to provide a mechanism to register
extra categories and modules.

21 months agoRemove logging context (isc_log_t) from the public namespace
Ondřej Surý [Tue, 13 Aug 2024 16:20:26 +0000 (18:20 +0200)] 
Remove logging context (isc_log_t) from the public namespace

Now that the logging uses single global context, remove the isc_log_t
from the public namespace.

21 months agoRemove isc_log_write1() and isc_log_vwrite1() functions
Ondřej Surý [Tue, 13 Aug 2024 15:16:57 +0000 (17:16 +0200)] 
Remove isc_log_write1() and isc_log_vwrite1() functions

The isc_log_write1() and isc_log_vwrite1() functions were meant to
de-duplicate the messages sent to the isc_log subsystem.  However, they
were never used in an entire code base and the whole mechanism around it
was complicated and very inefficient.  Just remove those, there are
better ways to deduplicate syslog messages inside syslog daemons now.

21 months agoReplace isc_log_create/destroy with isc_logconfig_get()
Ondřej Surý [Tue, 13 Aug 2024 13:52:51 +0000 (15:52 +0200)] 
Replace isc_log_create/destroy with isc_logconfig_get()

Add isc_logconfig_get() function to get the current logconfig and use
the getter to replace most of the little dancing around setting up
logging in the tools. Thus:

    isc_log_create(mctx, &lctx, &logconfig);
    isc_log_setcontext(lctx);
    dns_log_setcontext(lctx);
    ...
    ...use lcfg...
    ...
    isc_log_destroy();

is now only:

    logconfig = isc_logconfig_get(lctx);
    ...use lcfg...

For thread-safety, isc_logconfig_get() should be surrounded by RCU read
lock, but since we never use isc_logconfig_get() in threaded context,
the only place where it is actually used (but not really needed) is
named_log_init().

21 months agoUse single logging context for everything
Ondřej Surý [Tue, 13 Aug 2024 12:46:42 +0000 (14:46 +0200)] 
Use single logging context for everything

Instead of juggling different logging context, use one single logging
context that gets initialized in the libisc constructor and destroyed in
the libisc destructor.

The application is still responsible for creating the logging
configuration before using the isc_log API.

This patch is first in the series in a way that it is transparent for
the users of the isc_log API as the isc_log_create() and
isc_log_destroy() are now thin shims that emulate the previous
functionality, but it isc_log_create() will always return internal
isc__lctx pointer and isc_log_destroy() will actually not destroy the
internal isc__lctx context.

Signed-off-by: Ondřej Surý <ondrej@isc.org>
21 months agofix: test: Ignore ISC_R_CONNECTIONRESET in the TCP tests
Ondřej Surý [Tue, 20 Aug 2024 12:46:09 +0000 (12:46 +0000)] 
fix: test: Ignore ISC_R_CONNECTIONRESET in the TCP tests

On FreeBSD, the TCP connection callback could spuriously receive
ISC_R_CONNECTIONRESET even when connection to the loopback interface.
Skip the other checks in such case and graciously shutdown the TCP
connection.

Closes #4849

Merge branch '4849-dispatch_test-fails-in-connected_shutdown-on-freebsd' into 'main'

Closes #4849

See merge request isc-projects/bind9!9303

21 months agoIgnore ISC_R_CONNECTIONRESET in the TCP tests
Ondřej Surý [Wed, 14 Aug 2024 08:01:33 +0000 (10:01 +0200)] 
Ignore ISC_R_CONNECTIONRESET in the TCP tests

On FreeBSD, the TCP connection callback could spuriously receive
ISC_R_CONNECTIONRESET even when connection to the loopback interface.
Skip the other checks in such case and graciously shutdown the TCP
connection.

21 months agochg: Update Internal_use_only-CVE.md checklist changing some tasks
Petr Špaček [Tue, 20 Aug 2024 12:36:36 +0000 (12:36 +0000)] 
chg: Update Internal_use_only-CVE.md checklist changing some tasks

Update Internal_use_only-CVE.md checklist changing some tasks and responsibilities reflecting the new ASN process with RT vs SF. Support will now be sending ASNs to customers, although Marketing will announce the new releases (both publicly and to support customers).

Merge branch 'vicky-main-patch-57381' into 'main'

See merge request isc-projects/bind9!9307

21 months agoApply 1 suggestion(s) to 1 file(s)
Vicky Risk [Wed, 14 Aug 2024 17:32:12 +0000 (17:32 +0000)] 
Apply 1 suggestion(s) to 1 file(s)

Co-authored-by: Darren Ankney <dankney@isc.org>
21 months agoApply 1 suggestion(s) to 1 file(s)
Vicky Risk [Wed, 14 Aug 2024 17:32:00 +0000 (17:32 +0000)] 
Apply 1 suggestion(s) to 1 file(s)

Co-authored-by: Darren Ankney <dankney@isc.org>
21 months agoApply 1 suggestion(s) to 1 file(s)
Vicky Risk [Wed, 14 Aug 2024 17:30:07 +0000 (17:30 +0000)] 
Apply 1 suggestion(s) to 1 file(s)

Co-authored-by: Darren Ankney <dankney@isc.org>
21 months agoApply 1 suggestion(s) to 1 file(s)
Vicky Risk [Wed, 14 Aug 2024 17:29:23 +0000 (17:29 +0000)] 
Apply 1 suggestion(s) to 1 file(s)

Co-authored-by: Darren Ankney <dankney@isc.org>
21 months agoUpdate Internal_use_only-CVE.md checklist changing some tasks and responsibilities...
Vicky Risk [Wed, 14 Aug 2024 14:34:09 +0000 (14:34 +0000)] 
Update Internal_use_only-CVE.md checklist changing some tasks and responsibilities reflecting the new ASN process with RT vs SF

21 months agochg: doc: Improve changelog & release notes workflow
Nicki Křížek [Tue, 20 Aug 2024 11:50:48 +0000 (11:50 +0000)] 
chg: doc: Improve changelog & release notes workflow

Related: #4847

Merge branch '4847-changelog-sorting-and-tweaks' into 'main'

See merge request isc-projects/bind9!9300

21 months agoOmit MR link from release notes
Nicki Křížek [Tue, 13 Aug 2024 15:28:50 +0000 (17:28 +0200)] 
Omit MR link from release notes

When manually handling the release notes (due to rst markup, fixups
etc.), the different MR number for backports causes needless friction.
Remove the reference from release notes and keep it only in changelog
which isn't manually redacted.

21 months agoSort changelog & relnotes entries by issue number
Nicki Křížek [Tue, 13 Aug 2024 15:20:54 +0000 (17:20 +0200)] 
Sort changelog & relnotes entries by issue number

To reduce the friction when handling the release notes, it is preferable
to have the sections sorted by issue number, rather than merge order.
Fallback to commit subject line if unavailable (e.g. for changelog
entries).

21 months agofix: dev: Fix the resesuid() shim implementation for NetBSD
Ondřej Surý [Tue, 20 Aug 2024 10:22:08 +0000 (10:22 +0000)] 
fix: dev: Fix the resesuid() shim implementation for NetBSD

The shim implementation of setresuid() was wrong - there was a copy and
paste error and it was calling setresgid() instead.  This only affects
NetBSD because Linux, FreeBSD and OpenBSD have setresuid() and
setresgid() implementation available from the system library.

Closes #4862

Merge branch '4862-fix-setresuid-shim' into 'main'

Closes #4862

See merge request isc-projects/bind9!9359

21 months agoFix the resesuid() shim implementation for NetBSD
Ondřej Surý [Tue, 20 Aug 2024 07:14:31 +0000 (09:14 +0200)] 
Fix the resesuid() shim implementation for NetBSD

The shim implementation of setresuid() was wrong - there was a copy and
paste error and it was calling setresgid() instead.  This only affects
NetBSD because Linux, FreeBSD and OpenBSD have setresuid() and
setresgid() implementation available from the system library.

21 months agochg: doc: Set up version for BIND 9.21.1
Petr Špaček [Tue, 20 Aug 2024 09:04:50 +0000 (09:04 +0000)] 
chg: doc: Set up version for BIND 9.21.1

Merge branch 'nicki/set-up-version-and-release-notes-for-bind-9.21.1' into 'main'

See merge request isc-projects/bind9!9355

21 months agoRemove release note draft file
Nicki Křížek [Mon, 19 Aug 2024 16:01:54 +0000 (18:01 +0200)] 
Remove release note draft file

Since we've started the new changelog & release notes process, the file
for drafting release notes for the version-to-be is no longer needed.

21 months agoUpdate BIND version to 9.21.1-dev
Nicki Křížek [Mon, 19 Aug 2024 15:59:00 +0000 (17:59 +0200)] 
Update BIND version to 9.21.1-dev

21 months agochg: ci: Allow rerun of unstable statschannel tests under TSAN
Nicki Křížek [Mon, 19 Aug 2024 14:10:10 +0000 (14:10 +0000)] 
chg: ci: Allow rerun of unstable statschannel tests under TSAN

The test_traffic_json and test_traffic_xml occasionally fail when
running under TSAN. This happens in CI and is most likely a result of
some instability that doesn't seem to be easily reproduced.

Closes #4598

Merge branch '4598-mark-statschannel-test-flaky' into 'main'

Closes #4598

See merge request isc-projects/bind9!9293

21 months agoAllow rerun of unstable statschannel tests under TSAN
Nicki Křížek [Mon, 12 Aug 2024 13:43:19 +0000 (15:43 +0200)] 
Allow rerun of unstable statschannel tests under TSAN

The test_traffic_json and test_traffic_xml occasionally fail when
running under TSAN. This happens in CI and is most likely a result of
some instability that doesn't seem to be easily reproduced.

21 months agochg: dev: Process also the ISC_R_CANCELED result code in rpz_rewrite()
Arаm Sаrgsyаn [Mon, 19 Aug 2024 11:39:29 +0000 (11:39 +0000)] 
chg: dev: Process also the ISC_R_CANCELED result code in rpz_rewrite()

Log canceled resolver queries (e.g. when shutting down a hung
fetch) in DEBUG3 level instead of DEBUG1 which is used for the
"unrecognized" result codes.

Closes #4797

Merge branch '4797-rpz_rewrite-add-ISC_R_CANCELED-processing' into 'main'

Closes #4797

See merge request isc-projects/bind9!9148

21 months agoProcess also the ISC_R_CANCELED result code in rpz_rewrite()
Aram Sargsyan [Thu, 11 Jul 2024 09:30:53 +0000 (09:30 +0000)] 
Process also the ISC_R_CANCELED result code in rpz_rewrite()

Log  canceled queries (e.g. when shutting down a hung fetch)
in DEBUG3 level instead of DEBUG1 which is used for the
"unrecognized" result codes.

21 months agofix: test: Add missing fclose() when applying updates failed (rpz/testlib)
Ondřej Surý [Mon, 19 Aug 2024 10:04:29 +0000 (10:04 +0000)] 
fix: test: Add missing fclose() when applying updates failed (rpz/testlib)

In rpz system tests, we could leak file if the applying the updates has
failed.  Add the missing fclose() before returning.

Merge branch 'ondrej/add-missing-flose-to-rpz-testlib' into 'main'

See merge request isc-projects/bind9!9317

21 months agoAdd missing fclose() when applying updates failed (rpz/testlib)
Ondřej Surý [Thu, 15 Aug 2024 07:28:26 +0000 (09:28 +0200)] 
Add missing fclose() when applying updates failed (rpz/testlib)

In rpz system tests, we could leak file if the applying the updates has
failed.  Add the missing fclose() before returning.

21 months agofix: dev: Check the result of dirfd() before calling unlinkat()
Ondřej Surý [Mon, 19 Aug 2024 09:57:48 +0000 (09:57 +0000)] 
fix: dev: Check the result of dirfd() before calling unlinkat()

Instead of directly using the result of dirfd() in the unlinkat() call,
check whether the returned file descriptor is actually valid.  That
doesn't really change the logic as the unlinkat() would fail with
invalid descriptor anyway, but this is cleaner and will report the right
error returned directly by dirfd() instead of EBADF from unlinkat().

Closes #4853

Merge branch '4853-check-result-of-dirfd-in-isc_log' into 'main'

Closes #4853

See merge request isc-projects/bind9!9316

21 months agoCheck the result of dirfd() before calling unlinkat()
Ondřej Surý [Thu, 15 Aug 2024 07:23:31 +0000 (09:23 +0200)] 
Check the result of dirfd() before calling unlinkat()

Instead of directly using the result of dirfd() in the unlinkat() call,
check whether the returned file descriptor is actually valid.  That
doesn't really change the logic as the unlinkat() would fail with
invalid descriptor anyway, but this is cleaner and will report the right
error returned directly by dirfd() instead of EBADF from unlinkat().

21 months agochg: dev: Remove code to read and parse /proc/net/if_inet6 on Linux
Ondřej Surý [Mon, 19 Aug 2024 09:43:03 +0000 (09:43 +0000)] 
chg: dev: Remove code to read and parse /proc/net/if_inet6 on Linux

The getifaddr() works fine for years, so we don't have to
keep the callback to parse /proc/net/if_inet6 anymore.

Closes #4852

Merge branch '4852-handle-errors-from-rewind' into 'main'

Closes #4852

See merge request isc-projects/bind9!9315

21 months agoRemove code to read and parse /proc/net/if_inet6 on Linux
Ondřej Surý [Thu, 15 Aug 2024 08:50:22 +0000 (10:50 +0200)] 
Remove code to read and parse /proc/net/if_inet6 on Linux

The getifaddr() works fine for years, so we don't have to
keep the callback to parse /proc/net/if_inet6 anymore.

21 months agoIgnore errno returned from rewind() in the interface iterator
Ondřej Surý [Thu, 15 Aug 2024 07:12:18 +0000 (09:12 +0200)] 
Ignore errno returned from rewind() in the interface iterator

The clang-scan 19 has reported that we are ignoring errno after the call
to rewind().  As we don't really care about the result, just silence the
error, the whole code will be removed in the development version anyway
as it is not needed.

21 months agofix: dev: Change the NS_PER_SEC (and friends) from enum to static const
Ondřej Surý [Mon, 19 Aug 2024 09:09:09 +0000 (09:09 +0000)] 
fix: dev: Change the NS_PER_SEC (and friends) from enum to static const

New version of clang (19) has introduced a stricter checks when mixing
integer (and float types) with enums.  In this case, we used enum {}
as C17 doesn't have constexpr yet.  Change the time conversion constants
to be static const unsigned int instead of enum values.

Closes #4845

Merge branch '4845-change-NS_PER_SEC-type-from-enum-to-integer' into 'main'

Closes #4845

See merge request isc-projects/bind9!9313

21 months agoUse constexpr for NS_PER_SEC and friends constants
Ondřej Surý [Wed, 14 Aug 2024 14:10:18 +0000 (16:10 +0200)] 
Use constexpr for NS_PER_SEC and friends constants

The contexpr introduced in C23 standard makes perfect sense to be used
instead of preprocessor macros - the symbols are kept, etc.  Define
ISC_CONSTEXPR to be `constexpr` for C23 and `static const` for the older
C standards.  Use the newly introduced macro for the NS_PER_SEC and
friends time constants.

21 months agoChange the NS_PER_SEC (and friends) from enum to static const
Ondřej Surý [Wed, 14 Aug 2024 14:10:18 +0000 (16:10 +0200)] 
Change the NS_PER_SEC (and friends) from enum to static const

New version of clang (19) has introduced a stricter checks when mixing
integer (and float types) with enums.  In this case, we used enum {}
as C17 doesn't have constexpr yet.  Change the time conversion constants
to be static const unsigned int instead of enum values.

21 months agochg: test: Retire Debian 11 "bullseye"
Ondřej Surý [Fri, 16 Aug 2024 06:48:38 +0000 (06:48 +0000)] 
chg: test: Retire Debian 11 "bullseye"

A follow-up to isc-projects/bind9!9324.

Merge branch 'mnowak/retire-debian-11-bullseye' into 'main'

See merge request isc-projects/bind9!9330

21 months agoRetire Debian 11 "bullseye"
Michal Nowak [Fri, 16 Aug 2024 06:31:51 +0000 (08:31 +0200)] 
Retire Debian 11 "bullseye"

A follow-up to isc-projects/bind9!9324.

21 months agochg: test: For TSAN builds, use libraries from /opt/tsan
Ondřej Surý [Thu, 15 Aug 2024 21:03:26 +0000 (21:03 +0000)] 
chg: test: For TSAN builds, use libraries from /opt/tsan

The new TSAN images, the TSAN-enabled images install libraries to
opt/tsan, synchronize the configure options and CFLAGS between gcc:tsan
and clang:tsan images and set the PKG_CONFIG_PATH to /opt/tsan/lib.

Additionally, drop Debian bullseye that's EOL now.

Merge branch 'ondrej/use-staging-tsan-images' into 'main'

See merge request isc-projects/bind9!9324

21 months agoRemove Debian bullseye jobs
Ondřej Surý [Thu, 15 Aug 2024 18:21:46 +0000 (20:21 +0200)] 
Remove Debian bullseye jobs

The Debian bullseye has reached end-of-life, remove it from the CI.

21 months agoFor TSAN builds, use libraries from /opt/tsan
Ondřej Surý [Thu, 15 Aug 2024 17:54:58 +0000 (19:54 +0200)] 
For TSAN builds, use libraries from /opt/tsan

The new TSAN images, the TSAN-enabled images install libraries to
/opt/tsan, synchronize the configure options and CFLAGS between gcc:tsan
and clang:tsan images and set the PKG_CONFIG_PATH to /opt/tsan/lib.

21 months agofix: dev: Check if logconfig is NULL before using it in isc_log_doit()
Arаm Sаrgsyаn [Thu, 15 Aug 2024 12:55:28 +0000 (12:55 +0000)] 
fix: dev: Check if logconfig is NULL before using it in isc_log_doit()

Check if 'lctx->logconfig' is NULL before using it in isc_log_doit(),
because it's possible that isc_log_destroy() was already called, e.g.
when a 'call_rcu' function wants to log a message during shutdown.

Closes #4842

Merge branch '4842-shutdown-crash-in-isc_log_doit' into 'main'

Closes #4842

See merge request isc-projects/bind9!9297

21 months agoCheck if logconfig is NULL before using it in isc_log_doit()
Aram Sargsyan [Tue, 13 Aug 2024 09:45:26 +0000 (09:45 +0000)] 
Check if logconfig is NULL before using it in isc_log_doit()

Check if 'lctx->logconfig' is NULL before using it in isc_log_doit(),
because it's possible that isc_log_destroy() was already called, e.g.
when a 'call_rcu' function wants to log a message during shutdown.

21 months agofix: dev: Add -Wno-psabi to CFLAGS for x86 (32-bit) builds
Arаm Sаrgsyаn [Thu, 15 Aug 2024 12:51:03 +0000 (12:51 +0000)] 
fix: dev: Add -Wno-psabi to CFLAGS for x86 (32-bit) builds

GCC 11.1+ emits a note during compilation when there are 64-bit
atomic fields in a structure, because it fixed a compiler bug
by changing the alignment of such fields, which caused ABI change.

Add -Wno-psabi to CFLAGS for such builds in order to silence the
warning. That shouldn't be a problem since we don't expose our
structures to the outside.

Closes #4841

Merge branch '4841-alignment-of-_Atomic-long-long-unsigned-int' into 'main'

Closes #4841

See merge request isc-projects/bind9!9319

21 months agoAdd -Wno-psabi to CFLAGS for x86 (32-bit) builds
Aram Sargsyan [Thu, 15 Aug 2024 10:28:40 +0000 (10:28 +0000)] 
Add -Wno-psabi to CFLAGS for x86 (32-bit) builds

GCC 11.1+ emits a note during compilation when there are 64-bit
atomic fields in a structure, because it fixed a compiler bug
by changing the alignment of such fields, which caused ABI change.

Add -Wno-psabi to CFLAGS for such builds in order to silence the
warning. That shouldn't be a problem since we don't expose our
structures to the outside.

21 months agorem: do not include config.h
Aydın Mercan [Thu, 15 Aug 2024 12:12:15 +0000 (12:12 +0000)] 
rem: do not include config.h

The build system ensures it is always included for every source file.

Merge branch 'aydin/no-include-config-h' into 'main'

See merge request isc-projects/bind9!9320

21 months agodo not include config.h
Aydın Mercan [Thu, 15 Aug 2024 10:51:11 +0000 (13:51 +0300)] 
do not include config.h

The build system ensures it is always included for every source file.

21 months agochg: test: Reduce the size of hashmap_nodes.h file
Ondřej Surý [Thu, 15 Aug 2024 11:56:49 +0000 (11:56 +0000)] 
chg: test: Reduce the size of hashmap_nodes.h file

Instead of keeping the whole array of test_node_t objects, just keep the
hashvalues and generated the rest of the test_node_t on the fly.  The
test still works this way and the file size has been reduced from 2M to
90k.

Closes #4851

Merge branch '4851-generate-problematic-isc_hashmap-test-data' into 'main'

Closes #4851

See merge request isc-projects/bind9!9318

21 months agoReduce the size of hashmap_nodes.h file
Ondřej Surý [Thu, 15 Aug 2024 08:02:14 +0000 (10:02 +0200)] 
Reduce the size of hashmap_nodes.h file

Instead of keeping the whole array of test_node_t objects, just keep the
hashvalues and generated the rest of the test_node_t on the fly.  The
test still works this way and the file size has been reduced from 2M to
90k.

21 months agofix: Change the placement of ctor/dtor attributes in the dst_api
Ondřej Surý [Wed, 14 Aug 2024 16:21:08 +0000 (16:21 +0000)] 
fix: Change the placement of ctor/dtor attributes in the dst_api

Change the placement of the attributes to match the existing usage in
other places (after the declaration).

Merge branch 'ondrej/ISC_CONSTRUCTOR-style' into 'main'

See merge request isc-projects/bind9!9291

21 months agoChange the placement of ctor/dtor attributes in the dst_api
Ondřej Surý [Mon, 12 Aug 2024 09:55:13 +0000 (11:55 +0200)] 
Change the placement of ctor/dtor attributes in the dst_api

Change the placement of the attributes to match the existing usage in
other places (after the declaration).

21 months agochg: ci: Check that generated changelog entry doesn't break docs build
Nicki Křížek [Wed, 14 Aug 2024 15:25:26 +0000 (15:25 +0000)] 
chg: ci: Check that generated changelog entry doesn't break docs build

Since changelog entries are now generated from MR title&description,
they aren't sanity checked during a regular docs build. If these contain
special sequences that will be interpreted by sphinx, it might result in
breakage that would have to be amended manually.

Add a CI check to test a doc build with changelog after the MR is merged
to ensure that the docs can be built when generating changelog from
pristine git contents.

Related #4847

Merge branch 'nicki/add-changelog-entry-check' into 'main'

See merge request isc-projects/bind9!9294

21 months agoUse python3 in shebang lines for util scripts
Nicki Křížek [Tue, 13 Aug 2024 12:00:43 +0000 (14:00 +0200)] 
Use python3 in shebang lines for util scripts

Some distributions (notably, debian bookworm) have deprecated the
`python` interpreter in favor of `python3`. Since our scripts are
python3 anyway, use the proper numbered version in shebang to make
scripts easily executable.

21 months agoCheck that generated changelog entry doesn't break docs build
Nicki Křížek [Mon, 12 Aug 2024 12:51:31 +0000 (14:51 +0200)] 
Check that generated changelog entry doesn't break docs build

Since changelog entries are now generated from MR title&description,
they aren't sanity checked during a regular docs build. If these contain
special sequences that will be interpreted by sphinx, it might result in
breakage that would have to be amended manually.

Add a CI check to test a doc build with changelog after the MR is merged
to ensure that the docs can be built when generating changelog from
pristine git contents.

21 months agofix: dev: Fix the assertion failure in the isc_hashmap iterator
Ondřej Surý [Wed, 14 Aug 2024 15:19:11 +0000 (15:19 +0000)] 
fix: dev: Fix the assertion failure in the isc_hashmap iterator

When the round robin hashing reorders the map entries on deletion, we
were adjusting the iterator table size only when the reordering was
happening at the internal table boundary.  The iterator table size had
to be reduced by one to prevent seeing the entry that resized on
position [0] twice because it migrated to [iter->size - 1] position.

However, the same thing could happen when the same entry migrates a
second time from [iter->size - 1] to [iter->size - 2] position (and so
on) because the check that we are manipulating the entry just in the [0]
position was insufficient.  Instead of checking the position [pos == 0],
we now check that the [pos % iter->size == 0], thus ignoring all the
entries that might have moved back to the end of the internal table.

Closes #4838

Merge branch '4838-fix-assertion-failure-in-hashmap-deletion-iterator' into 'main'

Closes #4838

See merge request isc-projects/bind9!9292

21 months agoSkip already rehashed positions in the old hashmap table
Ondřej Surý [Mon, 12 Aug 2024 13:22:54 +0000 (15:22 +0200)] 
Skip already rehashed positions in the old hashmap table

When iterating through the old internal hashmap table, skip all the
nodes that have been already migrated to the new table.  We know that
all positions with index less than .hiter are NULL.

21 months agoFix the assertion failure in the isc_hashmap iterator
Ondřej Surý [Mon, 12 Aug 2024 13:17:00 +0000 (15:17 +0200)] 
Fix the assertion failure in the isc_hashmap iterator

When the round robin hashing reorders the map entries on deletion, we
were adjusting the iterator table size only when the reordering was
happening at the internal table boundary.  The iterator table size had
to be reduced by one to prevent seeing the entry that resized on
position [0] twice because it migrated to [iter->size - 1] position.

However, the same thing could happen when the same entry migrates a
second time from [iter->size - 1] to [iter->size - 2] position (and so
on) because the check that we are manipulating the entry just in the [0]
position was insufficient.  Instead of checking the position [pos == 0],
we now check that the [pos % iter->size == 0], thus ignoring all the
entries that might have moved back to the end of the internal table.

21 months agoAdd known-to-crash static hashmap iterator nodes array
Ondřej Surý [Mon, 12 Aug 2024 13:13:34 +0000 (15:13 +0200)] 
Add known-to-crash static hashmap iterator nodes array

Add second iterator test with a well-known configuration of the nodes
array that causes the last element of the array to migrate two times to
the previous node.

21 months agochg: doc: Fix ordering of gitchangelog replacement regexs
Nicki Křížek [Wed, 14 Aug 2024 15:06:08 +0000 (15:06 +0000)] 
chg: doc: Fix ordering of gitchangelog replacement regexs

Ensure the issue number in changelog isn't accidentally removed for backport MRs.

Merge branch 'nicki/fix-gitchangelog-replacement-regexs' into 'main'

See merge request isc-projects/bind9!9295

21 months agoFix ordering of gitchangelog replacement regexs
Nicki Křížek [Tue, 13 Aug 2024 08:33:02 +0000 (10:33 +0200)] 
Fix ordering of gitchangelog replacement regexs

Prior to this change, the issue number could be accidentally removed by
the `Backport of` text, depending on the order of the MR description
contents. Ensure all the removals for text in MR descriptions happen
first, and only then run the replacement regex for issue number, which
appends it to the end of the last non-empty line (which will no longer
be removed).

The only removals that happen after the replacement are guaranteed to
always happen after the end of MR description, since they're
auto-generated by gitlab when the merge commit is created, thus won't
affect the line with the issue number.

Also remove the needless isc-private/bind9 replacement. References
to private MRs are already removed by the very first regex.

21 months agofix: dev: Silence all warnings that stem from the default config
Ondřej Surý [Wed, 14 Aug 2024 12:52:01 +0000 (12:52 +0000)] 
fix: dev: Silence all warnings that stem from the default config

As we now setup the logging very early, parsing the default config would
always print warnings about experimental (and possibly deprecated)
options in the default config.  This would even mess with commands like
`named -V` and it is also wrong to warn users about using experimental
options in the default config, because they can't do anything about
this.  Add CFG_PCTX_NODEPRECATED and CFG_PCTX_NOEXPERIMENTAL options
that we can pass to cfg parser and silence the early warnings caused by
using experimental options in the default config.

Merge branch 'ondrej/silence-warnings-from-default-config' into 'main'

See merge request isc-projects/bind9!9304