2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 21:47:59 +00:00

42360 Commits

Author SHA1 Message Date
Mark Andrews
f173a01454 Fix static stub subtest description 2024-12-10 02:43:13 +00:00
Mark Andrews
eda02dc342 fix: dev: Accept resolv.conf with more than 8 search domains
Closes #1259

Merge branch '1259-irs-search-unlimited' into 'main'

See merge request isc-projects/bind9!2446
2024-12-10 01:39:04 +00:00
Petr Menšík
e7ddd3d7b4 Remove artificial search limit from libirs
Search directive from resolv.conf had a maximum of 8 domains. Any
more were ignored. Do not ignore them anymore; iterate over any
number of domains.

Test resolv.conf support by checking the first and last domain in
the search list. Ignore the domains between; just ensure that the
last domain in the configuration is the last domain parsed.
2024-12-10 00:51:56 +00:00
Mark Andrews
48901ef57e 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

Merge branch '5084-plain-unknown-keyword-in-resolv-conf-not-handled-propely' into 'main'

See merge request isc-projects/bind9!9865
2024-12-10 00:45:44 +00:00
Mark Andrews
c44c4fcbfb 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.
2024-12-09 16:09:12 -08:00
Mark Andrews
eb78ad2080 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.
2024-12-09 16:08:06 -08:00
Michal Nowak
713357456f new: test: Add Fedora 41
Prereq: isc-projects/images!345

Merge branch 'mnowak/fedora-41' into 'main'

See merge request isc-projects/bind9!9612
2024-12-09 17:19:26 +00:00
Michal Nowak
66fddf812f
Add Fedora 41 2024-12-09 17:27:13 +01:00
Michal Nowak
d22e7a8849 Add Alpine Linux 3.21
Prereq: isc-projects/images!359

Merge branch 'mnowak/alpine-3.21' into 'main'

See merge request isc-projects/bind9!9872
2024-12-09 16:25:12 +00:00
Michal Nowak
6340454ea7
Add Alpine Linux 3.21 2024-12-09 16:35:59 +01:00
Michal Nowak
107e869362 new: ci: Add FreeBSD 14.2
Merge branch 'mnowak/freebsd-14.2' into 'main'

See merge request isc-projects/bind9!9838
2024-12-09 13:35:30 +00:00
Michal Nowak
a5628101ee
Add FreeBSD 14.2 2024-12-09 14:34:43 +01:00
Ondřej Surý
f5f792f1ed rem: usr: Remove dnssec-must-be-secure feature
Closes #4482

Merge branch '4482-remove-dnssec-must-be-secure-feature' into 'main'

See merge request isc-projects/bind9!9851
2024-12-09 12:10:48 +00:00
Ondřej Surý
2089996f96
Replace remaining usage of DNS_R_MUSTBESECURE with DNS_R_NOVALIDSIG
The DNS_R_MUSTBESECURE lost its meaning with removal of
dnssec-must-be-secure option, so replace the few remaining (and a bit
confusing) use of this result code with DNS_R_NOVALIDSIG.
2024-12-09 13:10:21 +01:00
Ondřej Surý
dcd1f5b842
Remove dnssec-must-be-secure feature
The dnssec-must-be-secure feature was added in the early days of BIND 9
and DNSSEC and it makes sense only as a debugging feature.  There are no
reasons to keep this feature in the production code anymore.

Remove the feature to simplify the code.
2024-12-09 13:10:21 +01:00
Ondřej Surý
5bee088dd1 rem: usr: Remove fixed value for the rrset-order option
Remove the "fixed" value from the "rrset-order" option and from the
autoconf script.

Closes #4666

Merge branch '4666-remote-rrset-order-fixed' into 'main'

See merge request isc-projects/bind9!9852
2024-12-09 12:09:36 +00:00
Ondřej Surý
64b5c2a743
Remove fixed value for the rrset-order option
Remove the "fixed" value from the "rrset-order" option and from the
autoconf script.
2024-12-09 13:09:26 +01:00
Michal Nowak
707dded979 fix: usr: disable deterministic ecdsa for fips builds
FIPS 186-5 [1] allows the usage deterministic ECDSA (Section 6.3) which
is compabile with RFC 6979 [2] but OpenSSL seems to follow FIPS 186-4
(Section 6.3) [3] which only allows for random k values, failing
k value generation for OpenSSL >=3.2. [4]

Fix signing by not using deterministic ECDSA when FIPS mode is active.

[1]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf
[2]: https://datatracker.ietf.org/doc/html/rfc6979
[3]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf
[4]: 85f17585b0/crypto/ec/ecdsa_ossl.c (L201-L207)

Closes #5072

Merge branch '5072-the-ecdsa_determinism_test-check-fails-on-ol-9-5-fips' into 'main'

See merge request isc-projects/bind9!9808
2024-12-09 11:55:53 +00:00
Aydın Mercan
8d093a6b66 disable deterministic ecdsa for fips builds
FIPS 186-5 [1] allows the usage deterministic ECDSA (Section 6.3) which
is compabile with RFC 6979 [2] but OpenSSL seems to follow FIPS 186-4
(Section 6.3) [3] which only allows for random k values, failing
k value generation for OpenSSL >=3.2. [4]

Fix signing by not using deterministic ECDSA when FIPS mode is active.

[1]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf
[2]: https://datatracker.ietf.org/doc/html/rfc6979
[3]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf
[4]: 85f17585b0/crypto/ec/ecdsa_ossl.c (L201-L207)
2024-12-09 10:33:01 +00:00
Matthijs Mekking
6306031409 chg: dev: Use query counters in validator code
Commit af7db8951364a89c468eda1535efb3f53adc2c1f 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

Merge branch '4980-pass-counters-in-validator-createfetch' into 'main'

See merge request isc-projects/bind9!9856
2024-12-09 10:31:24 +00:00
Matthijs Mekking
5b1ae4a948 Use query counters in validator code
Commit af7db8951364a89c468eda1535efb3f53adc2c1f 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.
2024-12-09 10:55:32 +01:00
Ondřej Surý
9428077f48 chg: dev: Update picohttpparser.{c,h} with upstream repository
Closes #4485

Merge branch '4485-update-httppicoparser' into 'main'

See merge request isc-projects/bind9!9857
2024-12-08 12:28:23 +00:00
Ondřej Surý
d14a76e115 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.
2024-12-08 11:14:37 +00:00
Evan Hunt
0b287f3aaf 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

Merge branch '5061-attach-cache-fix' into 'main'

See merge request isc-projects/bind9!9787
2024-12-06 21:34:15 +00:00
Evan Hunt
f3af8a7dc3 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.
2024-12-06 12:34:33 -08:00
Ondřej Surý
de6f199f4d fix: dev: Revert "Lock and attach when returning zone stats"
Closes #5082

Merge branch '5082-lock-and-attach-when-return-zone-stats-revert' into 'main'

See merge request isc-projects/bind9!9859
2024-12-06 19:45:57 +00:00
Ondřej Surý
7a99d1baf8
Revert "Attach dnssecsignstats, rcvquerystats, and requeststats"
This reverts commit fb50a7115927e481b0a471de48dc668eb75af941.
2024-12-06 19:46:39 +01:00
Matthijs Mekking
43622594f4 chg: dev: Remove unused maxquerycount
Related to #4980

Merge branch '4980-remove-unused-maxqueryqount' into 'main'

See merge request isc-projects/bind9!9850
2024-12-06 15:18:28 +00:00
Matthijs Mekking
397ca34e34 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.
2024-12-06 11:19:18 +01:00
Michal Nowak
a17a9cb84a new: test: Add OpenBSD 7.6
Merge branch 'mnowak/openbsd-7.6' into 'main'

See merge request isc-projects/bind9!9609
2024-12-06 10:16:29 +00:00
Michal Nowak
11670b581d Add OpenBSD 7.6 2024-12-06 10:16:10 +00:00
Michal Nowak
57f5dc5e2b chg: test: Add FreeBSD 13.4
Merge branch 'mnowak/freebsd-13.4' into 'main'

See merge request isc-projects/bind9!9640
2024-12-06 09:30:17 +00:00
Michal Nowak
88b4367daa Add FreeBSD 13.4 2024-12-06 07:37:40 +00:00
Mark Andrews
3c720c6425 fix: dev: Lock and attach when returning zone stats
When returning zone statistics counters, the statistics sets are now attached while the zone is locked.  This addresses Coverity warnings CID 468720, 468728 and 468729.

Closes #4934

Merge branch '4934-lock-and-attach-when-return-zone-stats' into 'main'

See merge request isc-projects/bind9!9488
2024-12-06 05:32:05 +00:00
Mark Andrews
fb50a71159 Attach dnssecsignstats, rcvquerystats, and requeststats
In dns_zone_getdnssecsignstats, dns_zone_getrcvquerystats and
dns_zone_getrequeststats attach to the statistics structure.
2024-12-06 04:23:31 +00:00
Mark Andrews
aa686512df INSIST that the zone in locked before unlocking
This is the counterpart to the INSIST(!zone->locked) when the zone
is locked.
2024-12-06 04:23:31 +00:00
Mark Andrews
667383587b fix: dev: Finalize removal of memory debug flags size and mctx
Commit 4b3d0c66009d30f5c0bc12ee128fc59f1d853f44 has removed them, but
did not remove few traces in documentation and help. Remove them from
remaining places.

Merge branch 'main-memory-flags-size-mctx' into 'main'

See merge request isc-projects/bind9!9606
2024-12-06 03:12:29 +00:00
Petr Menšík
65b9eeb39a Finalize removal of memory debug flags size and mctx
Commit 4b3d0c66009d30f5c0bc12ee128fc59f1d853f44 has removed them, but
did not remove few traces in documentation and help. Remove them from
remaining places.
2024-12-06 02:29:20 +00:00
Mark Andrews
1435770b1a fix: usr: Fix dnssec-signzone signing non-DNSKEY RRsets with revoked keys
`dnssec-signzone` was using revoked keys for signing RRsets other than DNSKEY.  This has been corrected.

Closes #5070

Merge branch '5070-dnssec-signzone-fix-revoke' into 'main'

See merge request isc-projects/bind9!9800
2024-12-06 00:59:26 +00:00
Mark Andrews
30ef6dde05 Check dnssec-signzone behaviour with revoked keys
Only DNSKEY records should be signed with a revoked key.
2024-12-06 11:25:09 +11:00
Mark Andrews
23775c6006 Do not sign non DNSKEY RRset with revoked keys
It does not make sense to sign RRsets other than DNSKEY with revoked
keys.
2024-12-06 11:25:09 +11:00
Michal Nowak
bd0cf07e88 fix: test: ecdsa pytest rewrite fixes
Merge branch 'mnowak/ecdsa-pytest-rewrite-fixes' into 'main'

See merge request isc-projects/bind9!9823
2024-12-05 18:22:24 +00:00
Michal Nowak
1a5683b638 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.
2024-12-05 18:22:05 +00:00
Michal Nowak
2a7b8d9795 Fix skipif decorators' conditions
The ECDSA256 and ECDSA384 check conditions were switched.
2024-12-05 18:22:05 +00:00
Matthijs Mekking
fa56e0d8b1 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

Merge branch '4910-nsupdate-hangs-when-processing-large-update' into 'main'

See merge request isc-projects/bind9!9709
2024-12-05 15:13:45 +00:00
Matthijs Mekking
aa24b77d8b 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
4b7c61381f186e20a476c35032a871295ebbd385 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.
2024-12-05 15:40:48 +01:00
Matthijs Mekking
3adabb4f89 Add test case for nsupdate hangs on large update
This test case hangs, despite the update being performed on the
name server.
2024-12-05 15:40:48 +01:00
Matthijs Mekking
80a5745a1f 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

Merge branch '4980-global-limit-outgoing-queries' into 'main'

See merge request isc-projects/bind9!9737
2024-12-05 13:50:48 +00:00
Matthijs Mekking
84df920d9e 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'.
2024-12-05 14:17:08 +01:00
Matthijs Mekking
73eafaba14 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.
2024-12-05 14:17:08 +01:00