Commit Graph

41468 Commits

Author SHA1 Message Date
Mark Andrews
9fe19ffafa Fix yaml output
In yaml mode we emit a string for each question and record.  Certain
names and data could result in invalid yaml being produced.  Use single
quote string for all questions and records.  This requires that single
quotes get converted to two quotes within the string.

(cherry picked from commit 393d7fa78e)
2024-08-01 03:48:08 +00:00
Mark Andrews
b177581bb2 [9.20] chg: test: resolver system test didn't fail on all subtest errors
Closes #4774

Backport of MR !9105

Merge branch 'backport-4774-resolver-system-test-didn-t-fail-on-all-subtest-errors-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9211
2024-08-01 03:30:12 +00:00
Mark Andrews
dde9523b2b resolver system test didn't record all failures
(cherry picked from commit 5843b29f47)
2024-08-01 02:36:16 +00:00
Mark Andrews
1a1413ff59 [9.20] fix: usr: SVBC alpn text parsing failed to reject zero length alpn
Closes #4775

Backport of MR !9106

Merge branch 'backport-4775-reject-zero-length-alpn-in-alpn-fromtext-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9209
2024-08-01 01:54:38 +00:00
Mark Andrews
99701a9a36 Check invalid alpn empty value
(cherry picked from commit fa35c67301)
2024-08-01 01:10:48 +00:00
Mark Andrews
3b35a18dac Check invalid alpn produced due to missing double escapes
(cherry picked from commit a49b2a3568)
2024-08-01 01:10:48 +00:00
Mark Andrews
b4fdd2f0df Properly reject zero length ALPN in commatxt_fromtext
ALPN are defined as 1*255OCTET in RFC 9460.  commatxt_fromtext was not
rejecting invalid inputs produces by missing a level of escaping
which where later caught be dns_rdata_fromwire on reception.

These inputs should have been rejected

	svcb in svcb 1 1.svcb alpn=\,abc
	svcb1 in svcb 1 1.svcb alpn=a\,\,abc

and generated 00 03 61 62 63 and 01 61 00 02 61 62 63 respectively.

The correct inputs to include commas in the alpn requires double
escaping.

	svcb in svcb 1 1.svcb alpn=\\,abc
	svcb1 in svcb 1 1.svcb alpn=a\\,\\,abc

and generate 04 2C 61 62 63 and 06 61 2C 2C 61 62 63 respectively.

(cherry picked from commit b51c9eb797)
2024-08-01 01:10:48 +00:00
Arаm Sаrgsyаn
6d1fdb8505 [9.20] chg: dev: replace #define DNS_GETDB_ with struct of bools
Replace #define DNS_GETDB_ with struct of bools to make
it easier to pretty-print the attributes in a debugger.

Closes #4559

Backport of MR !9093

Merge branch 'backport-4559-convert-dns_getdb_x-defines-to-1-bit-long-bools-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9205
2024-07-31 16:28:57 +00:00
Aram Sargsyan
adddcde263 Replace #define DNS_GETDB_ with struct of bools
This makes it easier to pretty-print the attributes in a debugger.

(cherry picked from commit cb5238cc62)
2024-07-31 16:28:29 +00:00
Arаm Sаrgsyаn
d7e5f7903d [9.20] fix: usr: return SERVFAIL for a too long CNAME chain
When cutting a long CNAME chain, named was returning NOERROR 
instead of SERVFAIL (alongside with a partial answer). This
has been fixed.

Closes #4449

Backport of MR !9090

Merge branch 'backport-4449-return-servfail-for-a-long-cname-chain-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9203
2024-07-31 15:11:33 +00:00
Aram Sargsyan
b6372216ba Update the chain test
Update the CNAME chain test to correspond to the changed behavior,
because now named returns SERVFAIL when hitting the maximum query
restarts limit (e.g. happening when following a long CNAME chain).

In the current test auth will hit the limit and return partial data
with a SERVFAIL code, while the resolver will return no data with
a SERVFAIL code after auth returns SERVFAIL to it.

(cherry picked from commit 7751c7eca6)
2024-07-31 11:55:35 +00:00
Aram Sargsyan
21cdd8ed5b Test that a long CNAME chain causes SERVFAIL
Also check that the expected partial answer in returned too.

(cherry picked from commit 580f872fe1)
2024-07-31 11:55:35 +00:00
Aram Sargsyan
2b3ce5e514 Return SERVFAIL for a too long CNAME chain
Due to the maximum query restart limitation a long CNAME chain
it is cut after 16 queries but named still returns NOERROR.

Return SERVFAIL instead and the partial answer.

(cherry picked from commit b621f1d88e)
2024-07-31 11:55:35 +00:00
Mark Andrews
c63b7fad49 [9.20] fix: usr: Properly calculate the amount of system memory
On 32 bit machines isc_meminfo_totalphys could return an incorrect value.

Closes #4799

Backport of MR !9132

Merge branch 'backport-4799-cid-498034-overflowed-return-value-integer_overflow-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9199
2024-07-31 08:37:27 +00:00
Mark Andrews
fbcdfefd2d Properly compute the physical memory size
On a 32 bit machine casting to size_t can still lead to an overflow.
Cast to uint64_t.  Also detect all possible negative values for
pages and pagesize to silence warning about possible negative value.

    39#if defined(_SC_PHYS_PAGES) && defined(_SC_PAGESIZE)
    	1. tainted_data_return: Called function sysconf(_SC_PHYS_PAGES),
           and a possible return value may be less than zero.
    	2. assign: Assigning: pages = sysconf(_SC_PHYS_PAGES).
    40        long pages = sysconf(_SC_PHYS_PAGES);
    41        long pagesize = sysconf(_SC_PAGESIZE);
    42
    	3. Condition pages == -1, taking false branch.
    	4. Condition pagesize == -1, taking false branch.
    43        if (pages == -1 || pagesize == -1) {
    44                return (0);
    45        }
    46
    	5. overflow: The expression (size_t)pages * pagesize might be negative,
           but is used in a context that treats it as unsigned.

    CID 498034: (#1 of 1): Overflowed return value (INTEGER_OVERFLOW)
    6. return_overflow: (size_t)pages * pagesize, which might have underflowed,
       is returned from the function.
    47        return ((size_t)pages * pagesize);
    48#endif /* if defined(_SC_PHYS_PAGES) && defined(_SC_PAGESIZE) */

(cherry picked from commit e8dbc5db92)
2024-07-31 07:30:35 +00:00
Mark Andrews
be1e649974 [9.20] chg: dev: Fix data race in clean_finds_at_name
Stop updating `find.result_v4` and `find.result_v4` in `clean_finds_at_name`. The values are supposed to be		static.

Closes #4118

Backport of MR !9108

Merge branch 'backport-4118-data-race-lib-dns-adb-c-1537-in-clean_finds_at_name-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9197
2024-07-31 06:58:53 +00:00
Mark Andrews
450aa90309 Do not update find.result_v4 and find.result_v6
These values are supposed to be static for the life of the find and
clean_finds_at_name was updating them resulting in TSAN error
reports.

    WARNING: ThreadSanitizer: data race
    Write of size 4 at 0x000000000001 by thread T1 (mutexes: write M1, write M2):
      #0 clean_finds_at_name lib/dns/adb.c:1537
      #1 fetch_callback lib/dns/adb.c:4009
      #2 task_run lib/isc/task.c:815
      #3 isc_task_run lib/isc/task.c:896
      #4 isc__nm_async_task netmgr/netmgr.c:848
      #5 process_netievent netmgr/netmgr.c:920
      #6 process_queue netmgr/netmgr.c:1013
      #7 process_all_queues netmgr/netmgr.c:767
      #8 async_cb netmgr/netmgr.c:796
      #9 uv__async_io /usr/src/libuv-v1.44.1/src/unix/async.c:163
      #10 isc__trampoline_run lib/isc/trampoline.c:189

    Previous read of size 4 at 0x000000000001 by thread T2:
      #0 findname lib/dns/resolver.c:3749
      #1 fctx_getaddresses lib/dns/resolver.c:3993
      #2 fctx_try lib/dns/resolver.c:4390
      #3 rctx_nextserver lib/dns/resolver.c:10356
      #4 rctx_done lib/dns/resolver.c:10503
      #5 resquery_response lib/dns/resolver.c:8511
      #6 udp_recv lib/dns/dispatch.c:638
      #7 isc__nm_async_readcb netmgr/netmgr.c:2885
      #8 isc__nm_readcb netmgr/netmgr.c:2858
      #9 udp_recv_cb netmgr/udp.c:650
      #10 isc__nm_udp_read_cb netmgr/udp.c:1057
      #11 uv__udp_recvmsg /usr/src/libuv-v1.44.1/src/unix/udp.c:303
      #12 isc__trampoline_run lib/isc/trampoline.c:189

(cherry picked from commit 53a5f50e9d)
2024-07-31 06:20:45 +00:00
Mark Andrews
4d292fc37f [9.20] fix: test: Prevent intermittent setup.sh failures in the "statschannel" system test
Don't verify the just signed zone as the RRSIGs could have expired before the signing process completes

Closes #4781 #2476

Backport of MR !9114

Merge branch 'backport-4781-statschannel-setup-can-fail-due-to-short-validity-interval-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9195
2024-07-31 06:07:29 +00:00
Mark Andrews
5b7134c9d5 Disable post zone verification for manykeys
As the expiration time is now+1 the RRSIG records may expire before
the verification step happens.

(cherry picked from commit 0d69afd764)
2024-07-31 04:47:33 +00:00
Matthijs Mekking
761b47a648 [9.20] chg: test: fix intermittent test failure dnssec system test
Closes #4768

Backport of MR !9101

Merge branch 'backport-4768-dnssec-test-is-broken-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9193
2024-07-30 13:24:18 +00:00
Matthijs Mekking
9be1126cd2 Fix intermittent test failure dnssec system test
The updatecheck-kskonly.secure zone is being used to test dynamic
updates while the KSK is offline. It ensures that the DNSKEY RRset
will retain the RRSIG record, while the updated data is being signed
with the currently active ZSK.

When walking through ZSK rollovers, ensure that the newest ZSK (ZSK3)
is published before doing the dynamic update, preventing timing
related test failures.

Also fix the test log line ($ZSK_ID3 was not yet created at the time
of logging).

(cherry picked from commit e874632488)
2024-07-30 12:06:16 +00:00
Matthijs Mekking
a5f554959e [9.20] fix: usr: Update key lifetime and metadata after dnssec-policy reconfig
Adjust key state and timing metadata if dnssec-policy key lifetime configuration is updated, so that it also
affects existing keys.

Closes #4677

Backport of MR !9118

Merge branch 'backport-4677-dnssec-policy-key-lifetime-reconfigure-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9191
2024-07-30 11:11:55 +00:00
Mark Andrews
45e49640ce Log key calculation overflows
(cherry picked from commit 14a76ae498)
2024-07-30 10:22:48 +00:00
Mark Andrews
edb1df856e Check for overflow when adding lifetime
(cherry picked from commit 25845a866e)
2024-07-30 10:22:48 +00:00
Matthijs Mekking
b489e267d4 No longer update key lifetime if key is retired
The key lifetime should no longer be adjusted if the key is being
retired earlier, for example because a manual rollover was started.

This would falsely be seen as a dnssec-policy lifetime reconfiguration,
and would adjust the retire/removed time again.

This also means we should update the status output, and the next
rollover scheduled is now calculated using (retire-active) instead of
key lifetime.

(cherry picked from commit 129973ebb0)
2024-07-30 10:22:48 +00:00
Matthijs Mekking
bfb29acc7f Update key lifetime and metadata after reconfig
If dnssec-policy is reconfigured and the key lifetime has changed,
update existing keys with the new lifetime and adjust the retire
and removed timing metadata accordingly.

If the key has no lifetime yet, just initialize the lifetime. It
may be that the retire/removed timing metadata has already been set.

Skip keys which goal is not set to omnipresent. These keys are already
in the progress of retiring, or still unused.

(cherry picked from commit 1cec0b0448)
2024-07-30 10:22:48 +00:00
Matthijs Mekking
671414ba42 Test updating dnssec-policy key lifetime
Check if the key lifetime is updated in the key files. Make sure the
inactive and removed timing metadata are adjusted accordingly.

(cherry picked from commit 2237895bb4)
2024-07-30 10:22:48 +00:00
Matthijs Mekking
1da982e6d0 Move dnssec-policy to kasp-fips.conf.in
All dnssec-policy configurations are here, so why not this one?

(cherry picked from commit 93326e3e18)
2024-07-30 10:22:48 +00:00
Matthijs Mekking
75e3154df9 [9.20] fix: doc: Fix typo in key-store reference rst
Closes #4813

Backport of MR !9176

Merge branch 'backport-4813-fix-typo-in-reference-rst-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9189
2024-07-30 09:40:45 +00:00
Suzanne Goldlust
ab790d7092 Fix backslashes on key-store block
(cherry picked from commit 645cd0496e)
2024-07-30 08:45:35 +00:00
Nicki Křížek
d2afa7f07d [9.20] chg: test: Retry job in case of AWS Spot Instance interruption event
Closes #4777

Backport of MR !9107

Merge branch '4777-retry-job-aws-spot-instance-interruption-event-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9184
2024-07-29 14:52:03 +00:00
Emanuel Petr
d4690abd06 Retry job in case of AWS Spot Instance interruption
(cherry picked from commit bbcce1bfc1)
2024-07-29 13:26:49 +00:00
Nicki Křížek
cf60eb2738 [9.20] new: dev: generate changelog from git log
Use a single source of truth, the git log, to generate the list of CHANGES. Use the .rst format and include it in the ARM for a quick reference with proper gitlab links to issues and merge requests.

Closes #75

Backport of MR !9152

Merge branch 'nicki/add-gitchangelog-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9180
2024-07-29 13:22:25 +00:00
Nicki Křížek
e9780d55bf Update docs and processes to use the new changelog
(cherry picked from commit bcc99213a5)
2024-07-29 14:44:59 +02:00
Nicki Křížek
98f7d68062 Update dangerfile for new changelog workflow
(cherry picked from commit 91be111dc7)
2024-07-29 14:44:59 +02:00
Nicki Křížek
96767a9cf6 Skip pylint checks for contrib directory
The files in contrib/ directory shouldn't be subject to our pylint
check. They can come from external sources and we don't subject these to
the same standards as the rest of the BIND9 code / scripts.

(cherry picked from commit 7cbb052649)
2024-07-29 14:44:59 +02:00
Nicki Křížek
417066f792 Remove changes job and related scripts
These are no longer needed, since changelog is generated using
gitchangelog.

(cherry picked from commit 3f1a843695)
2024-07-29 14:44:59 +02:00
Nicki Křížek
9beffa5a8d Add BIND9 configuration for gitchangelog
The configuration has been crafted to cater for BIND9 needs:
- Define actions that have an equivalent section in existing Release
  Notes
- Assume the commits that have the necessary changelog makrup are merge
  commits from GitLab and transform them into messages and proper links
- Put the resulting changelog into the proper place in
  doc/arm/changelog.rst
- Have a separate configuration for changelog and release notes. Both of
  these should be generated from the `git log`, with release notes being
  subject to more scrutiny and further editing

(cherry picked from commit 0ec8b99ea3)
2024-07-29 14:44:57 +02:00
Nicki Křížek
1e4bccf250 Add new changelog file
Create new changelog and include it in the documentation. Include the
previous CHANGES as plain text without any markup.

(cherry picked from commit e9b6031e0c)
2024-07-29 14:44:39 +02:00
Nicki Křížek
c6119b5513 Address gitchangelog deprecation warning
(cherry picked from commit 951280bca5)
2024-07-29 12:34:03 +00:00
Nicki Křížek
d4a76252f0 Adjust gitchangelog whitespace
Format the output to produce a nicer looking rst output, similar to the
former CHANGES file.

(cherry picked from commit 1c95eeeb3f)
2024-07-29 12:34:03 +00:00
Nicki Křížek
6c7a0b1a94 Allow gitchangelog to include commit sha
Add an option which can be used to put short commit sha at the end of
each commit subject line in the generated changelog.

(cherry picked from commit c2b23fa2de)
2024-07-29 12:34:03 +00:00
Nicki Křížek
226bd5cfe0 Remove authors from gitchangelog output
Given our workflow, this could easily lead to misattribution. It's also
not an actionable information and it can be found in the MR / git log
instead.

(cherry picked from commit a8258d1c53)
2024-07-29 12:34:03 +00:00
Nicki Křížek
e0feedcab7 Reformat gitchangelog with black
(cherry picked from commit 9f90c1c65e)
2024-07-29 12:34:03 +00:00
Nicki Křížek
f64aaf1a40 Import gitchanglog 3.0.4
The  project hasn't seen any new development/changes since 2018 and it
seems unlikely we'd be able to get any changes into the upstream. Since
it's isolated into a single file and its task is fairly straighforward,
pull the code into our own repository and maintain it here as needed.

This also makes it easier to make any changes that are specific to our
project.

(cherry picked from commit 63247d8a73)
2024-07-29 12:34:02 +00:00
Nicki Křížek
7e210d9212 Set up version and release notes for BIND 9.20.1
Merge branch 'nicki/set-up-version-and-release-notes-for-bind-9.20.1' into 'bind-9.20'

See merge request isc-projects/bind9!9167
2024-07-23 16:37:23 +00:00
Nicki Křížek
856d73003b Set up release notes for BIND 9.20.1 2024-07-23 17:49:29 +02:00
Nicki Křížek
71d137939d Update BIND version to 9.20.1-dev 2024-07-23 17:49:28 +02:00
Nicki Křížek
03e289030e Merge tag 'v9.20.0' 2024-07-23 17:15:41 +02:00
Nicki Křížek
14bbdfc7b9 Update BIND version to 9.20.0 v9.20.0 2024-07-08 15:01:00 +02:00