Commit Graph

41486 Commits

Author SHA1 Message Date
Aram Sargsyan
3e7689fc23 Test shorter resolver-query-timeout configuration
Add two new checks which test the shorter than usual
resolver-query-timeout configuration.

(cherry picked from commit d6a79cce53)
2024-08-01 19:23:06 +00:00
Aram Sargsyan
003cb48f0f Allow shorter resolver-query-timeout configuration
There are use cases for which shorter timeout values make sense.
For example if there is a load balancer which sets RD=1 and
forwards queries to a BIND resolver which is then configured to
talk to backend servers which are not visible in the public NS set.
WIth a shorter timeout value the frontend can give back SERVFAIL
early when backends are not available and the ultimate client will
not penalize the BIND-frontend for non-response.

(cherry picked from commit 5f47c2b567)
2024-08-01 19:23:06 +00:00
Arаm Sаrgsyаn
008bfb6249 [9.20] new: usr: implement rndc retransfer -force
A new optional argument '-force' has been added to the command channel
command 'rndc retransfer'. When it is specified, named aborts the
ongoing zone transfer (if there is one), and starts a new transfer.

Closes #2299

Backport of MR !9102

Merge branch 'backport-2299-implement-rndc-force-retransfer-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9219
2024-08-01 19:12:25 +00:00
Aram Sargsyan
aa6e388591 Rename dns_zone_forcereload() to dns_zone_forcexfr()
The new name describes the function more accurately.

(cherry picked from commit 63b8a75de9)
2024-08-01 17:04:27 +00:00
Aram Sargsyan
28cd7bc666 Test rndc retransfer -force
Use a big zone and the slow transfer mode. Initiate a retransfer, wait
several seconds, then initiate a retransfer using a '-force' argument,
which should cancel the previous transfer and start a new one.

(cherry picked from commit e48f4e8101)
2024-08-01 17:04:27 +00:00
Aram Sargsyan
c76d083d4d Make dns_xfrin_shutdown() safe to run from a different loop
If the current loop is different than the zone transfer's loop then
run the shutdown operation asynchronously.

(cherry picked from commit 3d1179501a)
2024-08-01 17:04:27 +00:00
Aram Sargsyan
2886a08c1f Implement rndc retransfer -force
With this new optional argument if there is an ongoing zone
transfer it will be aborted before a new zone transfer is scheduled.

(cherry picked from commit 402ca316ae)
2024-08-01 17:04:27 +00:00
Aram Sargsyan
b6721db490 Do not automatically restart a canceled zone transfer
If a zone transfer is canceled there is no need to try the
next primary or retry with AXFR.

(cherry picked from commit b156531b29)
2024-08-01 17:04:27 +00:00
Mark Andrews
00ce93a69c [9.20] fix: usr: fix generation of 6to4-self name expansion from IPv4 address
The period between the most significant nibble of the encoded IPv4 address and the 2.0.0.2.IP6.ARPA suffix was missing resulting in the wrong name being checked. Add system test for 6to4-self implementation.

Closes #4766

Backport of MR !9099

Merge branch 'backport-4766-add-system-test-for-6to4-self-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9217
2024-08-01 07:31:25 +00:00
Mark Andrews
c55d89f9d1 check 'update-policy 6to4-self' over IPv6
(cherry picked from commit 3b0de4773b)
2024-08-01 06:41:47 +00:00
Mark Andrews
c92b05c0e2 check 'update-policy 6to4-self' over IPv4
(cherry picked from commit b28e5ff721)
2024-08-01 06:41:47 +00:00
Mark Andrews
fc350f311a Add missing period to generated IPv4 6to4 name
The period between the most significant nibble of the IPv4 address
and the 2.0.0.2.IP6.ARPA suffix was missing resulting in the wrong
name being checked.

(cherry picked from commit bca63437a1)
2024-08-01 06:41:47 +00:00
Mark Andrews
fb07c38697 [9.20] fix: usr: fix false QNAME minimisation error being reported
Remove the false positive "success resolving" log message when QNAME minimisation is in effect and the final result is NXDOMAIN.

Closes #4784

Backport of MR !9117

Merge branch 'backport-4784-false-qname-minimisation-error-being-reported-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9215
2024-08-01 06:21:14 +00:00
Mark Andrews
eb7d784544 Test that false positive "success resolving" is not logged
(cherry picked from commit 111e285214)
2024-08-01 05:24:00 +00:00
Mark Andrews
eea196fc78 Cleanup old clang-format string splitting
(cherry picked from commit 6d1c7beb15)
2024-08-01 05:24:00 +00:00
Mark Andrews
2789554dec Remove false positive qname minimisation error
Don't report qname minimisation NXDOMAIN errors when the result is
NXDOMAIN.

(cherry picked from commit f78beca942)
2024-08-01 05:24:00 +00:00
Mark Andrews
a42afbce2e [9.20] fix: usr: Dig +yaml was producing unexpected and/or invalid YAML output
Closes #4796

Backport of MR !9127

Merge branch 'backport-4796-yaml-stringify-question-and-records-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9213
2024-08-01 04:31:49 +00:00
Mark Andrews
b91eb0e524 Test yaml output with yaml specials
(cherry picked from commit fadf461761)
2024-08-01 03:48:08 +00:00
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