2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 14:07:59 +00:00
Commit Graph

37503 Commits

Author SHA1 Message Date
Petr Špaček
baa71c5181 Remove unused lib/dns/tsec
dns_tsec API is not referenced anywhere, remove it.
This is a leftover after dns_client cleanup.

Related: !4835
2022-10-25 10:35:07 +02:00
Evan Hunt
d43041b45b Merge branch '3620-disable-doh-crash' into 'main'
Fix an error when building with --disable-doh

Closes #3620

See merge request isc-projects/bind9!6978
2022-10-25 04:54:56 +00:00
Evan Hunt
67c0128ebb Fix an error when building with --disable-doh
The netievent handler for isc_nmsocket_set_tlsctx() was inadvertently
ifdef'd out when BIND was built with --disable-doh, resulting in an
assertion failure on startup when DoT was configured.
2022-10-24 13:54:39 -07:00
Tom Krizek
b586aac433 Merge branch '3517-serve-stale-cache-timeout-0-test' into 'main'
[CVE-2022-3080] Test serve stale cache with timeout 0 and CNAME

See merge request isc-projects/bind9!6975
2022-10-24 12:50:51 +00:00
Tom Krizek
6295572b05 Remove misleading comment from serve-stale test
The stale-answer-client-timeout option is not set to 0 in the config
neither is it the default value. This was probably caused by a
copy-paste error.
2022-10-24 14:23:27 +02:00
Tom Krizek
a4d72a57f9 Test serve stale cache with timeout 0 and CNAME
Add a couple of tests that verify the serve-stale behavior when
stale-answer-client-timeout is set to 0 and a (stale) CNAME record is
queried.

Related #3517
2022-10-24 14:23:26 +02:00
Michał Kępień
52731a91b6 Merge branch 'michal/bump-sphinx-version-to-5.3.0' into 'main'
Bump Sphinx version to 5.3.0

See merge request isc-projects/bind9!6972
2022-10-24 09:46:07 +00:00
Michał Kępień
a8f0ab7df6 Bump Sphinx version to 5.3.0
Make the Sphinx version listed in doc/arm/requirements.txt match the
version currently used in GitLab CI, so that Read the Docs builds the
documentation using the same Python software versions as those used in
GitLab CI.
2022-10-24 11:05:02 +02:00
Arаm Sаrgsyаn
004e7d8301 Merge branch '3603-resolver-prefetch-eligibility-edge-case-bug' into 'main'
Synchronize prefetch "trigger" and "eligibility" code and documentation

Closes #3603

See merge request isc-projects/bind9!6937
2022-10-21 11:28:44 +00:00
Aram Sargsyan
0227565cf1 Getting the "prefetch" setting from the configuration cannot fail
The "prefetch" setting is in "defaultconf" so it cannot fail, use
INSIST to confirm that.

The 'trigger' and 'eligible' variables are now prefixed with
'prefetch_' and their declaration moved to an upper level, because
there is no more additional code block after this change.
2022-10-21 10:19:54 +00:00
Aram Sargsyan
ef344b1f52 Fix prefetch "trigger" value's documentation in ARM
For the prefetch "trigger" parameter ARM states that when a cache
record with a lower TTL value is encountered during query processing,
it is refreshed. But in reality, the record is refreshed when the TTL
value is lower or equal to the configured "trigger" value.

Fix the documentation to make it match with with the code.
2022-10-21 10:19:53 +00:00
Aram Sargsyan
041ffac0d7 Add a CHANGES note for [GL #3603] 2022-10-21 10:19:53 +00:00
Aram Sargsyan
863f51466e Match prefetch eligibility behavior with ARM
ARM states that the "eligibility" TTL is the smallest original TTL
value that is accepted for a record to be eligible for prefetching,
but the code, which implements the condition doesn't behave in that
manner for the edge case when the TTL is equal to the configured
eligibility value.

Fix the code to check that the TTL is greater than, or equal to the
configured eligibility value, instead of just greater than it.
2022-10-21 10:19:23 +00:00
Aram Sargsyan
89fa9a6592 Add another prefetch check in the resolver system test
The test triggers a prefetch, but fails to check if it acutally
happened, which prevented it from catching a bug when the record's
TTL value matches the configured prefetch eligibility value.

Check that prefetch happened by comparing the TTL values.
2022-10-21 10:17:03 +00:00
Tony Finch
87efea8955 Merge branch '3611-bench-render' into 'main'
Delete the `render` benchmark

Closes #3611

See merge request isc-projects/bind9!6947
2022-10-21 09:53:09 +00:00
Tony Finch
c51fda86ac Delete the render benchmark
Instead of fixing a Coverity complaint (and other style nits),
delete it because it needs input data that can't be generated
with the tools that ship with BIND.
2022-10-21 09:52:40 +00:00
Arаm Sаrgsyаn
2bd3b452cf Merge branch '3598-adb-quota-might-not-be-decremented' into 'main'
Resolve "ADB quota might not be decremented"

Closes #3598

See merge request isc-projects/bind9!6893
2022-10-21 08:50:53 +00:00
Aram Sargsyan
6f50972e5f Add CHANGES and release notes for [GL #3598] 2022-10-21 08:25:31 +00:00
Aram Sargsyan
5da79e2be0 Call dns_adb_endudpfetch() on error path, if required
For UDP queries, after calling dns_adb_beginudpfetch() in fctx_query(),
make sure that dns_adb_endudpfetch() is also called on error path, in
order to adjust the quota back.
2022-10-21 08:08:55 +00:00
Aram Sargsyan
e4569373ca Always call dns_adb_endudpfetch() in fctx_cancelquery() for UDP queries
It is currently possible that dns_adb_endudpfetch() is not
called in fctx_cancelquery() for a UDP query, which results
in quotas not being adjusted back.

Always call dns_adb_endudpfetch() for UDP queries.
2022-10-21 08:08:47 +00:00
Aram Sargsyan
ac889684c7 Unlink the query under cleanup_query
In the cleanup code of fctx_query() function there is a code path
where 'query' is linked to 'fctx' and it is being destroyed.

Make sure that 'query' is unlinked before destroying it.
2022-10-21 08:08:37 +00:00
Ondřej Surý
442215dc6b Merge branch '3563-fix-named-startup-on-manycore-solaris-systems' into 'main'
Fix named failing to start on Solaris systems with hundreds of CPUs

Closes #3563

See merge request isc-projects/bind9!6955
2022-10-20 12:02:04 +00:00
Artem Boldariev
2c9400f116 Modify release notes [GL #3563]
Mention that a startup problem on manycore Solaris systems is fixed.
2022-10-20 14:01:28 +02:00
Artem Boldariev
03ee132e28 Modify CHANGES [GL #3563]
Mention that a startup problem on manycore Solaris systems is fixed.
2022-10-20 14:01:28 +02:00
Artem Boldariev
fff01fe7eb Fix named failing to start on Solaris systems with hundreds of CPUs
This commit fixes a startup issue on Solaris systems with
many (reportedly > 510) CPUs by bumping RLIMIT_NOFILE. This appears to
be a regression from 9.11.
2022-10-20 14:01:28 +02:00
Ondřej Surý
afd1908aa3 Merge branch '3270-use-curl-in-statschannel-system-test' into 'main'
Replace raw nc usage in statschannel system test with curl

Closes #3270

See merge request isc-projects/bind9!6946
2022-10-20 12:00:54 +00:00
Ondřej Surý
cd0e5c5784 Replace some raw nc usage in statschannel system test with curl
For tests where the TCP connection might get interrupted abruptly,
replace the nc with curl as the data sent from server to client might
get lost because of abrupt TCP connection.  This happens when the TCP
connection gets closed during sending the large request to the server.

As we already require curl for other system tests, replace the nc usage
in the statschannel test with curl that actually understands the
HTTP/1.1 protocol, so the same connection is reused for sending the
consequtive requests, but without client-side "pipelining".

For the record, the server doesn't support parallel processing of the
pipelined request, so it's a bit misnomer here, because what we are
actually testing is that we process all requests received in a single
TCP read callback.
2022-10-20 12:23:34 +02:00
Michal Nowak
97b9a7eb56 Merge tag 'v9_19_6'
BIND 9.19.6
2022-10-20 11:01:27 +02:00
Evan Hunt
6c8bc44bc4 Merge branch '3247-rpz-ip-cd' into 'main'
ensure RPZ lookups handle CD=1 correctly

Closes #3247

See merge request isc-projects/bind9!6944
2022-10-19 20:11:26 +00:00
Evan Hunt
3676f6394b CHANGES for [GL #3247] 2022-10-19 11:36:11 -07:00
Evan Hunt
575a924b1a add a test with CD=1 query for pending data
this is a regression test for [GL #3247].
2022-10-19 11:36:11 -07:00
Evan Hunt
305a50dbe1 ensure RPZ lookups handle CD=1 correctly
RPZ rewrites called dns_db_findext() without passing through the
client database options; as as result, if the client set CD=1,
DNS_DBFIND_PENDINGOK was not used as it should have been, and
cache lookups failed, resulting in failure of the rewrite.
2022-10-19 11:36:11 -07:00
Ondřej Surý
0bcff38391 Merge branch '3270-serialize-statschannel-http-requests' into 'main'
Serialize the HTTP/1.1 statschannel requests

Closes #3270

See merge request isc-projects/bind9!6954
2022-10-19 12:47:06 +00:00
Ondřej Surý
13959781cb Serialize the HTTP/1.1 statschannel requests
The statschannel truncated test still terminates abruptly sometimes and
it doesn't return the answer for the first query.  This might happen
when the second process_request() discovers there's not enough space
before the sending is complete and the connection is terminated before
the client gets the data.

Change the isc_http, so it pauses the reading when it receives the data
and resumes it only after the sending has completed or there's
incomplete request waiting for more data.

This makes the request processing slightly less efficient, but also less
taxing for the server, because previously all requests that has been
received via single TCP read would be processed in the loop and the
sends would be queued after the read callback has processed a full
buffer.
2022-10-19 14:45:36 +02:00
Ondřej Surý
edb0e756bc Merge branch '3612-fix-mem-functions-with-openssl-1.0.2' into 'main'
Fix the non-developer build with OpenSSL 1.0.2

Closes #3612

See merge request isc-projects/bind9!6952
2022-10-19 12:42:20 +00:00
Ondřej Surý
dfaae53b9a Fix the non-developer build with OpenSSL 1.0.2
In non-developer build, a wrong condition prevented the
isc__tls_malloc_ex, isc__tls_realloc_ex and isc__tls_free_ex to be
defined.  This was causing FTBFS on platforms with OpenSSL 1.0.2.
2022-10-19 14:41:10 +02:00
Ondřej Surý
a08a84695a Merge branch '3270-remove-time-requirement-for-statschannel-truncated-test' into 'main'
Remove the time requirement for the statschannel truncated test

Closes #3270

See merge request isc-projects/bind9!6951
2022-10-19 12:35:38 +00:00
Ondřej Surý
0f56a53d66 Remove the time requirement for the statschannel truncated test
The 5 seconds requirement to finish the 'pipelined with truncated
stream' was causing spurious failures in the CI because the job runners
might be very busy and sending 128k of data might simply take some time.

Remove the time requirement altogether, there's actually no reason why
the test SHOULD or even MUST finish under 5 seconds.
2022-10-19 14:08:24 +02:00
Tom Krizek
a8c1ac7f92 Merge branch 'tkrizek/system-tests-fixes' into 'main'
Update various system tests and add them to default test suite

See merge request isc-projects/bind9!6942
2022-10-19 11:01:26 +00:00
Tom Krizek
cbd0355328 Remove generated controls.conf file from system tests
The controls.conf file shouldn't be used directly without templating it
first. Remove this no longer used hard-coded file to avoid confusion.
2022-10-19 12:59:27 +02:00
Tom Krizek
cb0a2ae1dd Revive dupsigs system test
Correctly source conf.sh in dupsigs test scripts (fix issue introduced
by 093af1c00a).

Update dupsigs test for dnssec-dnskey-kskonly default. Since v9.17.20,
the dnssec-dnskey-kskonly is set to yes. Update the test to not expect
the additional RRSIG with ZSK for DNSKEY.

Speed up the test from 20 minutes to 2.5 minutes and make it part of the
default test suite executed in CI.
- decrease number of records to sign from 2000 to 500
- decrease the signing interval by a factor of 6
- shorten the final part of the test after last signing (since nothing
  new happens there)

Finally, clarify misleading comments about (in)sufficient time for zone
re-signing. The time used in the test is in fact sufficient for the
re-signing to happen. If it wasn't, the previous ZSK would end up being
deleted while its signatures would still be present, which is a
situation where duplicate signatures can still happen.
2022-10-19 12:59:27 +02:00
Tom Krizek
7495deea3e Revive the stress system test
Ensure the port numbers are dynamically filled in with copy_setports.

Clarify test fail condition.

Make the stress test part of the default test suite since it doesn't
seem to run too long or interfere with other tests any more (the
original note claiming so is more than 20 years old).

Related !6883
2022-10-19 12:59:27 +02:00
Tom Krizek
235ae5f344 Revive dialup system test
Properly template the port number in config files with copy_setports.

The test takes two minutes on my machine which doesn't seem like a
proper justification to exclude it from the test suite, especially
considering we run these tests in parallel nowadays. The resource usage
doesn't seems significantly increased so it shouldn't interfere with
other system tests.

There also exists a precedent for longer running system tests that are
already part of the default system test suite (e.g. serve-stale takes
almost three minutes on the same machine).
2022-10-19 12:59:27 +02:00
Tom Krizek
1e7d832342 Make digdelv test work in different network envs
When a target server is unreachable, the varying network conditions may
cause different ICMP message (or no message). The host unreachable
message was discovered when attempting to run the test locally while
connected to a VPN network which handles all traffic.

Extend the dig output check with "host unreachable" message to avoid a
false negative test result in certain network environments.
2022-10-19 12:59:25 +02:00
Michal Nowak
3d968b4a4c Merge branch '3394-cve-2022-2795-test' into 'main'
Add tests for CVE-2022-2795

Closes #3394

See merge request isc-projects/bind9!6945
2022-10-19 10:31:56 +00:00
Michał Kępień
604d8f0b96 Add tests for CVE-2022-2795
Add a test ensuring that the amount of work fctx_getaddresses() performs
for any encountered delegation is limited: delegate example.net to a set
of 1,000 name servers in the redirect.com zone, the names of which all
resolve to IP addresses that nothing listens on, and query for a name in
the example.net domain, checking the number of times the findname()
function gets executed in the process; fail if that count is excessively
large.

Since the size of the referral response sent by ans3 is about 20 kB, it
cannot be sent back over UDP (EMSGSIZE) on some operating systems in
their default configuration (e.g. FreeBSD - see the
net.inet.udp.maxdgram sysctl).  To enable reliable reproduction of
CVE-2022-2795 (retry patterns vary across BIND 9 versions) and avoid
false positives at the same time (thread scheduling - and therefore the
number of fetch context restarts - vary across operating systems and
across test runs), extend bin/tests/system/resolver/ans3/ans.pl so that
it also listens on TCP and make "ns1" in the "resolver" system test
always use TCP when communicating with "ans3".

Also add a test (foo.bar.sub.tld1/TXT) that ensures the new limitations
imposed on the resolution process by the mitigation for CVE-2022-2795 do
not prevent valid, glueless delegation chains from working properly.
2022-10-19 11:53:08 +02:00
Artem Boldariev
64287e4889 Merge branch 'artem-tls-listener-shutdown-accept-crash-fix' into 'main'
[Backport] TLS Stream: handle successful TLS handshake after listener shutdown

See merge request isc-projects/bind9!6938
2022-10-18 15:58:14 +00:00
Artem Boldariev
09dcc914b4 TLS Stream: handle successful TLS handshake after listener shutdown
It was possible that accept callback can be called after listener
shutdown. In such a case the callback pointer equals NULL, leading to
segmentation fault. This commit fixes that.
2022-10-18 18:30:24 +03:00
Michal Nowak
9b8a72735b Merge branch '3493-compression-buffer-reuse-test' into 'main'
[CVE-2022-2881] test for growth of compressed pipelined responses

See merge request isc-projects/bind9!6933
2022-10-18 15:18:54 +00:00
Evan Hunt
3c11fafadf test for growth of compressed pipelined responses
add a test to compare the Content-Length of successive compressed
messages on a single HTTP connection that should contain the same
data; fail if the size grows by more than 100 bytes from one query
to the next.
2022-10-18 17:16:00 +02:00