Commit Graph

42093 Commits

Author SHA1 Message Date
Mark Andrews
08aefa5a6b [9.20] chg: test: Use a different burst name to identify test queries
This allows easier identification of which burst is which in
named.run.

Backport of MR !9881

Merge branch 'backport-marka-use-different-burst-name-for-forensics-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9882
2024-12-10 23:51:43 +00:00
Mark Andrews
4bc7d505e8 Use a different burst name to identify test queries
This allows easier identification of which burst is which in
named.run.

(cherry picked from commit e02d66b279)
2024-12-10 21:55:31 +00:00
Ondřej Surý
fed5e55e33 [9.20] fix: dev: mark loop as shuttingdown earlier in shutdown_cb
Backport of MR !9827

Merge branch 'backport-loop-shuttingdown-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9891
2024-12-10 20:27:40 +00:00
Pavel Březina
93bef0ea28 mark loop as shuttingdown earlier in shutdown_cb
`shutdown_trigger_close_cb` is not called in the main loop since
queued events in the `loop->async_trigger`, including loop teardown
(shutdown_server) are processed first, before the `uv_close` callback
is executed..

In order to pass the information to the queued events, it is necessary
to set the flag earlier in the process and not wait for the `uv_close`
callback to trigger.

(cherry picked from commit 67e21d94d4)
2024-12-10 19:52:13 +00:00
Colin Vidal
e260eb39c5 [9.20] chg: usr: Add none parameter to query-source and query-source-v6 to disable IPv4 or IPv6 upstream queries
Add a none parameter to named configuration option `query-source`
(respectively `query-source-v6`) which forbid usage of IPv4
(respectively IPv6) addresses when named is doing an upstream query.

Closes #4981 Turning-off upstream IPv6 queries while still listening
to downstream queries on IPv6.

Merge branch 'colin/querysource-none' into 'main'

See merge request isc-projects/bind9!9727

Backport of MR: !9727

Merge branch 'backport-querysource-none-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9775
2024-12-10 11:34:17 +00:00
Colin Vidal
32f5b69703 Add none parameter to query-source and query-source-v6 to disable IPv4 or IPv6 upstream queries
Add a none parameter to named configuration option `query-source` (respectively `query-source-v6`) which forbid usage of IPv4 (respectively IPv6) addresses when named is doing an upstream query.

Closes #4981 Turning-off upstream IPv6 queries while still listening to downstream queries on IPv6.

Merge branch 'colin/querysource-none' into 'main'

See merge request isc-projects/bind9!9727

Backport of MR !9727

Some changes had to be done to the existing 9.20.x code in order to
make this backport compatible:

- first, the 9.20.x branches support the `port` parameter in
  query-source[-v6], where 9.21.x does not. The original changes
  depend on things that can't be backported because that would break
  `port` support.

- second, the changes remove the optional `address` parameter from the
  canonical form. So `query-source address <ip>` is now printed as
  `query-source <ip>`. This means that `named-checkconf -p` will now
  generate different output if users have `query-source address <ip>` or
  `query-source address <ip> port <port>`; it will now generate
  `query-source <ip>` or `query-source <ip> port <port>`. This is a
  non-breaking change, because the parser has been updated to support
  this form as well.
2024-12-10 11:58:20 +01:00
Michal Nowak
efbfa541b5 [9.20] fix: ci: Set cross-version-config-tests to allow_failure in CI
Address failing cross-version-config-tests job.

Closes #5087

Backport of MR !9833

Merge branch 'backport-mnowak/cross-version-config-tests-allow-fail-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9886
2024-12-10 10:21:38 +00:00
Michal Nowak
1766e4df20 Set cross-version-config-tests to allow_failure in CI
The December releases suffer from the ns2/managed1.conf file not being
in the mkeys extra_artifacts. This manifests only when pytest is run
with the --setup-only option, which is the case in the
cross-version-config-tests CI job. The original issue is fixed in !9815,
but the fix will be effective only when subsequent releases are out.

(cherry picked from commit 97a9d7287c)
2024-12-10 11:08:57 +01:00
Matthijs Mekking
87f70696c8 [9.20] rem: dev: Drop single-use RETERR macro
If the RETERR define is only used once in a file, just drop the macro.

Backport of MR !9871

Merge branch 'backport-matthijs-remove-single-use-define-reterr-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9885
2024-12-10 09:22:53 +00:00
Matthijs Mekking
551d1dd67d Drop single-use RETERR macro
If the RETERR define is only used once in a file, just drop the macro.

(cherry picked from commit b6d031462f)
2024-12-10 08:47:25 +00:00
Mark Andrews
f15a35bfdd [9.20] fix: test: Fix static stub subtest description
This subtest exercises static stub behaviour when server-addresses has an address.  This was misidentified in the description.

Closes !9799

Backport of MR !9799

Merge branch 'backport-marka-fix-stub-subtest-description-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9879
2024-12-10 03:53:00 +00:00
Mark Andrews
6177eb8c5b Fix static stub subtest description
(cherry picked from commit f173a01454)
2024-12-10 03:16:33 +00:00
Mark Andrews
7738fd28c9 [9.20] fix: usr: Unknown directive in resolv.conf not handled properly
The line after an unknown directive in resolv.conf could accidentally be skipped, potentially affecting dig, host, nslookup, nsupdate, or delv. This has been fixed.

Closes #5084

Backport of MR !9865

Merge branch 'backport-5084-plain-unknown-keyword-in-resolv-conf-not-handled-propely-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9877
2024-12-10 01:24:51 +00:00
Mark Andrews
ff6db0bea4 Extend resconf_test
Update to the new unit test framework.

Add a test for an unknown directive without any arguments.

Add test for an unknown directive without arguments, followed
by a search directive.

(cherry picked from commit c44c4fcbfb)
2024-12-10 00:49:07 +00:00
Mark Andrews
722e6689f5 Fix parsing of unknown directives in resolv.conf
Only call eatline() to skip to the next line if we're not
already at the end of a line when parsing an unknown directive.
We were accidentally skipping the next line when there was only
a single unknown directive on the current line.

(cherry picked from commit eb78ad2080)
2024-12-10 00:49:06 +00:00
Michal Nowak
e6f773c84f [9.20] new: test: Add Fedora 41
Prereq: isc-projects/images!345

Backport of MR !9612

Merge branch 'backport-mnowak/fedora-41-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9875
2024-12-09 17:59:45 +00:00
Michal Nowak
f360aa82f0 Add Fedora 41
(cherry picked from commit 66fddf812f)
2024-12-09 17:20:32 +00:00
Michal Nowak
0b1e257bb6 [9.20] new: test: Add Alpine Linux 3.21
Prereq: isc-projects/images!359

Backport of MR !9872

Merge branch 'backport-mnowak/alpine-3.21-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9873
2024-12-09 17:18:43 +00:00
Michal Nowak
a04e97fb7c Add Alpine Linux 3.21
(cherry picked from commit 6340454ea7)
2024-12-09 16:26:30 +00:00
Michal Nowak
db17c54e54 [9.20] new: ci: Add FreeBSD 14.2
Backport of MR !9838

Merge branch 'backport-mnowak/freebsd-14.2-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9869
2024-12-09 13:42:00 +00:00
Michal Nowak
d57c5f5312 Add FreeBSD 14.2
(cherry picked from commit a5628101ee)
2024-12-09 13:37:56 +00:00
Michal Nowak
227b829efe [9.20] fix: ci: tests: Use FIPS compatible DH-param files
When the tests were added, the files were generated without FIPS
compatibility in mind. That made the tests fail on recent OpenSSL
versions in FIPS mode.

So, the files were regenerated on a FIPS compliant system using the
following stanza:

```
$ openssl dhparam -out <file> 3072
```

Apparently, the old files are not valid for FIPS starting with OpneSSL
3.1.X release series as "FIPS 140-3 compliance changes" are mentioned
in the [changelog](https://openssl-library.org/news/openssl-3.1-notes/).

Closes #5074.

Backport of MR !9807

Merge branch 'backport-5074-fips-compatible-dhparams-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9868
2024-12-09 12:53:19 +00:00
Artem Boldariev
17dd30ec52 Use FIPS compatible DH-param files
When the tests were added, the files were generated without FIPS
compatibility in mind. That made the tests fail on recent OpenSSL
versions in FIPS mode.

So, the files were regenerated on a FIPS compliant system using the
following stanza:

$ openssl dhparam -out <file> 3072

Apparently, the old files are not valid for FIPS starting with OpneSSL
3.1.X release series as "FIPS 140-3 compliance changes" are mentioned
in the changelog:

https://openssl-library.org/news/openssl-3.1-notes/
(cherry picked from commit 384c92880e)
2024-12-09 12:00:49 +00:00
Matthijs Mekking
d91835160a [9.20] chg: dev: Use query counters in validator code
Commit af7db89513 as part of #4141 was supposed to apply the 'max-recursion-queries' quota to validator queries, but the counter was never actually passed on to 'dns_resolver_createfetch()'. This has been fixed, and the global query counter ('max-query-count', per client request) is now also added.

Related to #4980

Backport of MR !9856

Merge branch 'backport-4980-pass-counters-in-validator-createfetch-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9866
2024-12-09 11:41:29 +00:00
Matthijs Mekking
e96d6ee85f Use query counters in validator code
Commit af7db89513 as part of #4141 was
supposed to apply the 'max-recursion-queries' quota to validator
queries, but the counter was never actually passed on to
dns_resolver_createfetch(). This has been fixed, and the global query
counter ('max-query-count', per client request) is now also added.

(cherry picked from commit 5b1ae4a948)
2024-12-09 11:41:19 +00:00
Alessio Podda
67fa22a774 [9.20] chg: dev: Optimize memory layout of core structs
Reduce memory footprint by:
- Reordering struct fields to minimize padding.
- Using exact-sized atomic types instead of `*_least`/`*_fast` variants
- Downsizing integer fields where possible

Affected structs:
- dns_name_t
- dns_slabheader_t 
- dns_rdata_t
- qpcnode_t
- qpznode_t

Closes #5022

Backport of MR !9721

Merge branch 'backport-5022-reduce-metadata-overhead-by-struct-packing-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9793
2024-12-09 10:44:42 +00:00
Alessio Podda
1edf405add Optimize memory layout of core structs
Reduce memory footprint by:

 - Reordering struct fields to minimize padding.
 - Using exact-sized atomic types instead of *_least/*_fast variants
 - Downsizing integer fields where possible

Affected structs:

 - dns_name_t
 - dns_slabheader_t
 - dns_rdata_t
 - qpcnode_t
 - qpznode_t

(cherry picked from commit 32c7060bd2)
2024-12-09 09:04:28 +01:00
Ondřej Surý
3c9657a3f4 [9.20] chg: dev: Update picohttpparser.{c,h} with upstream repository
Closes #4485

Backport of MR !9857

Merge branch 'backport-4485-update-httppicoparser-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9863
2024-12-08 13:15:51 +00:00
Ondřej Surý
476757770b Update picohttpparser.{c,h} with upstream repository
Upstream code doesn't do regular releases, so we need to regularly
sync the code from the upstream repository.  This is synchronization up
to the commit f8d0513 from Jan 29, 2024.

(cherry picked from commit d14a76e115)
2024-12-08 12:30:07 +00:00
Ondřej Surý
d954d9c20b [9.20] fix: dev: Revert "Lock and attach when returning zone stats"
Closes #5082

Backport of MR !9859

Merge branch 'backport-5082-lock-and-attach-when-return-zone-stats-revert-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9860
2024-12-08 11:39:08 +00:00
Ondřej Surý
81d661ffc0 Revert "Attach dnssecsignstats, rcvquerystats, and requeststats"
This reverts commit fb50a71159.

(cherry picked from commit 7a99d1baf8)
2024-12-08 12:03:12 +01:00
Evan Hunt
826dfa006e [9.20] fix: usr: Preserve cache across reconfig when using attach-cache
When the `attach-cache` option is used in the `options` block with an arbitrary name, it causes all views to use the same cache. Previously, this configuration caused the cache to be deleted and a new cache created every time the server was reconfigured. This has been fixed.

Closes #5061

Backport of MR !9787

Merge branch 'backport-5061-attach-cache-fix-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9862
2024-12-07 02:55:17 +00:00
Evan Hunt
f7d67710e2 preserve cache across reload when using attach-cache
when the attach-cache option is used in the options block
with an arbitrary name, it causes all views to use the same
cache. however, previously, this could cause the cache to be
deleted and a new cache created every time the server was
reconfigured. this did *not* occur when attach-cache was
used at the view level to refer back to another view's cache.

in this commit we correct the problem by checking for
pre-existing caches during reconfiguration, and moving
them from the old server cache list to the new cache list
before cleaning up and freeing the old cache list.

(cherry picked from commit f3af8a7dc3)
2024-12-06 18:19:54 -08:00
Matthijs Mekking
d61bfeb91e [9.20] chg: dev: Remove unused maxquerycount
Related to #4980

Backport of MR !9850

Merge branch 'backport-4980-remove-unused-maxqueryqount-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9853
2024-12-06 16:17:19 +00:00
Matthijs Mekking
9af97fd0fe Remove unused maxquerycount
While implementing the global limit 'max-query-count', initially I
thought adding the variable to the resolver structure. But the limit
is per client request so it was moved to the view structure (and
counter in ns_query structure). However, I forgot to remove the
variable from the resolver structure again. This commit fixes that.

(cherry picked from commit 397ca34e34)
2024-12-06 15:18:56 +00:00
Michal Nowak
aafafbbd22 [9.20] new: test: Add OpenBSD 7.6
Backport of MR !9609

Merge branch 'backport-mnowak/openbsd-7.6-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9848
2024-12-06 13:34:08 +00:00
Michal Nowak
83178557b4 Add OpenBSD 7.6
(cherry picked from commit 11670b581d)
2024-12-06 10:17:12 +00:00
Michal Nowak
b2c60b8401 [9.20] chg: test: Add FreeBSD 13.4
Backport of MR !9640

Merge branch 'backport-mnowak/freebsd-13.4-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9845
2024-12-06 10:08:28 +00:00
Michal Nowak
2b7ed7fde8 Add FreeBSD 13.4
(cherry picked from commit 88b4367daa)
2024-12-06 09:32:08 +00:00
Matthijs Mekking
4ca7a5d601 [9.20] fix: usr: Fix nsupdate hang when processing a large update
To mitigate DNS flood attacks over a single TCP connection, we throttle the connection when the other side does not read the data. Throttling should only occur on server-side sockets, but erroneously also happened for nsupdate, which acts as a client. When nsupdate started throttling the connection, it never attempts to read again. This has been fixed.
 
Closes #4910

Backport of MR !9709

Merge branch 'backport-4910-nsupdate-hangs-when-processing-large-update-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9834
2024-12-06 08:31:28 +00:00
Matthijs Mekking
a7b291adc7 Fix nsupdate hang when processing a large update
The root cause is the fix for CVE-2024-0760 (part 3), which resets
the TCP connection on a failed send. Specifically commit
4b7c61381f stops reading on the socket
because the TCP connection is throttling.

When the tcpdns_send_cb callback thinks about restarting reading
on the socket, this fails because the socket is a client socket.
And nsupdate is a client and is using the same netmgr code.

This commit removes the requirement that the socket must be a server
socket, allowing reading on the socket again after being throttled.

(cherry picked from commit aa24b77d8b)
2024-12-06 08:31:19 +00:00
Matthijs Mekking
cc004b2b8f Add test case for nsupdate hangs on large update
This test case hangs, despite the update being performed on the
name server.

(cherry picked from commit 3adabb4f89)
2024-12-06 08:31:19 +00:00
Michal Nowak
336e9c746e [9.20] fix: test: ecdsa pytest rewrite fixes
Backport of MR !9823

Merge branch 'backport-mnowak/ecdsa-pytest-rewrite-fixes-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9837
2024-12-06 07:08:34 +00:00
Michal Nowak
dffcf1226c Use os.getenv() instead of os.environ
If ECDSAP256SHA256_SUPPORTED or ECDSAP384SHA384_SUPPORTED variables were
not present in the environment, os.environ would raise KeyError that is
not being handled in the decorator. Use os.getenv() instead.

(cherry picked from commit 1a5683b638)
2024-12-06 07:06:31 +00:00
Michal Nowak
85176a62ca Fix skipif decorators' conditions
The ECDSA256 and ECDSA384 check conditions were switched.

(cherry picked from commit 2a7b8d9795)
2024-12-06 07:06:31 +00:00
Mark Andrews
844a531053 [9.20] new: usr: Add a new option to configure the maximum number of outgoing queries per client request
The configuration option 'max-query-count' sets how many outgoing queries per client request is allowed. The existing 'max-recursion-queries' is the number of permissible queries for a single name and is reset on every CNAME redirection. This new option is a global limit on the client request. The default is 200.

This allows us to send a bit more queries while looking up a single name. The default for 'max-recursion-queries' is changed from 32 to 50.

Closes #4980 
Closes #4921

Backport of MR !9737

Merge branch 'backport-4980-global-limit-outgoing-queries-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9832
2024-12-06 06:59:18 +00:00
Matthijs Mekking
dd098a4b3b Change default max-recursion-queries to 50
Changing the default for max-recursion-queries from 100 to 32 was too
strict in some cases, especially lookups in reverse IPv6 trees started
to fail more frequently. From issue #4921 it looks like 50 is a better
default.

Now that we have 'max-query-count' as a global limit of outgoing queries
per client request, we can increase the default for
'max-recursion-queries' again, as the number of recursive queries is
no longer bound by the multiple of 'max-recursion-queries' and
'max-query-restarts'.

(cherry picked from commit 84df920d9e)
2024-12-06 06:20:33 +00:00
Matthijs Mekking
1d7ddb5ec4 Add a CAMP test case
This adds a new test directory specifically for CAMP attacks. This first
test in this test directory follows multiple CNAME chains, restarting
the max-recursion-queries counter, but should bail when the global
maximum quota max-query-count is reached.

(cherry picked from commit 73eafaba14)
2024-12-06 06:20:33 +00:00
Matthijs Mekking
63e5f295fb Add +maxtotalqueries option to delv
The max-query-count value can now be set on the command line in delv
with +maxtotalqueries.

(cherry picked from commit 74f845d62f)
2024-12-06 06:20:33 +00:00
Matthijs Mekking
492f79560d Implement global limit for outgoing queries
This global limit is not reset on query restarts and is a hard limit
for any client request.

(cherry picked from commit 16b3bd1cc7)
2024-12-06 06:20:33 +00:00