]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
21 months agoRemove 'Release notes' label check from dangerfile
Petr Špaček [Thu, 22 Aug 2024 15:21:43 +0000 (17:21 +0200)] 
Remove 'Release notes' label check from dangerfile

This label is now handled automatically by 'merged-metadata' CI job.

21 months agoRemove 'No CHANGES' check from dangerfile
Petr Špaček [Thu, 22 Aug 2024 15:17:15 +0000 (17:17 +0200)] 
Remove 'No CHANGES' check from dangerfile

This label is now handled automatically by 'merged-metadata' CI job.

21 months agoAutomatically adjust MR metadata after merge
Petr Špaček [Mon, 5 Aug 2024 08:48:34 +0000 (10:48 +0200)] 
Automatically adjust MR metadata after merge

1. Set milestone to 'Not released yet' after merge
   We will set milestone to actual version number when we actually tag a
   particular version. This will get rid of mass MR reassignment when we
   do last minute changes to a release plan etc.

2. Adjust No CHANGES and Release Notes MR labels to match gitchangelog
   workflow.

21 months agoMark backports CI job as non-interruptible
Petr Špaček [Mon, 5 Aug 2024 08:21:46 +0000 (10:21 +0200)] 
Mark backports CI job as non-interruptible

Previously CI job for the autobackport bot inherited "interruptible:
true" global configuration. This caused premature termination of the job
when another merge was finished before the autobackport job ran to
completion.

21 months agorem: usr: Remove the 'dialup' and 'heartbeat-interval' options
Evan Hunt [Thu, 22 Aug 2024 19:43:49 +0000 (19:43 +0000)] 
rem: usr: Remove the 'dialup' and 'heartbeat-interval' options

The `dialup` and `heartbeat-interval` options have been removed, along with all code implementing them. Using these options is now a fatal error.

Closes #4237

Merge branch '4237-remove-dialup' into 'main'

Closes #4237

See merge request isc-projects/bind9!8160

21 months agoremove the "dialup" and "heartbeat-interval" options
Evan Hunt [Mon, 3 Jul 2023 23:22:04 +0000 (16:22 -0700)] 
remove the "dialup" and "heartbeat-interval" options

mark "dialup" and "heartbeat-interval" options as ancient and
remove the documentation and the code implementing them.

21 months agonew: usr: implement the 'request-ixfr-max-diffs' configuration option
Arаm Sаrgsyаn [Thu, 22 Aug 2024 15:33:17 +0000 (15:33 +0000)] 
new: usr: implement the 'request-ixfr-max-diffs' configuration option

The new 'request-ixfr-max-diffs' configuration option sets the
maximum number of incoming incremental zone transfer (IXFR) differences,
exceeding which triggers a full zone transfer (AXFR).

Closes #4389

Merge branch '4389-request-ixfr-max-diffs' into 'main'

Closes #4389

See merge request isc-projects/bind9!9094

21 months agoDocument the 'request-ixfr-max-diffs' configuration option
Aram Sargsyan [Fri, 7 Jun 2024 14:51:51 +0000 (14:51 +0000)] 
Document the 'request-ixfr-max-diffs' configuration option

Document the new configuration option and its default value.

21 months agoTest the 'request-ixfr-max-diffs' configuration option
Aram Sargsyan [Fri, 7 Jun 2024 14:49:59 +0000 (14:49 +0000)] 
Test the 'request-ixfr-max-diffs' configuration option

Configure a maximum of 3 allowed differences and add 5 new records.
Check that named detected that the differences exceed the allowed
limit and successfully retries with AXFR.

21 months agoImplement the 'request-ixfr-max-diffs' configuration option
Aram Sargsyan [Fri, 7 Jun 2024 14:47:55 +0000 (14:47 +0000)] 
Implement the 'request-ixfr-max-diffs' configuration option

This limits the maximum number of received incremental zone
transfer differences for a secondary server. Upon reaching the
confgiured limit, the secondary aborts IXFR and initiates a full
zone transfer (AXFR).

21 months agonew: usr: Support restricted key tag range when generating new keys
Mark Andrews [Thu, 22 Aug 2024 12:55:46 +0000 (12:55 +0000)] 
new: usr: Support restricted key tag range when generating new keys

It is useful when multiple signers are being used
to sign a zone to able to specify a restricted
range of range of key tags that will be used by an
operator to sign the zone.  This adds controls to
named (dnssec-policy), dnssec-signzone, dnssec-keyfromlabel and
dnssec-ksr (dnssec-policy) to specify such ranges.

Closes #4830

Merge branch '4830-support-restricted-key-tag-range-when-generating-new-keys' into 'main'

Closes #4830

See merge request isc-projects/bind9!9258

21 months agoAdd bad dnssec-policy range variants test examples
Mark Andrews [Tue, 13 Aug 2024 00:32:19 +0000 (10:32 +1000)] 
Add bad dnssec-policy range variants test examples

21 months agoAdd a multi-signer where the key tag range changes
Mark Andrews [Mon, 12 Aug 2024 09:29:10 +0000 (19:29 +1000)] 
Add a multi-signer where the key tag range changes

21 months agoUse key tag ranges when generating multisigner keys
Mark Andrews [Mon, 12 Aug 2024 03:23:03 +0000 (13:23 +1000)] 
Use key tag ranges when generating multisigner keys

21 months agoCheck that dnssec-keygen honours key tag ranges
Mark Andrews [Thu, 8 Aug 2024 06:01:36 +0000 (16:01 +1000)] 
Check that dnssec-keygen honours key tag ranges

21 months agoDocument dnssec-policy keys range directive
Mark Andrews [Thu, 8 Aug 2024 03:11:40 +0000 (13:11 +1000)] 
Document dnssec-policy keys range directive

Co-authored-by: Suzanne Goldlust <sgoldlust@isc.org>
21 months agoAdd good dnssec-policy tag-range variants test examples
Mark Andrews [Thu, 8 Aug 2024 02:31:23 +0000 (12:31 +1000)] 
Add good dnssec-policy tag-range variants test examples

21 months agoCheck key tag range when matching dnssec keys to kasp keys
Mark Andrews [Wed, 7 Aug 2024 06:57:45 +0000 (16:57 +1000)] 
Check key tag range when matching dnssec keys to kasp keys

21 months agoAdd optional range directive to keys in dnssec-policy
Mark Andrews [Tue, 6 Aug 2024 04:41:50 +0000 (14:41 +1000)] 
Add optional range directive to keys in dnssec-policy

21 months agoAdd the concept of allowed key tag ranges to kasp
Mark Andrews [Tue, 6 Aug 2024 04:41:50 +0000 (14:41 +1000)] 
Add the concept of allowed key tag ranges to kasp

21 months agoDocument -M tag_min:tag_max
Mark Andrews [Wed, 7 Aug 2024 05:47:05 +0000 (15:47 +1000)] 
Document -M tag_min:tag_max

A new argument has been added to dnssec-keygen and dnssec-keyfromlabel
to restrict the tag value of key generated / imported to a particular
range.  This is intended to be used by multi-signers.

Co-authored-by: Suzanne Goldlust <sgoldlust@isc.org>
21 months agoAdd restrict key tag range support
Mark Andrews [Tue, 6 Aug 2024 04:28:08 +0000 (14:28 +1000)] 
Add restrict key tag range support

to dnssec-keygen and dnssec-keyfromlabel.

21 months agochg: ci: Revert "Workaround temporary cross-version-config-tests limitation"
Michal Nowak [Thu, 22 Aug 2024 10:20:04 +0000 (10:20 +0000)] 
chg: ci: 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.

Merge branch 'mnowak/revert-workaround-temporary-cross-version-config-tests-limitation' into 'main'

See merge request isc-projects/bind9!9065

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.