Commit Graph

33478 Commits

Author SHA1 Message Date
Mark Andrews
498de906fa Check opcode of messages returned by dns_request_getresponse
(cherry picked from commit ed4e00713f)
2021-07-21 12:40:47 +10:00
Michal Nowak
7f25f79afd Merge branch 'mnowak/process-core-dumps-when-named-fails-to-start-v9_16' into 'v9_16'
[v9_16] Process core dump from named which failed to start

See merge request isc-projects/bind9!5281
2021-07-16 16:35:16 +00:00
Michal Nowak
195b88cb22 Fix handling of restart option in run.sh
The support for stat.pl's --restart option was incomplete in run.sh.
This change makes sure it's handled properly and that named.run file is
not being removed by clean.sh when the --restart option is used.

(cherry picked from commit a39697635b)
2021-07-16 17:37:58 +02:00
Michal Nowak
3e0f3e1d57 Process core dump from named which failed to start
When named failed to start and produced core dump, the core file wasn't
processed by GDB because of run.sh script exiting immediately. This
remedies the limitation, simplifies the surrounding code, and makes the
script shellcheck clean.

(cherry picked from commit bc097d3358)
2021-07-16 17:27:24 +02:00
Michal Nowak
f81887f8ae Merge branch 'mnowak/replace-literal-blocks-with-anchors-v9_16' into 'v9_16'
[v9_16] Use anchors instead of literal blocks in .gitlab-ci.yml

See merge request isc-projects/bind9!5279
2021-07-16 14:33:13 +00:00
Michal Nowak
77eb928b79 Use anchors instead of literal blocks in .gitlab-ci.yml
Anchor lets the user see the full command logged in GitLab CI:

    ${CONFIGURE} --disable-maintainer-mode --enable-developer ...

Instead of a folded multi-line when literal block is used:

    ${CONFIGURE} \ # collapsed multi-line command

(cherry picked from commit c22008629e)
2021-07-16 15:52:28 +02:00
Michał Kępień
ddd8b166bf Merge branch '2759-extend-tests-for-signed-cname-sourced-delegations-v9_16' into 'v9_16'
[v9_16] Extend tests for signed, CNAME-sourced delegations

See merge request isc-projects/bind9!5277
2021-07-16 05:45:04 +00:00
Michał Kępień
5c8f3463d5 Extend tests for signed, CNAME-sourced delegations
Extend the "chain" system test with AUTHORITY section checks for signed,
secure delegations.  This complements the checks for signed, insecure
delegations added by commit 82b7e6ccef.

Extend the existing AUTHORITY section checks for signed, insecure
delegations to ensure nonexistence of DS RRsets in such responses.
Adjust comments accordingly.

Ensure dig failures cause the "chain" system test to fail.

(cherry picked from commit a14efdf54c)
2021-07-16 07:24:34 +02:00
Michał Kępień
f81c8e3e73 Tweak query_addds() comments to avoid confusion
It has been noticed that commit f88c90f47f
did not only fix NSEC record handling in signed, insecure delegations
prepared using both wildcard expansion and CNAME chaining - it also
inadvertently fixed DS record handling in signed, secure delegations
of that flavor.  This is because the 'rdataset' variable in the relevant
location in query_addds() can be either a DS RRset or an NSEC RRset.
Update a code comment in query_addds() to avoid confusion.

Update the comments describing the purpose of query_addds() so that they
also mention NSEC(3) records.

(cherry picked from commit 29d8d35869)
2021-07-16 07:24:34 +02:00
Mark Andrews
0bf3553d5a Merge branch '2820-rndc-reconfig-does-not-act-on-change-to-zone-statistics-v9_16' into 'v9_16'
Test that 'zone-statistics full;' is properly processed

See merge request isc-projects/bind9!5276
2021-07-16 04:34:01 +00:00
Mark Andrews
64beb36f73 Add CHANGES for [GL #2820]
(cherry picked from commit f2461afff7)
2021-07-16 14:13:49 +10:00
Mark Andrews
5d9dced395 zone->requeststats_on was not being set at the correct point
(cherry picked from commit 616896d735)
2021-07-16 14:13:49 +10:00
Mark Andrews
5e4f22aa83 Test that 'zone-statistics full;' is properly processed
(cherry picked from commit 592f9ff6bc)
2021-07-16 14:13:49 +10:00
Matthijs Mekking
ec66f8ff35 Merge branch '2710-multisigner-cds-v9_16' into 'v9_16'
Allow update CDS/CDNSKEY records that do not match DNSKEY (9.16)

See merge request isc-projects/bind9!5275
2021-07-15 08:21:44 +00:00
Matthijs Mekking
4415688d44 Add change and release notes [#2710]
(cherry picked from commit ba5869943d)
2021-07-15 09:26:40 +02:00
Matthijs Mekking
65f58d68f0 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.

(cherry picked from commit 577bf913b9)
2021-07-15 09:26:16 +02:00
Matthijs Mekking
9aeadf31f0 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.

(cherry picked from commit 6b79db1fdd)
2021-07-15 09:26:11 +02:00
Evan Hunt
e2606d1ccb Merge branch 'each-doc-trampoline-v9_16' into 'v9_16'
document isc__trampoline

See merge request isc-projects/bind9!5274
2021-07-14 18:00:52 +00:00
Evan Hunt
312c78809a document isc__trampoline
Added some header file documentation to the isc__trampoline
implementation in trampoline_p.h.
2021-07-14 10:56:42 -07:00
Ondřej Surý
58aa9658a6 Merge branch '2822-inconsistent-recursive-performance-v9_16' into 'v9_16'
Disable setting the thread affinity (v9.16)

See merge request isc-projects/bind9!5269
2021-07-13 14:16:23 +00:00
Ondřej Surý
7791181840 Add CHANGES and release notes for [GL #2822]
(cherry picked from commit 41afe6bc5e)
2021-07-13 15:48:30 +02:00
Ondřej Surý
46ecb94cb6 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.

(cherry picked from commit 4c5dc1904b)
2021-07-13 15:48:27 +02:00
Ondřej Surý
c546545d32 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.

(cherry picked from commit a9e6a7ae57)
2021-07-13 15:47:13 +02:00
Matthijs Mekking
4adfe6140a Merge branch '2811-checkds-memleak-shutdown-v9_16' into 'v9_16'
Fix leak in checkds code (9.16)

See merge request isc-projects/bind9!5266
2021-07-13 09:57:59 +00:00
Matthijs Mekking
6323c4e2dd Add change entry for [#2811]
(cherry picked from commit 2ccf342690)
2021-07-13 11:20:51 +02:00
Matthijs Mekking
ed4358da37 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.

(cherry picked from commit b676163933)
2021-07-13 11:20:24 +02:00
Mark Andrews
f89c282d73 Merge branch '2703-gcc-10-fanalyzer-reports-dereference-of-null-text-in-server-c-14721-v9_16' into 'v9_16'
Add DBC REQUIRE to check that 'text' is non NULL

See merge request isc-projects/bind9!5259
2021-07-12 06:11:13 +00:00
Mark Andrews
1f36600e5a 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'.

(cherry picked from commit ac0fc3c2de)
2021-07-12 14:55:46 +10:00
Mark Andrews
27c1aadb65 Merge branch '2753-timer_test-subtests-are-not-independent-v9_16' into 'v9_16'
Reset errcnt at the start of each subtest

See merge request isc-projects/bind9!5258
2021-07-12 04:26:59 +00:00
Mark Andrews
928af4c424 Reset errcnt at the start of each subtest
(cherry picked from commit 3945c289bb)
2021-07-12 13:57:34 +10:00
Mark Andrews
c27625bddf Merge branch '2808-v9_16-unchecked-returns-in-rbtdb_test-c-and-dnssec-signzone-c' into 'v9_16'
Resolve "v9_16 unchecked returns in rbtdb_test.c and dnssec-signzone.c"

See merge request isc-projects/bind9!5250
2021-07-12 03:23:41 +00:00
Mark Andrews
8538c762cb Fix unchecked returns of dns_name_fromtext 2021-07-12 02:40:25 +00:00
Mark Andrews
bcaf23dd27 Fix unchecked return of isc_rwlock_lock and isc_rwlock_unlock 2021-07-12 02:40:25 +00:00
Mark Andrews
f8a0a1d61f Merge branch '2810-silence-untrusted-loop-bound-v9_16' into 'v9_16'
Silence untrusted loop bound on nsec3param.iterations

See merge request isc-projects/bind9!5256
2021-07-12 02:36:05 +00:00
Mark Andrews
5f82841098 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);

(cherry picked from commit c5e1c35e45)
2021-07-12 12:16:29 +10:00
Mark Andrews
7616ee40df Merge branch '2807-coverity-reports-use-of-tainted-scalar-v9_16' into 'v9_16'
Silence use of tainted scalar

See merge request isc-projects/bind9!5255
2021-07-12 02:13:39 +00:00
Mark Andrews
ac34c3f552 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));

(cherry picked from commit f0fdca90f2)
2021-07-12 10:45:42 +10:00
Mark Andrews
b212d29a71 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);

(cherry picked from commit 83fd38dd2c)
2021-07-12 10:45:42 +10:00
Evan Hunt
6f4ea63372 Merge branch '2756-rndc-multiple-algorithm-v9_16' into 'v9_16'
allow multiple key algorithms in the same control listener

See merge request isc-projects/bind9!5247
2021-07-06 20:36:07 +00:00
Evan Hunt
331b8aebe9 CHANGES
(cherry picked from commit a605a84b08)
2021-07-06 12:55:30 -07:00
Evan Hunt
68a40622ef allow multiple key algorithms in the same control listener
if a control channel listener was configured with more than one
key algorithm, message verification would be attempted with each
algorithm in turn. if the first key failed due to the wrong
signature length, the entire verification process was aborted,
rather than continuing on to try with another key.

(cherry picked from commit 841b557df8)
2021-07-06 12:55:28 -07:00
Mark Andrews
444585080c Merge branch 'marka-xmllint-html-v9_16' into 'v9_16'
Check for errors in html files

See merge request isc-projects/bind9!5243
2021-07-02 04:28:28 +00:00
Mark Andrews
80bc1b4715 Check for errors in html files
xmllint doesn't know about the HTML 5 <section> tag so filter
those out.

(cherry picked from commit ea0624b214)
2021-07-02 13:42:27 +10:00
Matthijs Mekking
71fc32ce8a Merge branch '2786-keyfile-locking-race-condition-deadlock-v9_16' into 'v9_16'
Fix possible deadlock when locking key files (9.16)

See merge request isc-projects/bind9!5240
2021-07-01 13:56:29 +00:00
Matthijs Mekking
c17010d390 Add release note and change for [#2786]
(cherry picked from commit be87edd249)
2021-07-01 15:45:17 +02:00
Matthijs Mekking
e36b6312de Merge branch '1126-checkds-v9_16' into 'v9_16'
Backport checkds to 9.16

See merge request isc-projects/bind9!5239
2021-07-01 13:44:30 +00:00
Matthijs Mekking
7e9fb5deda Fix CID 332468: Memory - illegal accesses (UNINIT)
*** CID 332468:  Memory - illegal accesses  (UNINIT)
/lib/dns/zone.c: 6613 in dns_zone_getdnsseckeys()
6607                 ISC_LIST_UNLINK(dnskeys, k1, link);
6608                 ISC_LIST_APPEND(*keys, k1, link);
6609             }
6610         }
6611     6612     failure:
>>>     CID 332468:  Memory - illegal accesses  (UNINIT)
>>>     Using uninitialized value "keyset.methods" when calling
>>>     "dns_rdataset_isassociated".
6613         if (dns_rdataset_isassociated(&keyset)) {
6614             dns_rdataset_disassociate(&keyset);
6615         }
6616         if (node != NULL) {
6617             dns_db_detachnode(db, &node);
6618         }

Fix by initializing the 'keyset' with 'dns_rdataset_init'.
2021-07-01 14:59:00 +02:00
Matthijs Mekking
e814422e23 Fix windows build
The checkds feature added new functions that required no specific
additional changes for Windows (because the Windows support has been
dropped), but for 9.16 we still need to define them in libdns.def.in.
2021-07-01 14:48:47 +02:00
Matthijs Mekking
d02002321c Move private_type_record() to conf.sh.common
The function 'private_type_record()' is now used in multiple system
setup scripts and should be moved to the common configuration script
conf.sh.common.

(cherry picked from commit c92128eada)
2021-07-01 14:48:47 +02:00
Matthijs Mekking
efb92dd98c Add change and release note for [#1126]
Seems pretty newsworthy.

(cherry picked from commit 22cd63bf81)
2021-07-01 14:48:47 +02:00