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

37043 Commits

Author SHA1 Message Date
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
Aram Sargsyan
87920661b1 Add CHANGES note for [GL #3518] 2022-09-06 08:55:07 +00:00
Aram Sargsyan
a5d412d924 Do not use libxml2 deprecated functions
The usage of xmlInitThreads() and xmlCleanupThreads() functions in
libxml2 is now marked as deprecated, and these functions will be made
private in the future.

Use xmlInitParser() and xmlCleanupParser() instead of them.
2022-09-06 08:55:07 +00:00
Arаm Sаrgsyаn
6c0560f014 Merge branch 'aram/isc_nm_listentlsdns-error-path-bugfix' into 'main'
Fix isc_nm_listentlsdns() error path bug

See merge request isc-projects/bind9!6728
2022-09-06 08:25:39 +00:00
Aram Sargsyan
2f11e48f0d Fix isc_nm_listentlsdns() error path bug
The isc_nm_listentlsdns() function erroneously calls
isc__nm_tcpdns_stoplistening() instead of isc__nm_tlsdns_stoplistening()
when something goes wrong, which can cause an assertion failure.
2022-09-05 14:58:52 +00:00
Ondřej Surý
7067f30510 Merge branch '3485-dig-fallback-to-idna2003' into 'main'
Allow fallback to IDNA2003 processing

Closes #3485

See merge request isc-projects/bind9!6699
2022-09-05 08:36:48 +00:00
Ondřej Surý
0fe7acb4e6 Add CHANGES and release note for [GL #3485] 2022-09-05 10:35:09 +02:00
Ondřej Surý
87de726f5c Enable the IDNA2003 domain names in the idna system test
Allow the IDNA2003 tests to succeed after the fallback to IDNA2003 was
implemented.
2022-09-05 10:34:49 +02:00
Ondřej Surý
10923f9d87 Allow fallback to IDNA2003 processing
In several cases where IDNA2008 mappings do not exist whereas IDNA2003
mappings do, dig was failing to process the suplied domain name.  Take a
backwards compatible approach, and convert the domain to IDNA2008 form,
and if that fails try the IDNA2003 conversion.
2022-09-05 10:34:49 +02:00
Arаm Sаrgsyаn
b5d5c383a7 Merge branch '3515-mctx-attach-detach-for-isc_mempool_t' into 'main'
Add mctx attach/detach when creating/destroying a memory pool

Closes #3515

See merge request isc-projects/bind9!6712
2022-09-02 09:02:38 +00:00
Aram Sargsyan
362ead8d85 Add CHANGES note for [GL #3515] 2022-09-02 08:16:44 +00:00
Aram Sargsyan
e97c3eea95 Add mctx attach/detach when creating/destroying a memory pool
This should make sure that the memory context is not destroyed
before the memory pool, which is using the context.
2022-09-02 08:16:17 +00:00
Arаm Sаrgsyаn
774a0277a0 Merge branch '3514-cid-356328-deadcode-in-server.c' into 'main'
Resolve "CID 356328: Control flow issues (DEADCODE) in bin/named/server.c"

Closes #3514

See merge request isc-projects/bind9!6713
2022-09-02 08:14:46 +00:00
Aram Sargsyan
7ce1f3d872 Use the return value of isc_portset_create()
There is an omission of assigning the return value coming from the
isc_portset_create() function to the result variable.

CID 356328:

    /bin/named/server.c: 8756 in load_configuration()
    8750     			      "creating UDP/IPv4 port set: %s",
    8751     			      isc_result_totext(result));
    8752     		goto cleanup_bindkeys_parser;
    8753     	}
    8754     	isc_portset_create(named_g_mctx, &v6portset);
    8755     	if (result != ISC_R_SUCCESS) {
    >>>     CID 356328:  Control flow issues  (DEADCODE)
    >>>     Execution cannot reach this statement: "isc_log_write(named_g_lctx,...".
    8756     		isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
    8757     			      NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
    8758     			      "creating UDP/IPv6 port set: %s",
    8759     			      isc_result_totext(result));
    8760     		goto cleanup_v4portset;
    8761     	}
2022-09-02 07:40:27 +00:00
Evan Hunt
4bc0db5ed2 Merge branch '3511-quote-yaml-addresses' into 'main'
quote addresses in YAML output

Closes #3511

See merge request isc-projects/bind9!6702
2022-08-31 23:16:32 +00:00
Evan Hunt
f72bf1375a CHANGES for [GL #3511] 2022-08-31 15:32:37 -07:00