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

37008 Commits

Author SHA1 Message Date
Tony Finch
fade14c809 Merge branch '3537-idna-test' into 'main'
Fix dig idna test on Debian 10 "buster"

Closes #3537

See merge request isc-projects/bind9!6767
2022-09-14 12:39:08 +00:00
Tony Finch
5c1aed2881 Fix dig idna test on Debian 10 "buster"
The test expected `xn--ah-` to be treated as a syntax error (punycode
requires letters after the last hyphen) but libidn2 on buster
converted the label to `ah` instead. To avoid this bug, change the
invalid label to `xn--0000h` which translates to an out-of-range
unicode codepoint (beyond the maximum value) which is corectly
trated as invalid in older libidn2.
2022-09-14 11:59:42 +01:00
Tony Finch
83f27b6f3b Merge branch '3536-out-of-tree' into 'main'
Fix out-of-tree tests

Closes #3536

See merge request isc-projects/bind9!6766
2022-09-14 10:23:29 +00:00
Tony Finch
2a0b81d6da Fix out-of-tree tests
The change to `testsock.pl` in commit 258a896a broke the system
tests in out-of-tree builds because `ifconfig.sh.in` is not
copied to the worktree. Use `ifconfig.sh` instead.
2022-09-14 10:02:58 +01:00
Mark Andrews
44235cd2cf Merge branch '2295-add-the-ability-to-specify-that-a-server-supports-cookies' into 'main'
Resolve "Add the ability to specify that a server supports COOKIES."

Closes #2295

See merge request isc-projects/bind9!4410
2022-09-14 01:36:42 +00:00
Mark Andrews
b22df206d4 Add CHANGES and release notes for [GL #2295] 2022-09-13 12:07:13 +10:00
Mark Andrews
9d893d55e0 Check "require-cookie yes;" triggers TCP fallback on no cookie 2022-09-13 12:07:13 +10:00
Mark Andrews
7751e5e039 Add server clause require-cookie
Specifies if an UDP response requires a DNS COOKIE or not.
Fallback to TCP if not present and not TSIG signed.
2022-09-13 12:07:13 +10:00
Evan Hunt
00e3c8fe1a Merge branch '3520-rndc-shutdown-hang' into 'main'
prevent a possible shutdown hang in rndc

See merge request isc-projects/bind9!6734
2022-09-12 20:34:32 +00:00
Evan Hunt
9683439d73 prevent a possible shutdown hang in rndc
In rndc_recvdone(), if 'sends' was not 0, then 'recvs' was not
decremented, in which case isc_loopmgr_shutdown() was never reached,
which could cause a hang. (This has not been observed to happen, but
the code was incorrect on examination.)
2022-09-12 13:14:19 -07:00
Tony Finch
b5b147864f Merge branch 'fanf-tolower' into 'main'
De-duplicate `tolower()`

See merge request isc-projects/bind9!6516
2022-09-12 12:08:06 +00:00
Tony Finch
022bb06264 CHANGES note for [GL !6516]
[cleanup]	Move the duplicated ASCII case conversion tables to
		isc_ascii where they can be shared, and replace the
		various hot-path tolower() loops with calls to new
		isc_ascii implementations.
2022-09-12 12:23:39 +01:00
Tony Finch
68029bfc9d Tests and benchmark for isc_ascii
The test is to verify basic functionality. The benchmark compares a
number of alternative tolower() implementations on large and small
strings.
2022-09-12 12:23:39 +01:00
Tony Finch
21a383a8fd General-purpose unrolled ASCII tolower() loops
When converting a string to lower case, the compiler is able to
autovectorize nicely, so a nice simple implementation is also very
fast, comparable to memcpy().

Comparisons are more difficult for the compiler, so we convert eight
bytes at a time using "SIMD within a register" tricks. Experiments
indicate it's best to stick to simple loops for shorter strings and
the remainder of long strings.
2022-09-12 12:18:57 +01:00
Tony Finch
27a561273e Consolidate some ASCII tables in isc/ascii and isc/hex
There were a number of places that had copies of various ASCII
tables (case conversion, hex and decimal conversion) that are intended
to be faster than the ctype.h macros, or avoid locale pollution.

Move them into libisc, and wrap the lookup tables with macros that
avoid the ctype.h gotchas.
2022-09-12 12:18:57 +01:00
Tony Finch
db3590e0b7 Merge branch '3519-macos-tests' into 'main'
System test fixes for macOS

Closes #3519

See merge request isc-projects/bind9!6719
2022-09-12 11:14:27 +00:00
Tony Finch
d8053785b0 Skip the xfer test when Net::DNS is too old
This allows the system tests to run to completion on macOS
without requiring extra modules from CPAN.
2022-09-12 12:13:04 +01:00
Tony Finch
258a896a0c The system tests are using another IP address
Reduce the number of places that know about the number of IP addresses
required by the system tests, by changing `testsock.pl` to read the
`max` from `ifconfig.sh.in`. This should make the test runner fail
early with a clear message when the interfaces have been set up by an
obsolete script.

Add comments to cross-reference `ifconfig.sh.in`, `testsock.pl`, and
`org.isc.bind.system` to make it easier to remember what needs
updating when an IP address is added.
2022-09-12 12:13:04 +01:00
Tony Finch
eb68baffd9 Merge branch '3527-dig-idna-relaxed' into 'main'
More lenient IDNA processing in dig

Closes #3527

See merge request isc-projects/bind9!6738
2022-09-12 11:09:38 +00:00
Tony Finch
ac487af09e CHANGES and release note for [GL #3527]
[func]		When an international domain name is not valid, DiG will
		now pass it through unchanged, instead of stopping with
		an error message. [GL #3527]
2022-09-12 11:42:02 +01:00
Tony Finch
f820ef49bf More lenient IDNA processing in dig
If there are any problems with IDN processing, DiG will now quietly
handle the name as if IDN were disabled. This means that international
query names are rendered verbatim on the wire, and ACE names are
printed raw without conversion to UTF8.

If you want to check the syntax of international domain names,
use the `idn2` utility.
2022-09-12 11:40:08 +01:00
Tony Finch
8b9dba53dd Merge branch '3528-catz-test-faster' into 'main'
Speed up the `catz` system test

Closes #3528

See merge request isc-projects/bind9!6742
2022-09-12 10:31:10 +00:00
Tony Finch
cdfe8f23c2 Speed up the catz system test
Do not delay sending NOFIFY messages, and allow catalog zones to
update every second instead of every 5 seconds.
2022-09-12 11:30:09 +01:00
Tony Finch
2ae81024df Merge branch '3531-initialize-struct-server' into 'main'
Ensure that named_server_t is properly initialized

Closes #3531

See merge request isc-projects/bind9!6755
2022-09-12 10:12:42 +00:00
Tony Finch
7b71b1020f Ensure that named_server_t is properly initialized
There was a ubsan error reporting an invalid value for interface_auto
(a boolean value cannot be 190) because it was not initialized. To
avoid this problem happening again, ensure the whole of the server
structure is initialized to zero before setting the (relatively few)
non-zero elements.
2022-09-12 10:35:39 +01:00
Michał Kępień
37cdd6b51d Merge branch '3534-fix-error-reporting-for-posix-threads-functions' into 'main'
Fix error reporting for POSIX Threads functions

See merge request isc-projects/bind9!6756
2022-09-09 18:28:07 +00:00
Michał Kępień
3b1c80fd0f Fix error reporting for POSIX Threads functions
Commit 3608abc8fa6a33046e1d34a0789cf7c9547f09ad inadvertently carried
over a mistake in logging pthread_cond_init() errors to the
ERRNO_CHECK() preprocessor macro: instead of passing the value returned
by a given pthread_*() function to strerror_r(), ERRNO_CHECK() passes
the errno variable to strerror_r().  This causes bogus error reports
because POSIX Threads API functions do not set the errno variable.

Fix by passing the value returned by a given pthread_*() function
instead of the errno variable to strerror_r().  Since this change makes
the name of the affected macro (ERRNO_CHECK()) confusing, rename the
latter to PTHREADS_RUNTIME_CHECK().  Also log the integer error value
returned by a given pthread_*() function verbatim to rule out any
further confusion in runtime error reporting.
2022-09-09 20:25:47 +02:00
Michał Kępień
a1ae24d9ae Merge branch 'michal/set-up-version-and-release-notes-for-bind-9.19.6' into 'main'
Set up version and release notes for BIND 9.19.6

See merge request isc-projects/bind9!6758
2022-09-09 18:23:08 +00:00
Michał Kępień
3239875a8a Set up release notes for BIND 9.19.6 2022-09-09 19:56:43 +02:00
Michał Kępień
fa610c0d1b Update BIND version to 9.19.6-dev 2022-09-09 19:56:43 +02:00
Michał Kępień
529425b89d Merge branch 'michal/add-placeholder-entries-to-CHANGES' into 'main'
Add placeholder entries to CHANGES

See merge request isc-projects/bind9!6750
2022-09-08 08:55:46 +00:00
Michał Kępień
29ed170ba0 Add placeholder entries to CHANGES
Add placeholders for the following issues:

  - [GL #3394]
  - [GL #3487]
  - [GL #3491]
  - [GL #3493]
  - [GL #3517]
2022-09-08 10:42:01 +02:00
Michał Kępień
5fdff51785 Merge branch '3459-rrl-wildcard-handling' into 'main'
Make RRL code treat all QNAMEs subject to wildcard processing as the same name

Closes #3459

See merge request isc-projects/bind9!6744
2022-09-08 07:35:43 +00:00
Aram Sargsyan
0b0cf12741 Add CHANGES and release notes for [GL #3459] 2022-09-08 09:15:30 +02:00
Aram Sargsyan
89c2032421 Document RRL processing for wildcard names
All valid wildcard domain names are interpreted as the zone's origin
name concatenated to the "*" name.
2022-09-08 09:15:30 +02:00
Aram Sargsyan
baa9698c9d Fix RRL responses-per-second bypass using wildcard names
It is possible to bypass Response Rate Limiting (RRL)
`responses-per-second` limitation using specially crafted wildcard
names, because the current implementation, when encountering a found
DNS name generated from a wildcard record, just strips the leftmost
label of the name before making a key for the bucket.

While that technique helps with limiting random requests like
<random>.example.com (because all those requests will be accounted
as belonging to a bucket constructed from "example.com" name), it does
not help with random names like subdomain.<random>.example.com.

The best solution would have been to strip not just the leftmost
label, but as many labels as necessary until reaching the suffix part
of the wildcard record from which the found name is generated, however,
we do not have that information readily available in the context of RRL
processing code.

Fix the issue by interpreting all valid wildcard domain names as
the zone's origin name concatenated to the "*" name, so they all will
be put into the same bucket.
2022-09-08 09:15:30 +02:00
Matthijs Mekking
089fcfbcbd Merge branch 'matthijs-fix-intermittent-inline-system-test-failure' into 'main'
Fix intermittent inline system test failure

See merge request isc-projects/bind9!6708
2022-09-07 15:10:56 +00:00
Matthijs Mekking
8b71cbd09c Update inline system test, zone 'retransfer3.'
The zone 'retransfer3.' tests whether zones that 'rndc signing
-nsec3param' requests are queued even if the zone is not loaded.

The test assumes that if 'rndc signing -list' shows that the zone is
done signing with two keys, and there are no NSEC3 chains pending, the
zone is done handling the '-nsec3param' queued requests. However, it
is possible that the 'rndc signing -list' command is received before
the corresponding privatetype records are added to the zone (the records
that are used to retrieve the signing status with 'rndc signing').

This is what happens in test failure
https://gitlab.isc.org/isc-projects/bind9/-/jobs/2722752.

The 'rndc signing -list retransfer3' is thus an unreliable check.
It is simpler to just remove the check and wait for a certain amount
of time and check whether ns3 has re-signed the zone using NSEC3.
2022-09-07 16:24:14 +02:00
Michał Kępień
77f5341730 Merge branch '3508-fix-building-without-doh-support' into 'main'
Fix building without DoH support

Closes #3508

See merge request isc-projects/bind9!6737
2022-09-07 11:21:57 +00:00
Michał Kępień
4c49068531 Fix building with --disable-doh
Commit b69e783164cd50e3306364668558e460617ee8fc inadvertently caused
builds using the --disable-doh switch to fail, by putting the
declaration of the isc__nm_async_settlsctx() function inside an #ifdef
block that is only evaluated when DNS-over-HTTPS support is enabled.
This results in the following compilation errors being triggered:

    netmgr/netmgr.c:2657:1: error: no previous prototype for 'isc__nm_async_settlsctx' [-Werror=missing-prototypes]
     2657 | isc__nm_async_settlsctx(isc__networker_t *worker, isc__netievent_t *ev0) {
          | ^~~~~~~~~~~~~~~~~~~~~~~

Fix by making the declaration of the isc__nm_async_settlsctx() function
in lib/isc/netmgr/netmgr-int.h visible regardless of whether
DNS-over-HTTPS support is enabled or not.
2022-09-07 12:50:08 +02:00
Michał Kępień
d8644930b4 Test the --disable-doh switch in GitLab CI
Use the --disable-doh switch for all Ubuntu 22.04 builds in GitLab CI to
immediately flag any code changes that would break such builds.
2022-09-07 12:50:08 +02:00
Evan Hunt
7fec4505da Merge branch 'each-interface-magic' into 'main'
when creating an interface, set magic before linking

See merge request isc-projects/bind9!6735
2022-09-07 04:47:09 +00:00
Evan Hunt
8c01662048 when creating an interface, set magic before linking
set the magic number in a newly-created interface object
before appending it to mgr->interfaces in order to prevent
a possible assertion.
2022-09-06 17:12:14 -07:00
Mark Andrews
5267a25b17 Merge branch '3364-various-coverity-issues-after-dns_message_gettemp-cleanup' into 'main'
Resolve "Various Coverity issues after dns_message_gettemp* cleanup"

Closes #3364

See merge request isc-projects/bind9!6588
2022-09-06 15:25:39 +00:00
Mark Andrews
785d021d00 Remove dead code
*** CID 352817:  Control flow issues  (DEADCODE) /lib/ns/xfrout.c: 1568 in sendstream()
    1562
    1563     	/* Advance lasttsig to be the last TSIG generated */
    1564     	CHECK(dns_message_getquerytsig(msg, xfr->mctx, &xfr->lasttsig));
    1565
    1566     failure:
    1567     	if (msgname != NULL) {
    >>>     CID 352817:  Control flow issues  (DEADCODE)
    >>>     Execution cannot reach this statement: "if (msgrds != NULL) {
      if ...".
    1568     		if (msgrds != NULL) {
    1569     			if (dns_rdataset_isassociated(msgrds)) {
    1570     				dns_rdataset_disassociate(msgrds);
    1571     			}
    1572     			dns_message_puttemprdataset(msg, &msgrds);
    1573     		}
2022-09-06 12:47:08 +00:00
Mark Andrews
5805457d9d Remove dead code
*** CID 352816:  Control flow issues  (DEADCODE) /lib/ns/query.c: 8443 in query_dns64()
    8437     cleanup:
    8438     	if (buffer != NULL) {
    8439     		isc_buffer_free(&buffer);
    8440     	}
    8441
    8442     	if (dns64_rdata != NULL) {
    >>>     CID 352816:  Control flow issues  (DEADCODE)
    >>>     Execution cannot reach this statement: "dns_message_puttemprdata(cl...".
    8443     		dns_message_puttemprdata(client->message, &dns64_rdata);
    8444     	}
    8445
    8446     	if (dns64_rdataset != NULL) {
    8447     		dns_message_puttemprdataset(client->message, &dns64_rdataset);
    8448     	}
2022-09-06 12:47:08 +00:00
Mark Andrews
3ef734e0f5 Remove dead code
*** CID 352812:  Control flow issues  (DEADCODE) /lib/ns/query.c: 8584 in query_filter64()
    8578     cleanup:
    8579     	if (buffer != NULL) {
    8580     		isc_buffer_free(&buffer);
    8581     	}
    8582
    8583     	if (myrdata != NULL) {
    >>>     CID 352812:  Control flow issues  (DEADCODE)
    >>>     Execution cannot reach this statement: "dns_message_puttemprdata(cl...".
    8584     		dns_message_puttemprdata(client->message, &myrdata);
    8585     	}
    8586
    8587     	if (myrdataset != NULL) {
    8588     		dns_message_puttemprdataset(client->message, &myrdataset);
    8589     	}
2022-09-06 12:47:08 +00:00
Mark Andrews
8e5a7e8bac Silence REVERSE_INULL
Remove unnecessary != NULL checks

    *** CID 352809:  Null pointer dereferences  (REVERSE_INULL) /lib/dns/message.c: 4654 in dns_message_buildopt()
    4648     	if (rdata != NULL) {
    4649     		dns_message_puttemprdata(message, &rdata);
    4650     	}
    4651     	if (rdataset != NULL) {
    4652     		dns_message_puttemprdataset(message, &rdataset);
    4653     	}
    >>>     CID 352809:  Null pointer dereferences  (REVERSE_INULL)
    >>>     Null-checking "rdatalist" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
    4654     	if (rdatalist != NULL) {
    4655     		dns_message_puttemprdatalist(message, &rdatalist);
    4656     	}
    4657     	return (result);
    4658     }
    4659
2022-09-06 12:47:08 +00:00
Mark Andrews
24710beaff Remove dead code in xfrin.c
also removed unnecessary 'msg != NULL' check

   *** CID 352815:  Control flow issues  (DEADCODE) /lib/dns/xfrin.c: 1363 in xfrin_send_request()
   1357     	isc_nmhandle_attach(send_xfr->handle, &xfr->sendhandle);
   1358     	isc_refcount_increment0(&send_xfr->sends);
   1359     	isc_nm_send(xfr->handle, &region, xfrin_send_done, send_xfr);
   1360
   1361     failure:
   1362     	if (qname != NULL) {
   >>>     CID 352815:  Control flow issues  (DEADCODE)
   >>>     Execution cannot reach this statement: "dns_message_puttempname(msg...".
   1363     		dns_message_puttempname(msg, &qname);
   1364     	}
   1365     	if (qrdataset != NULL) {
   1366     		dns_message_puttemprdataset(msg, &qrdataset);
   1367     	}
   1368     	if (msg != NULL) {

   *** CID 352819:  Control flow issues  (DEADCODE) /lib/dns/xfrin.c: 1366 in xfrin_send_request()
   1360
   1361     failure:
   1362     	if (qname != NULL) {
   1363     		dns_message_puttempname(msg, &qname);
   1364     	}
   1365     	if (qrdataset != NULL) {
   >>>     CID 352819:  Control flow issues  (DEADCODE)
   >>>     Execution cannot reach this statement: "dns_message_puttemprdataset...".
   1366     		dns_message_puttemprdataset(msg, &qrdataset);
   1367     	}
   1368     	if (msg != NULL) {
   1369     		dns_message_detach(&msg);
   1370     	}
   1371     	if (soatuple != NULL) {
2022-09-06 12:47:08 +00:00
Arаm Sаrgsyаn
4dc37589c4 Merge branch '3518-libxml2-deprecated-functions' into 'main'
Do not use libxml2 deprecated functions

Closes #3518

See merge request isc-projects/bind9!6727
2022-09-06 09:42:01 +00:00