Commit Graph

34305 Commits

Author SHA1 Message Date
Mark Andrews
ddacc7e1b2 Merge branch '2820-rndc-reconfig-does-not-act-on-change-to-zone-statistics' into 'main'
Resolve "rndc reconfig does not act on change to zone-statistics"

Closes #2820

See merge request isc-projects/bind9!5271
2021-07-16 04:09:53 +00:00
Mark Andrews
f2461afff7 Add CHANGES for [GL #2820] 2021-07-16 13:49:22 +10:00
Mark Andrews
616896d735 zone->requeststats_on was not being set at the correct point 2021-07-16 13:49:22 +10:00
Mark Andrews
592f9ff6bc Test that 'zone-statistics full;' is properly processed 2021-07-16 13:49:22 +10:00
Matthijs Mekking
02c3a2decc Merge branch '2710-multisigner-cds' into 'main'
Allow update CDS/CDNSKEY records that do not match DNSKEY

Closes #2710

See merge request isc-projects/bind9!5270
2021-07-15 07:24:09 +00:00
Matthijs Mekking
ba5869943d Add change and release notes [#2710] 2021-07-15 08:32:16 +02:00
Matthijs Mekking
577bf913b9 Relax zone_cdscheck function
If we have a CDS or CDNSKEY we at least need to have a DNSKEY with the
same algorithm published and signing the CDS RRset. Same for CDNSKEY
of course.

This relaxes the zone_cdscheck function, because before the CDS or
CDNSKEY had to match a DNSKEY, now only the algorithm has to match.

This allows a provider in a multisigner model to update the CDS/CDNSKEY
RRset in the zone that is served by the other provider.
2021-07-14 12:10:11 -07:00
Matthijs Mekking
6b79db1fdd Add test for allowing update CDS/CDNSKEY
Add tests to the nsupdate system test to make sure that CDS and/or
CDNSKEY that match an algorithm in the DNSKEY RRset are allowed. Also
add tests that updates are rejected if the algorithm does not match.

Remove the now redundant test cases from the dnssec system test.

Update the checkzone system test: Change the algorithm of the CDS and
CDNSKEY records so that the zone is still rejected.
2021-07-14 12:10:11 -07:00
Evan Hunt
2292b48c2a Merge branch 'each-doc-trampoline' into 'main'
document isc__trampoline

See merge request isc-projects/bind9!5116
2021-07-14 17:59:28 +00:00
Evan Hunt
4f6e2317e9 document isc__trampoline
Added some header file documentation to the isc__trampoline
implementation in trampoline_p.h.
2021-07-14 10:55:12 -07:00
Artem Boldariev
9a7d2000e6 Merge branch 'artem/doh-empty-query-string-crash-fix' into 'main'
Fix crash in DoH on empty query string in GET requests

See merge request isc-projects/bind9!5268
2021-07-13 13:55:30 +00:00
Artem Boldariev
3e3c944d2e Add CHANGES for [GL !5268]
The commit updates the CHANGES file adding a note about a crash caused
by improper handling of DoH GET requests.
2021-07-13 16:54:25 +03:00
Artem Boldariev
64cd7e8a7f Fix crash in DoH on empty query string in GET requests
An unhandled code path left GET query string data uninitialised (equal
to NULL) and led to a crash during the requests' base64 data
decoding. This commit fixes that.
2021-07-13 16:53:51 +03:00
Ondřej Surý
1c5d033576 Merge branch '2822-inconsistent-recursive-performance' into 'main'
Disable setting the thread affinity

Closes #2822

See merge request isc-projects/bind9!5265
2021-07-13 13:50:53 +00:00
Ondřej Surý
41afe6bc5e Add CHANGES and release notes for [GL #2822] 2021-07-13 15:44:08 +02:00
Ondřej Surý
4c5dc1904b Disable the cpu system test
As we don't set the thread affinity, the cpu test would consistently
fail.  Disable it, but don't remove it as we might restore setting the
affinity in the future versions of BIND 9.
2021-07-13 14:48:29 +02:00
Ondřej Surý
a9e6a7ae57 Disable setting the thread affinity
It was discovered that setting the thread affinity on both the netmgr
and netthread threads lead to inconsistent recursive performance because
sometimes the netmgr and netthread threads would compete over single
resource and sometimes not.

Removing setting the affinity causes a slight dip in the authoritative
performance around 5% (the measured range was from 3.8% to 7.8%), but
the recursive performance is now consistently good.
2021-07-13 14:48:29 +02:00
Ondřej Surý
a92a89f4fa Merge branch '2815-increase-sizeinfo-memory-alignment-on-OpenBSD' into 'main'
Use max_align_t for memory sizeinfo alignment on OpenBSD

Closes #2815

See merge request isc-projects/bind9!5267
2021-07-13 12:00:01 +00:00
Ondrej Sury
6eca4b402e Use max_align_t for memory sizeinfo alignment on OpenBSD
On OpenBSD and more generally on platforms without either jemalloc or
malloc_(usable_)size, we need to increase the alignment for the memory
to sizeof(max_align_t) as with plain sizeof(void *), the compiled code
would be crashing when accessing the returned memory.
2021-07-13 13:48:33 +02:00
Matthijs Mekking
97e1a1f929 Merge branch '2811-checkds-memleak-shutdown' into 'main'
Fix leak in checkds code

Closes #2811

See merge request isc-projects/bind9!5262
2021-07-13 09:50:33 +00:00
Matthijs Mekking
2ccf342690 Add change entry for [#2811] 2021-07-13 11:12:37 +02:00
Matthijs Mekking
b676163933 Fix leak in checkds code
In 'checkds_send_toaddr' there is a goto bug that causes the TSIG key
and DNS message to not be detached. Remove the offending goto statement.
2021-07-13 11:12:37 +02:00
Ondřej Surý
ef467a5a7c Merge branch '2819-cache-the-isc_os_ncpu-result' into 'main'
Cache the isc_os_ncpu() result

Closes #2819

See merge request isc-projects/bind9!5263
2021-07-13 07:55:51 +00:00
Ondrej Sury
23751fe252 Cache the isc_os_ncpu() result
It was discovered that on some platforms (f.e. Alpine Linux with MUSL)
the result of isc_os_ncpus() call differ when called before and after we
drop privileges.  This commit changes the isc_os_ncpus() call to cache
the result from the first call and thus always return the same value
during the runtime of the named.  The first call to isc_os_ncpus() is
made as soon as possible on the library initalization.
2021-07-13 09:12:04 +02:00
Ondřej Surý
e04d69533d Merge branch '2816-mem-c-739-2-runtime-error-null-pointer-returned-from-function-declared-to-never-return-null' into 'main'
Remove nonnull attribute from isc_mem_{get,allocate,reallocate}

Closes #2816

See merge request isc-projects/bind9!5261
2021-07-12 08:23:40 +00:00
Ondřej Surý
b9722ce98f Merge branch '2815-crashes-related-to-memory-reallocation-on-openbsd' into 'main'
Fix the real allocation size in OpenBSD rallocx shim

Closes #2815

See merge request isc-projects/bind9!5260
2021-07-12 08:06:09 +00:00
Ondřej Surý
ce03015d48 Remove nonnull attribute from isc_mem_{get,allocate,reallocate}
The isc_mem_get(), isc_mem_allocate() and isc_mem_reallocate() can
return NULL ptr in case where the allocation size is NULL.  Remove the
nonnull attribute from the functions' declarations.

This stems from the following definition in the C11 standard:

> If the size of the space requested is zero, the behavior is
> implementation-defined: either a null pointer is returned, or the
> behavior is as if the size were some nonzero value, except that the
> returned pointer shall not be used to access an object.

In this case, we return NULL as it's easier to detect errors when
accessing pointer from zero-sized allocation which should obviously
never happen.
2021-07-12 10:02:18 +02:00
Ondřej Surý
d1a9e549b1 Fix the real allocation size in OpenBSD rallocx shim
In the rallocx() shim for OpenBSD (that's the only platform that doesn't
have malloc_size() or malloc_usable_size() equivalent), the newly
allocated size was missing the extra size_t member for storing the
allocation size leading to size_t sized overflow at the end of the
reallocated memory chunk.
2021-07-12 08:43:14 +02:00
Mark Andrews
592a4bc456 Merge branch '2703-gcc-10-fanalyzer-reports-dereference-of-null-text-in-server-c-14721' into 'main'
Resolve "gcc-10+ -fanalyzer reports dereference of NULL ‘text’ in server.c:14721"

Closes #2703

See merge request isc-projects/bind9!5047
2021-07-12 04:28:50 +00:00
Mark Andrews
ac0fc3c2de Add DBC REQUIRE to check that 'text' is non NULL
for all control channel commands.  This should silence
gcc-10-analyzer reporting NULL pointer dereference of 'text'.
2021-07-12 03:55:37 +00:00
Mark Andrews
7301ab8b47 Merge branch '2753-timer_test-subtests-are-not-independent' into 'main'
Resolve "timer_test subtests are not independent"

Closes #2753

See merge request isc-projects/bind9!5146
2021-07-12 03:55:00 +00:00
Mark Andrews
3945c289bb Reset errcnt at the start of each subtest 2021-07-12 03:47:11 +00:00
Mark Andrews
1e84ebd2f8 Merge branch '2808-v9_16-unchecked-returns-in-rbtdb_test-c-and-dnssec-signzone-c-main' into 'main'
Fix unchecked return of isc_rwlock_lock and isc_rwlock_unlock

Closes #2808

See merge request isc-projects/bind9!5257
2021-07-12 03:46:15 +00:00
Mark Andrews
9528ba5a22 Fix unchecked returns of dns_name_fromtext
(cherry picked from commit 8538c762cb)
2021-07-12 13:26:29 +10:00
Mark Andrews
ce5207699d Fix unchecked return of isc_rwlock_lock and isc_rwlock_unlock
(cherry picked from commit bcaf23dd27)
2021-07-12 13:26:29 +10:00
Mark Andrews
70a7973135 Merge branch '2249-stop-falling-back-to-plain-dns-on-formerr-opt' into 'main'
Resolve "Stop falling back to plain DNS on FORMERR+OPT"

Closes #2249

See merge request isc-projects/bind9!4634
2021-07-12 02:59:19 +00:00
Mark Andrews
e9c72ca95c Add release note for [GL #2249] 2021-07-12 12:33:46 +10:00
Mark Andrews
5ab0c9fdfe Add CHANGES note for [GL #2249] 2021-07-12 12:33:46 +10:00
Mark Andrews
3c942a3e3a Update out of date comment 2021-07-12 12:33:46 +10:00
Mark Andrews
0477938e2f Adjust expected queries for no fallback to plain DNS 2021-07-12 12:30:03 +10:00
Mark Andrews
a3fda086f7 Check that there was no OPT record before falling back
to plain DNS on FORMERR.
2021-07-12 12:30:03 +10:00
Mark Andrews
fb4b9d690f Merge branch '2810-silence-untrusted-loop-bound' into 'main'
Resolve "Silence untrusted loop bound"

Closes #2810

See merge request isc-projects/bind9!5251
2021-07-12 02:09:41 +00:00
Mark Andrews
c5e1c35e45 Silence untrusted loop bound on nsec3param.iterations
630
   	    1. tainted_argument: Calling function dns_rdata_tostruct taints argument nsec3param.iterations. [show details]
    631        result = dns_rdata_tostruct(nsec3rdata, &nsec3param, NULL);
   	    2. Condition !!(result == 0), taking true branch.
   	    3. Condition !!(result == 0), taking true branch.
    632        RUNTIME_CHECK(result == ISC_R_SUCCESS);
    633
    634        dns_fixedname_init(&fixed);

            CID 281425 (#1 of 1): Untrusted loop bound (TAINTED_SCALAR)
            4. tainted_data: Passing tainted expression nsec3param.iterations to dns_nsec3_hashname, which uses it as a loop boundary. [show details]
   	    Ensure that tainted values are properly sanitized, by checking that their values are within a permissible range.
    635        result = dns_nsec3_hashname(&fixed, rawhash, &rhsize, vctx->origin,
    636                                    vctx->origin, nsec3param.hash,
    637                                    nsec3param.iterations, nsec3param.salt,
    638                                    nsec3param.salt_length);
2021-07-12 00:48:13 +00:00
Mark Andrews
ad17419313 Merge branch '2807-coverity-reports-use-of-tainted-scalar' into 'main'
Resolve "Coverity reports use of tainted scalar"

Closes #2807

See merge request isc-projects/bind9!5249
2021-07-12 00:42:27 +00:00
Mark Andrews
f0fdca90f2 Silence tainted scalar on rdlen
2042        ttl = isc_buffer_getuint32(&j->it.source);
    	    13. tainted_data_transitive: Call to function isc_buffer_getuint16 with tainted argument *j->it.source.base returns tainted data. [show details]
    	    14. var_assign: Assigning: rdlen = isc_buffer_getuint16(&j->it.source), which taints rdlen.
    2043        rdlen = isc_buffer_getuint16(&j->it.source);
    2044
    2045        /*
    2046         * Parse the rdata.
    2047         */
    	    15. Condition j->it.source.used - j->it.source.current != rdlen, taking false branch.
    2048        if (isc_buffer_remaininglength(&j->it.source) != rdlen) {
    2049                FAIL(DNS_R_FORMERR);
    2050        }
    	    16. var_assign_var: Assigning: j->it.source.active = j->it.source.current + rdlen. Both are now tainted.
    2051        isc_buffer_setactive(&j->it.source, rdlen);
    2052        dns_rdata_reset(&j->it.rdata);
    	    17. lower_bounds: Checking lower bounds of unsigned scalar j->it.source.active by taking the true branch of j->it.source.active > j->it.source.current.

    CID 316506 (#1 of 1): Untrusted loop bound (TAINTED_SCALAR)
    18. tainted_data: Passing tainted expression j->it.source.active to dns_rdata_fromwire, which uses it as a loop boundary. [show details]
    	    Ensure that tainted values are properly sanitized, by checking that their values are within a permissible range.
    2053        CHECK(dns_rdata_fromwire(&j->it.rdata, rdclass, rdtype, &j->it.source,
    2054                                 &j->it.dctx, 0, &j->it.target));
2021-07-12 00:22:07 +00:00
Mark Andrews
83fd38dd2c Silence use of tainted scalar
2607
            43. tainted_argument: Calling function journal_read_xhdr taints argument xhdr.size. [show details]
    2608                        result = journal_read_xhdr(j1, &xhdr);
            44. Condition rewrite, taking true branch.
            45. Condition result == 29, taking false branch.
    2609                        if (rewrite && result == ISC_R_NOMORE) {
    2610                                break;
    2611                        }
            46. Condition result != 0, taking false branch.
    2612                        CHECK(result);
    2613
            47. var_assign_var: Assigning: size = xhdr.size. Both are now tainted.
    2614                        size = xhdr.size;

            CID 331088 (#3 of 3): Untrusted allocation size (TAINTED_SCALAR)
            48. tainted_data: Passing tainted expression size to isc__mem_get, which uses it as an allocation size. [show details]
            Ensure that tainted values are properly sanitized, by checking that their values are within a permissible range.
    2615                        buf = isc_mem_get(mctx, size);
2021-07-12 00:22:07 +00:00
Ondřej Surý
d7aa979a6c Merge branch '2812-fix-get-realloc-put-mismatch-in-netmgr' into 'main'
Revert the allocate/free -> get/put change from jemalloc change

Closes #2812

See merge request isc-projects/bind9!5252
2021-07-09 16:57:05 +00:00
Ondřej Surý
29a285a67d Revert the allocate/free -> get/put change from jemalloc change
In the jemalloc merge request, we missed the fact that ah_frees and ah_handles
are reallocated which is not compatible with using isc_mem_get() for allocation
and isc_mem_put() for deallocation.  This commit reverts that part and restores
use of isc_mem_allocate() and isc_mem_free().
2021-07-09 18:19:57 +02:00
Ondřej Surý
2ceca6f24d Merge branch '2433-improve-memory-contention' into 'main'
Reduce the contention of the memory allocator

Closes #2433

See merge request isc-projects/bind9!5012
2021-07-09 14:27:24 +00:00
Artem Boldariev
c55a747704 Merge branch 'artem/doh-ignore-accept-header' into 'main'
DoH: Improve compatiblity by ignoring an "Accept" HTTP header value

See merge request isc-projects/bind9!5246
2021-07-09 14:00:32 +00:00