]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
5 years agoAddress theoretical resource leak in dns_dt_open()
Mark Andrews [Sun, 21 Feb 2021 22:44:56 +0000 (09:44 +1100)] 
Address theoretical resource leak in dns_dt_open()

dns_dt_open() is not currently called with mode dns_dtmode_unix.

    *** CID 281489:  Resource leaks  (RESOURCE_LEAK)
    /lib/dns/dnstap.c: 983 in dns_dt_open()
    977
    978      if (!dnstap_file(handle->reader)) {
    979      CHECK(DNS_R_BADDNSTAP);
    980      }
    981      break;
    982      case dns_dtmode_unix:
       CID 281489:  Resource leaks  (RESOURCE_LEAK)
       Variable "handle" going out of scope leaks the storage it points to.
    983      return (ISC_R_NOTIMPLEMENTED);
    984      default:
    985      INSIST(0);
    986      ISC_UNREACHABLE();
    987      }
    988

(cherry picked from commit 003dd8cc700931509a6dfac4a4faab4084a2f085)

5 years agoMerge branch '2499-a-loc-record-with-a-invalid-direction-field-triggers-an-insist...
Mark Andrews [Fri, 19 Feb 2021 01:14:00 +0000 (01:14 +0000)] 
Merge branch '2499-a-loc-record-with-a-invalid-direction-field-triggers-an-insist-v9_16' into 'v9_16'

Resolve "A LOC record with a invalid direction field triggers an INSIST"

See merge request isc-projects/bind9!4711

5 years agoAdd release note for [GL #2499]
Mark Andrews [Thu, 18 Feb 2021 06:02:27 +0000 (17:02 +1100)] 
Add release note for [GL #2499]

(cherry picked from commit 3d340ecfd2f4a703608a001c6821949b534c9312)

5 years agoAdd CHANGES for [GL #2499]
Mark Andrews [Thu, 18 Feb 2021 05:59:57 +0000 (16:59 +1100)] 
Add CHANGES for [GL #2499]

(cherry picked from commit 6f47e0956ccb9f02e40875b864c780565a816160)

5 years agoCorrectly detect when get_direction failed
Mark Andrews [Thu, 18 Feb 2021 05:57:28 +0000 (16:57 +1100)] 
Correctly detect when get_direction failed

(cherry picked from commit 009358d77d68ea6ad90702a951483beb11717c00)

5 years agoTest a LOC record with an invalid direction field
Mark Andrews [Thu, 18 Feb 2021 05:56:51 +0000 (16:56 +1100)] 
Test a LOC record with an invalid direction field

(cherry picked from commit 07902d9f9d2d7eac5aa722237f863ac6745bb1d8)

5 years agoMerge branch 'mnowak/fix-feature-test-tool-location-v9_16' into 'v9_16'
Michal Nowak [Thu, 18 Feb 2021 14:56:58 +0000 (14:56 +0000)] 
Merge branch 'mnowak/fix-feature-test-tool-location-v9_16' into 'v9_16'

[v9_16] Use FEATURETEST variable instead of a path

See merge request isc-projects/bind9!4707

5 years agoUse FEATURETEST variable instead of a path
Michal Nowak [Wed, 17 Feb 2021 08:20:25 +0000 (09:20 +0100)] 
Use FEATURETEST variable instead of a path

feature-test tool location needs to be determined by its associated
variable; otherwise, the tool is not found on Windows:

    setup.sh: line 22: ../feature-test: No such file or directory

(cherry picked from commit 102f01263125bfb4676e7fea6bfeb3edb19f8ae1)

5 years agoMerge branch 'mnowak/make-kyua-report-html-less-verbose' into 'v9_16'
Michal Nowak [Thu, 18 Feb 2021 14:47:39 +0000 (14:47 +0000)] 
Merge branch 'mnowak/make-kyua-report-html-less-verbose' into 'v9_16'

Make "kyua report-html" less verbose on stdout

See merge request isc-projects/bind9!4688

5 years agoMake "kyua report-html" less verbose on stdout
Michal Nowak [Tue, 16 Feb 2021 15:43:13 +0000 (16:43 +0100)] 
Make "kyua report-html" less verbose on stdout

"kyua report-html" command in CI generates more than two pages of output
to stdout, which is nothing but which HTML pages Kyua generated, e.g.:

  Generating kyua_html/context.html
  Generating kyua_html/lib_dns_tests_acl_test_main.html
  ...
  Generating kyua_html/lib_ns_tests_query_test_main.html
  Generating kyua_html/report.css
  Generating kyua_html/index.html

This is seldomly useful and requires the user to scroll three pages
upwards to get to unit test results.

5 years agoMerge branch '1810-followup-9_16' into 'v9_16'
Matthijs Mekking [Thu, 18 Feb 2021 09:40:59 +0000 (09:40 +0000)] 
Merge branch '1810-followup-9_16' into 'v9_16'

Fix backport "Refactor ecdsa and eddsa tests after testcrypto.sh changes" (9.16)

See merge request isc-projects/bind9!4695

5 years agoFix eddsa system test
Matthijs Mekking [Wed, 17 Feb 2021 09:31:27 +0000 (10:31 +0100)] 
Fix eddsa system test

Use the correct conf.sh setup commands in ns3/sign.sh

5 years agoMerge branch 'mnowak/system-test-check-for-file-not-removed-v9_16' into 'v9_16'
Michal Nowak [Thu, 18 Feb 2021 08:04:17 +0000 (08:04 +0000)] 
Merge branch 'mnowak/system-test-check-for-file-not-removed-v9_16' into 'v9_16'

[v9_16] Check for "file not removed" in system test output

See merge request isc-projects/bind9!4698

5 years agoPrevent Git to expand $systest
Michal Nowak [Tue, 16 Feb 2021 10:33:58 +0000 (11:33 +0100)] 
Prevent Git to expand $systest

CentOS 8 "git status" unexpectedly expands search directory "tsig" to
also search in the "tsiggss" directory, thus incorrectly identifying
files as "not removed" in the "tsig" directory:

$ git status -su --ignored tsig
$ touch tsiggss/ns1/{named.run,named.memstats}
$ git status -su --ignored tsig
!! tsiggss/ns1/named.memstats
!! tsiggss/ns1/named.run

(cherry picked from commit f310b7525031e2017d4d793e9db5cb5a83392851)

5 years agoClean omitted files from system tests
Michal Nowak [Mon, 15 Feb 2021 11:48:54 +0000 (12:48 +0100)] 
Clean omitted files from system tests

Any CI job:
- I:dnssec:file dnssec/ns1/trusted.keys not removed
- I:rpzrecurse:file rpzrecurse/ns3/named.run.prev not removed

system:gcc:sid:amd64:
- I:mirror:file mirror/ns3/_default.nzf not removed

system:gcc:xenial:amd64:
- I:shutdown:file shutdown/.cache/v/cache/lastfailed not removed

(cherry picked from commit 14a104d1211611aa0d5465bd339a7d4c711acf33)

5 years agoCheck for "file not removed" in system test output
Michal Nowak [Mon, 15 Feb 2021 10:59:33 +0000 (11:59 +0100)] 
Check for "file not removed" in system test output

Run this check only when in Git repository, because run.sh produces the
"file not removed" warnings only when in Git repository.

(cherry picked from commit 4a2778abdff4b91bde3cdc5cf28e22a77494b206)

5 years agoAdd system test name to "file not removed" info
Michal Nowak [Mon, 15 Feb 2021 11:03:52 +0000 (12:03 +0100)] 
Add system test name to "file not removed" info

(cherry picked from commit 10bf725ee2500d5469ead305b6684b150267ff4d)

5 years agoMerge branch 'v9_16_12-release' into 'v9_16'
Michał Kępień [Wed, 17 Feb 2021 21:48:47 +0000 (21:48 +0000)] 
Merge branch 'v9_16_12-release' into 'v9_16'

Merge 9.16.12 release branch

See merge request isc-projects/bind9!4700

5 years agoSet up release notes for BIND 9.16.13
Michał Kępień [Wed, 17 Feb 2021 21:39:53 +0000 (22:39 +0100)] 
Set up release notes for BIND 9.16.13

5 years agoMerge branch 'prep-release' into security-v9_16
Tinderbox User [Thu, 4 Feb 2021 11:35:16 +0000 (11:35 +0000)] 
Merge branch 'prep-release' into security-v9_16

5 years agoMerge branch 'michal/prepare-documentation-for-bind-9.16.12' into 'security-v9_16'
Michał Kępień [Thu, 4 Feb 2021 11:21:27 +0000 (11:21 +0000)] 
Merge branch 'michal/prepare-documentation-for-bind-9.16.12' into 'security-v9_16'

Prepare documentation for BIND 9.16.12

See merge request isc-private/bind9!240

5 years agoprep 9.16.12
Tinderbox User [Thu, 4 Feb 2021 11:25:53 +0000 (11:25 +0000)] 
prep 9.16.12

5 years agoMerge branch '2354-security-off-by-one-error-in-spnego-v9_16' into 'security-v9_16'
Michał Kępień [Thu, 4 Feb 2021 10:50:14 +0000 (10:50 +0000)] 
Merge branch '2354-security-off-by-one-error-in-spnego-v9_16' into 'security-v9_16'

[v9_16] [CVE-2020-8625] Fix off-by-one bug in ISC SPNEGO implementation

See merge request isc-private/bind9!235

5 years agoPrepare release notes for BIND 9.16.12
Michał Kępień [Thu, 4 Feb 2021 11:07:40 +0000 (12:07 +0100)] 
Prepare release notes for BIND 9.16.12

5 years agoAdd CHANGES and release note for GL #2354
Ondřej Surý [Tue, 26 Jan 2021 08:04:31 +0000 (09:04 +0100)] 
Add CHANGES and release note for GL #2354

5 years agoAdd release note for GL #2073
Michał Kępień [Thu, 4 Feb 2021 11:07:40 +0000 (12:07 +0100)] 
Add release note for GL #2073

5 years agoFix off-by-one bug in ISC SPNEGO implementation
Ondřej Surý [Thu, 7 Jan 2021 09:44:46 +0000 (10:44 +0100)] 
Fix off-by-one bug in ISC SPNEGO implementation

The ISC SPNEGO implementation is based on mod_auth_kerb code.  When
CVE-2006-5989 was disclosed, the relevant fix was not applied to the
BIND 9 codebase, making the latter vulnerable to the aforementioned flaw
when "tkey-gssapi-keytab" or "tkey-gssapi-credential" is set in
named.conf.

The original description of CVE-2006-5989 was:

    Off-by-one error in the der_get_oid function in mod_auth_kerb 5.0
    allows remote attackers to cause a denial of service (crash) via a
    crafted Kerberos message that triggers a heap-based buffer overflow
    in the component array.

Later research revealed that this flaw also theoretically enables remote
code execution, though achieving the latter in real-world conditions is
currently deemed very difficult.

This vulnerability was responsibly reported as ZDI-CAN-12302 ("ISC BIND
TKEY Query Heap-based Buffer Overflow Remote Code Execution
Vulnerability") by Trend Micro Zero Day Initiative.

5 years agoReorder release notes
Michał Kępień [Thu, 4 Feb 2021 11:07:40 +0000 (12:07 +0100)] 
Reorder release notes

5 years agoTweak and reword release notes
Michał Kępień [Thu, 4 Feb 2021 11:07:40 +0000 (12:07 +0100)] 
Tweak and reword release notes

5 years agoTweak and reword recent CHANGES entries
Michał Kępień [Thu, 4 Feb 2021 11:07:40 +0000 (12:07 +0100)] 
Tweak and reword recent CHANGES entries

5 years agoUse :rfc:`<number>` references in release notes
Michał Kępień [Thu, 4 Feb 2021 11:07:40 +0000 (12:07 +0100)] 
Use :rfc:`<number>` references in release notes

5 years agoMerge branch '2487-rollback-setting-dontfrag-option-v9_16' into 'v9_16'
Ondřej Surý [Wed, 17 Feb 2021 14:25:38 +0000 (14:25 +0000)] 
Merge branch '2487-rollback-setting-dontfrag-option-v9_16' into 'v9_16'

Rollback setting IP_DONTFRAG option on the UDP sockets (v9.16)

See merge request isc-projects/bind9!4697

5 years agoAdd CHANGES and release notes for GL #2487
Ondřej Surý [Thu, 11 Feb 2021 07:43:51 +0000 (08:43 +0100)] 
Add CHANGES and release notes for GL #2487

(cherry picked from commit 6d442e9c043dfd5bfb9d7af392dd19adc6ecc129)

5 years agoRollback setting IP_DONTFRAG option on the UDP sockets
Ondřej Surý [Thu, 11 Feb 2021 07:37:52 +0000 (08:37 +0100)] 
Rollback setting IP_DONTFRAG option on the UDP sockets

In DNS Flag Day 2020, the development branch started setting the
IP_DONTFRAG option on the UDP sockets.  It turned out, that this
code was incomplete leading to dropping the outgoing UDP packets.
Henceforth this commit rolls back this setting until we have a
proper fix that would send back empty response with TC flag set.

(cherry picked from commit 66eefac78c92b64b6689a1655cc677a2b1d13496)

5 years agoMerge branch 'mnowak/enable-dh-unit-test-to-run-under-pkcs11-v9_16' into 'v9_16'
Michal Nowak [Wed, 17 Feb 2021 11:54:23 +0000 (11:54 +0000)] 
Merge branch 'mnowak/enable-dh-unit-test-to-run-under-pkcs11-v9_16' into 'v9_16'

[v9_16] Drop USE_OPENSSL constraint from dh_test

See merge request isc-projects/bind9!4696

5 years agoDrop USE_OPENSSL constraint from dh_test
Michal Nowak [Tue, 26 Jan 2021 17:01:41 +0000 (18:01 +0100)] 
Drop USE_OPENSSL constraint from dh_test

The USE_OPENSSL constraint in dh_test does not seems to be necessary
anymore, the test runs with PKCS#11 as well.

(cherry picked from commit c341e7f740c65003e4300510c25cab2db50c1a4a)

5 years agoMerge branch 'mnowak/consistent-use-of-SKIPPED_TEST_EXIT_CODE-v9_16' into 'v9_16'
Michal Nowak [Wed, 17 Feb 2021 11:21:04 +0000 (11:21 +0000)] 
Merge branch 'mnowak/consistent-use-of-SKIPPED_TEST_EXIT_CODE-v9_16' into 'v9_16'

[v9_16] Ensure dnstap_test returns SKIPPED_TEST_EXIT_CODE

See merge request isc-projects/bind9!4686

5 years agoEnsure dnstap_test returns SKIPPED_TEST_EXIT_CODE
Michal Nowak [Mon, 15 Feb 2021 16:20:50 +0000 (17:20 +0100)] 
Ensure dnstap_test returns SKIPPED_TEST_EXIT_CODE

Make sure lib/dns/tests/dnstap_test returns an exit code that indicates
a skipped test when dnstap is not enabled.

(cherry picked from commit c2863417035ecf815ecd87df1722c4728f9eaaed)

5 years agoMerge branch 'mnowak/merge-skipped-and-untested-system-test-results-v9_16' into ...
Michal Nowak [Wed, 17 Feb 2021 11:15:05 +0000 (11:15 +0000)] 
Merge branch 'mnowak/merge-skipped-and-untested-system-test-results-v9_16' into 'v9_16'

[v9_16] Merge UNTESTED and SKIPPED system test results

See merge request isc-projects/bind9!4681

5 years agoAdd CHANGES note for [GL !4517]
Michal Nowak [Wed, 30 Dec 2020 13:15:23 +0000 (14:15 +0100)] 
Add CHANGES note for [GL !4517]

(cherry picked from commit 3cc3f1712b8a99dcfedd73dacc1b1b749e0603fb)

5 years agoUse BIND 9.17 preprocessor macro to skip unit test
Michal Nowak [Mon, 18 Jan 2021 18:15:44 +0000 (19:15 +0100)] 
Use BIND 9.17 preprocessor macro to skip unit test

BIND 9.17 changed exit code of skipped test to meet Automake
expectations in fa505bfb0e7623d7cfc94ae15a0246ae71000904. BIND 9.16 was
not rewritten to Automake, but for consistency reasons, the same
SKIPPED_TEST_EXIT_CODE preprocessor macro is used (though the actual
exit code differs from the one in BIND 9.17).

(cherry picked from commit fa505bfb0e7623d7cfc94ae15a0246ae71000904)

5 years agoMerge UNTESTED and SKIPPED system test results
Michal Nowak [Wed, 30 Dec 2020 12:22:46 +0000 (13:22 +0100)] 
Merge UNTESTED and SKIPPED system test results

Descriptions of UNTESTED and SKIPPED system test results are very
similar to one another and it may be confusing when to pick one and
when the other. Merging these two system test results removes the
confusion.

(cherry picked from commit 29d7c6e449f74653fd911e856b8b06a7f9994891)

5 years agoMerge branch 'each-note-cleanup-v9_16' into 'v9_16'
Evan Hunt [Wed, 17 Feb 2021 01:04:18 +0000 (01:04 +0000)] 
Merge branch 'each-note-cleanup-v9_16' into 'v9_16'

some release note corrections

See merge request isc-projects/bind9!4692

5 years agosome release note corrections
Evan Hunt [Tue, 16 Feb 2021 22:28:05 +0000 (14:28 -0800)] 
some release note corrections

(cherry picked from commit 3126eb652d25783a837690acfef7168f62a8fe5e)

5 years agoMerge branch '2402-bind-9-16-11-build-fails-with-static-openssl-library-v9_16' into...
Mark Andrews [Wed, 17 Feb 2021 00:27:12 +0000 (00:27 +0000)] 
Merge branch '2402-bind-9-16-11-build-fails-with-static-openssl-library-v9_16' into 'v9_16'

Resolve "BIND 9.16.11 build fails with static OpenSSL library"

See merge request isc-projects/bind9!4691

5 years agoAdd CHANGES for [GL #2402]
Mark Andrews [Fri, 22 Jan 2021 05:04:33 +0000 (16:04 +1100)] 
Add CHANGES for [GL #2402]

(cherry picked from commit 98dc47d351fa5a863b3fcdb68dccff33b2f98d42)

5 years agoFix linking order for OpenSSL libraries
Mark Andrews [Fri, 22 Jan 2021 04:59:03 +0000 (15:59 +1100)] 
Fix linking order for OpenSSL libraries

As libssl depends on libcrypto, -lssl needs to precede -lcrypto in
linker invocations or else the build will fail with static OpenSSL
libraries.  Adjust m4/ax_check_openssl.m4 to prevent this issue from
getting triggered when pkg-config files for OpenSSL are not available.

(cherry picked from commit 9223c7d59955f26d0898b27f2a758a176822cce9)

5 years agoMerge branch '2357-cannot-compile-current-versions-on-macos-catalina' into 'v9_16'
Ondřej Surý [Tue, 16 Feb 2021 12:21:07 +0000 (12:21 +0000)] 
Merge branch '2357-cannot-compile-current-versions-on-macos-catalina' into 'v9_16'

Resolve "Cannot compile current versions on macOS "Catalina""

See merge request isc-projects/bind9!4508

5 years agoStop including <gssapi.h> from <dst/gssapi.h> header
Mark Andrews [Mon, 15 Feb 2021 03:46:08 +0000 (14:46 +1100)] 
Stop including <gssapi.h> from <dst/gssapi.h> header

The only reason for including the gssapi.h from the dst/gssapi.h header
was to get the typedefs of gss_cred_id_t and gss_ctx_id_t.  Instead of
using those types directly this commit introduces dns_gss_cred_id_t and
dns_gss_ctx_id_t types that are being used in the public API and
privately retyped to their counterparts when we actually call the gss
api.

This also conceals the gssapi headers, so users of the libdns library
doesn't have to add GSSAPI_CFLAGS to the Makefile when including libdns
dst API.

5 years agoStop including dnstap headers from <dns/dnstap.h>
Ondřej Surý [Thu, 11 Feb 2021 13:25:58 +0000 (14:25 +0100)] 
Stop including dnstap headers from <dns/dnstap.h>

The <fstrm.h> and <protobuf-c/protobuf-c.h> headers are only directly
included where used and we stopped exposing those headers from libdns
headers.

5 years agoStop including <lmdb.h> from <dns/lmdb.h>
Mark Andrews [Mon, 15 Feb 2021 02:28:58 +0000 (13:28 +1100)] 
Stop including <lmdb.h> from <dns/lmdb.h>

The lmdb.h header doesn't have to be included from the dns/lmdb.h
header as it can be separately included where used.  This stops
exposing the inclusion of lmdb.h from the libdns headers.

5 years agoRe-order include directories
Mark Andrews [Tue, 22 Dec 2020 00:29:29 +0000 (11:29 +1100)] 
Re-order include directories

${FSTRM_CFLAGS} ${PROTOBUF_C_CFLAGS} ${OPENSSL_CFLAGS} ${LMDB_CFLAGS}
need to appear after all directories in the build tree.

5 years agoMerge branch '2041-bug-reconfig-auto-dnssec-high-thread-number-leak-resources-and...
Diego dos Santos Fronza [Mon, 15 Feb 2021 20:45:57 +0000 (20:45 +0000)] 
Merge branch '2041-bug-reconfig-auto-dnssec-high-thread-number-leak-resources-and-crash-named-v9_16' into 'v9_16'

Resolve "BUG reconfig+auto-dnssec+high thread number leak resources and crash named"

See merge request isc-projects/bind9!4677

5 years agoAdd CHANGES note for [GL #2041]
Diego Fronza [Mon, 15 Feb 2021 14:55:24 +0000 (11:55 -0300)] 
Add CHANGES note for [GL #2041]

5 years agoTest reconfig after adding inline signed zones won't crash named
Diego Fronza [Fri, 12 Feb 2021 19:53:34 +0000 (16:53 -0300)] 
Test reconfig after adding inline signed zones won't crash named

This test ensures that named won't crash after many inline-signed zones
are added to configurarion, followed by a rndc reconfig.

5 years agoFix dangling references to outdated views after reconfig
Diego Fronza [Thu, 11 Feb 2021 14:32:20 +0000 (11:32 -0300)] 
Fix dangling references to outdated views after reconfig

This commit fix a leak which was happening every time an inline-signed
zone was added to the configuration, followed by a rndc reconfig.

During the reconfig process, the secure version of every inline-signed
zone was "moved" to a new view upon a reconfig and it "took the raw
version along", but only once the secure version was freed (at shutdown)
was prev_view for the raw version detached from, causing the old view to
be released as well.

This caused dangling references to be kept for the previous view, thus
keeping all resources used by that view in memory.

5 years agoMerge branch 'pspacek/ci-python-allthetime-v9_16' into 'v9_16'
Petr Špaček [Mon, 15 Feb 2021 08:58:12 +0000 (08:58 +0000)] 
Merge branch 'pspacek/ci-python-allthetime-v9_16' into 'v9_16'

[v9_16]  Run Python linters in CI even outside of merge requests

See merge request isc-projects/bind9!4675

5 years agoRun Python linters in CI even outside of merge requests
Petr Špaček [Thu, 7 Jan 2021 13:44:13 +0000 (14:44 +0100)] 
Run Python linters in CI even outside of merge requests

Previously it did not get run on scheduled CI pipelines.

(cherry picked from commit 74d7cddc4c92c70e542da2321231bcb2164d91e0)

5 years agoMerge branch 'mnowak/check-for-unrecognized-options-v9_16' into 'v9_16'
Michal Nowak [Fri, 12 Feb 2021 13:31:39 +0000 (13:31 +0000)] 
Merge branch 'mnowak/check-for-unrecognized-options-v9_16' into 'v9_16'

[v9_16] Check for unrecognized configure options

See merge request isc-projects/bind9!4568

5 years agoAdd --enable-option-checking=fatal to ./configure in CI
Michal Nowak [Thu, 14 Jan 2021 11:09:04 +0000 (12:09 +0100)] 
Add --enable-option-checking=fatal to ./configure in CI

The --enable-option-checking=fatal option prevents ./configure from
proceeding when an unknown option is used in the ./configure step in CI.
This change will avoid adding unsupported ./configure options or options
with typo or typo in pairwise testing "# [pairwise: ...]" marker.

(cherry picked from commit 4295c82e457da715eada06cf0d7f4e2c8a788ae4)

5 years agoMerge branch '2312-lint-generated-manual-pages-v9_16' into 'v9_16'
Michal Nowak [Fri, 12 Feb 2021 12:21:55 +0000 (12:21 +0000)] 
Merge branch '2312-lint-generated-manual-pages-v9_16' into 'v9_16'

[v9_16] Lint manual pages

See merge request isc-projects/bind9!4673

5 years agoLint manual pages
Michal Nowak [Mon, 7 Dec 2020 17:08:53 +0000 (18:08 +0100)] 
Lint manual pages

As we generate manual pages from reStructuredText sources, we don't have
absolute control on manual page output and therefore 'mandoc -Tlint' may
always report warnings we can't eliminate. In light of this some mandoc
warnings need to be ignored.

(cherry picked from commit 22fdcb30db28c7f8f007640096459b3900473ad1)

5 years agoMerge branch '2421-cid-316509-untrusted-value-as-argument-tainted_scalar-v9_16' into...
Mark Andrews [Fri, 12 Feb 2021 00:01:28 +0000 (00:01 +0000)] 
Merge branch '2421-cid-316509-untrusted-value-as-argument-tainted_scalar-v9_16' into 'v9_16'

Resolve "CID 316509: Untrusted value as argument (TAINTED_SCALAR)"

See merge request isc-projects/bind9!4671

5 years agoSilence Insecure data handling (TAINTED_SCALAR)
Mark Andrews [Wed, 27 Jan 2021 06:17:36 +0000 (17:17 +1100)] 
Silence Insecure data handling (TAINTED_SCALAR)

Coverity assumes that the memory holding any value read using byte
swapping is tainted.  As we store the NSEC3PARAM records in wire
form and iterations is byte swapped the memory holding the record
is marked as tainted.  nsec3->salt_length is marked as tainted
transitively. To remove the taint the value need to be range checked.
For a correctly formatted record region.length should match
nsec3->salt_length and provides a convenient value to check the field
against.

    *** CID 316507:  Insecure data handling  (TAINTED_SCALAR)
    /lib/dns/rdata/generic/nsec3param_51.c: 241 in tostruct_nsec3param()
    235      region.length = rdata->length;
    236      nsec3param->hash = uint8_consume_fromregion(&region);
    237      nsec3param->flags = uint8_consume_fromregion(&region);
    238      nsec3param->iterations = uint16_consume_fromregion(&region);
    239
    240      nsec3param->salt_length = uint8_consume_fromregion(&region);
    >>>     CID 316507:  Insecure data handling  (TAINTED_SCALAR)
    >>>     Passing tainted expression "nsec3param->salt_length" to "mem_maybedup", which uses it as an offset.
    241      nsec3param->salt = mem_maybedup(mctx, region.base,
    242      nsec3param->salt_length);
    243      if (nsec3param->salt == NULL) {
    244      return (ISC_R_NOMEMORY);
    245      }
    246      isc_region_consume(&region, nsec3param->salt_length);

(cherry picked from commit c40133d84062cd5a92fb7ab90b9db5a348d2ae2b)

5 years agoSilence Untrusted value as argument (TAINTED_SCALAR)
Mark Andrews [Wed, 27 Jan 2021 06:11:52 +0000 (17:11 +1100)] 
Silence Untrusted value as argument (TAINTED_SCALAR)

Coverity assumes that the memory holding any value read using byte
swapping is tainted.  As we store the NSEC3 records in wire form
and iterations is byte swapped the memory holding the record is
marked as tainted.  nsec3->salt_length and nsec3->next_length are
marked as tainted transitively. To remove the taint the values need
to be range checked.  Valid values for these should never exceed
region.length so that is becomes a reasonable value to check against.

    *** CID 316509:    (TAINTED_SCALAR)
    /lib/dns/rdata/generic/nsec3_50.c: 312 in tostruct_nsec3()
    306      if (nsec3->salt == NULL) {
    307      return (ISC_R_NOMEMORY);
    308      }
    309      isc_region_consume(&region, nsec3->salt_length);
    310
    311      nsec3->next_length = uint8_consume_fromregion(&region);
    >>>     CID 316509:    (TAINTED_SCALAR)
    >>>     Passing tainted expression "nsec3->next_length" to "mem_maybedup", which uses it as an offset.
    312      nsec3->next = mem_maybedup(mctx, region.base, nsec3->next_length);
    313      if (nsec3->next == NULL) {
    314      goto cleanup;
    315      }
    316      isc_region_consume(&region, nsec3->next_length);
    317
    /lib/dns/rdata/generic/nsec3_50.c: 305 in tostruct_nsec3()
    299      region.length = rdata->length;
    300      nsec3->hash = uint8_consume_fromregion(&region);
    301      nsec3->flags = uint8_consume_fromregion(&region);
    302      nsec3->iterations = uint16_consume_fromregion(&region);
    303
    304      nsec3->salt_length = uint8_consume_fromregion(&region);
    >>>     CID 316509:    (TAINTED_SCALAR)
    >>>     Passing tainted expression "nsec3->salt_length" to "mem_maybedup", which uses it as an offset.
    305      nsec3->salt = mem_maybedup(mctx, region.base, nsec3->salt_length);
    306      if (nsec3->salt == NULL) {
    307      return (ISC_R_NOMEMORY);
    308      }
    309      isc_region_consume(&region, nsec3->salt_length);
    310

(cherry picked from commit fd8d1337a53a68c5e3145dadec173674f2db0cfb)

5 years agoMerge branch 'mnowak/enable-libns-tests-to-run-under-asan-v9_16' into 'v9_16'
Michal Nowak [Wed, 10 Feb 2021 10:37:12 +0000 (10:37 +0000)] 
Merge branch 'mnowak/enable-libns-tests-to-run-under-asan-v9_16' into 'v9_16'

[v9_16] Drop AddressSanitizer constraint from libns unit tests

See merge request isc-projects/bind9!4667

5 years agoDrop AddressSanitizer constraint from libns unit tests
Michal Nowak [Wed, 27 Jan 2021 17:06:33 +0000 (18:06 +0100)] 
Drop AddressSanitizer constraint from libns unit tests

The AddressSanitizer constraint in some libns unit tests does not seem
to be necessary anymore, these tests run fine under AddressSanitizer.

(cherry picked from commit 613be8706eca81fee97434e25fda4e9118cfe511)

5 years agoMerge branch '1810-refactor-ecdsa-eddsa-system-tests-v9_16' into 'v9_16'
Matthijs Mekking [Tue, 9 Feb 2021 16:07:55 +0000 (16:07 +0000)] 
Merge branch '1810-refactor-ecdsa-eddsa-system-tests-v9_16' into 'v9_16'

Resolve "Refactor ecdsa and eddsa tests after testcrypto.sh changes"

See merge request isc-projects/bind9!4666

5 years agoUpdate copyrights for [#1810]
Matthijs Mekking [Wed, 3 Feb 2021 11:05:18 +0000 (12:05 +0100)] 
Update copyrights for [#1810]

(cherry picked from commit 51827ddcd3f5c1baf588ca1fe688cf109d3dab3c)

5 years agoRefactor ecdsa system test
Matthijs Mekking [Wed, 3 Feb 2021 10:52:30 +0000 (11:52 +0100)] 
Refactor ecdsa system test

Similar to eddsa system test.

(cherry picked from commit 650b0d4691d95ebfc9a535bf82f7f6656c8e6b9c)

5 years agoRefactor eddsa system test
Matthijs Mekking [Wed, 3 Feb 2021 09:36:30 +0000 (10:36 +0100)] 
Refactor eddsa system test

Test for Ed25519 and Ed448. If both algorithms are not supported, skip
test. If only one algorithm is supported, run test, skip the
unsupported algorithm. If both are supported, run test normally.

Create new ns3. This will test Ed448 specifically, while now ns2 only
tests Ed25519. This moves some files from ns2/ to ns3/.

(cherry picked from commit 8bf31d05926960516e2756272ee43f801143ddd4)

5 years agoFix testcrypto.sh
Matthijs Mekking [Wed, 3 Feb 2021 09:35:46 +0000 (10:35 +0100)] 
Fix testcrypto.sh

Testing Ed448 was actually testing Ed25519.

(cherry picked from commit 572d7ec3b7d177eea5cfa0baff3571b382318c03)

5 years agoMerge branch 'mnowak/check-asan-errors-in-configure-v9_16' into 'v9_16'
Michal Nowak [Tue, 9 Feb 2021 11:12:10 +0000 (11:12 +0000)] 
Merge branch 'mnowak/check-asan-errors-in-configure-v9_16' into 'v9_16'

[v9_16] Check config.log for ASAN errors

See merge request isc-projects/bind9!4664

5 years agoCheck config.log for ASAN errors
Michal Nowak [Fri, 5 Feb 2021 11:12:41 +0000 (12:12 +0100)] 
Check config.log for ASAN errors

./configure checks might produce a false negative error due to ASAN
errors and thus disable some options.

(cherry picked from commit 0db934d401790f73e5db233997c1a994d8584b82)

5 years agoMerge branch '2434-fetch-limit-serve-stale-v9_16' into 'v9_16'
Matthijs Mekking [Mon, 8 Feb 2021 16:37:39 +0000 (16:37 +0000)] 
Merge branch '2434-fetch-limit-serve-stale-v9_16' into 'v9_16'

Resolve "Serve stale when fetch limits are hit" (9.16)

See merge request isc-projects/bind9!4627

5 years agoAdjust serve-stale test
Matthijs Mekking [Thu, 4 Feb 2021 14:07:40 +0000 (15:07 +0100)] 
Adjust serve-stale test

The number of queries to use in the burst can be reduced, as we have
a very low fetch limit of 1.

The dig command in 'wait_for_fetchlimits()' should time out sooner as
we expect a SERVFAIL to be returned promptly.

Enabling serve-stale can be done before hitting fetch-limits. This
reduces the chance that the resolver queries time out and fetch count
is reset. The chance of that happening is already slim because
'resolver-query-timeout' is 10 seconds, but better to first let the
data become stale rather than doing that while attempting to resolve.

(cherry picked from commit 00f575e7ef8c94f5894fe8b669ef3817af8a105f)

5 years agoUse stale on error also when unable to recurse
Matthijs Mekking [Thu, 4 Feb 2021 12:57:01 +0000 (13:57 +0100)] 
Use stale on error also when unable to recurse

The 'query_usestale()' function was only called when in
'query_gotanswer()' and an unexpected error occurred. This may have
been "quota reached", and thus we were in some cases returning
stale data on fetch-limits (and if serve-stale enabled of course).

But we can also hit fetch-limits when recursing because we are
following a referral (in 'query_notfound()' and
'query_delegation_recurse()'). Here we should also check for using
stale data in case an error occurred.

Specifically don't check for using stale data when refetching a
zero TTL RRset from cache.

Move the setting of DNS_DBFIND_STALESTART into the 'query_usestale()'
function to avoid code duplication.

(cherry picked from commit 8bcd7fe69e5343071fc917738d6092a8b974ef3f)

5 years agoAdd notes and change entry for [#2434]
Matthijs Mekking [Thu, 28 Jan 2021 16:02:56 +0000 (17:02 +0100)] 
Add notes and change entry for [#2434]

This concludes the serve-stale improvements.

(cherry picked from commit ed8421693c9cd26586b6545f60c77bde006c12d9)

5 years agoAdd test for serve-stale /w fetch-limits
Matthijs Mekking [Thu, 28 Jan 2021 11:30:08 +0000 (12:30 +0100)] 
Add test for serve-stale /w fetch-limits

Add a test case when fetch-limits are reached and we have stale data
in cache.

This test starts with a positive answer for 'data.example/TXT' in
cache.

1. Reload named.conf to set fetch limits.
2. Disable responses from the authoritative server.
3. Now send a batch of queries to the resolver, until hitting the
   fetch limits. We can detect this by looking at the response RCODE,
   at some point we will see SERVFAIL responses.
4. At that point we will turn on serve-stale.
5. Clients should see stale answers now.
6. An incoming query should not set the stale-refresh-time window,
   so a following query should still get a stale answer because of a
   resolver failure (and not because it was in the stale-refresh-time
   window).

(cherry picked from commit 11b74fc176f29820cbfff22e06ae9d8920b0a21c)

5 years agoOnly start stale refresh window when resuming
Matthijs Mekking [Wed, 27 Jan 2021 15:59:27 +0000 (16:59 +0100)] 
Only start stale refresh window when resuming

If we did not attempt a fetch due to fetch-limits, we should not start
the stale-refresh-time window.

Introduce a new flag DNS_DBFIND_STALESTART to differentiate between
a resolver failure and unexpected error. If we are resuming, this
indicates a resolver failure, then start the stale-refresh-time window,
otherwise don't start the stale-refresh-time window, but still fall
back to using stale data.

(This commit also wraps some docstrings to 80 characters width)

(cherry picked from commit aabdedeae321b05023f93c6871ad19165c5a4382)

5 years agoUse stale data also if we are not resuming
Matthijs Mekking [Tue, 19 Jan 2021 08:04:29 +0000 (09:04 +0100)] 
Use stale data also if we are not resuming

Before this change, BIND will only fallback to using stale data if
there was an actual attempt to resolve the query. Then on a timeout,
the stale data from cache becomes eligible.

This commit changes this so that on any unexpected error stale data
becomes eligble (you would still have to have 'stale-answer-enable'
enabled of course).

If there is no stale data, this may return in an error again, so don't
loop on stale data lookup attempts. If the DNS_DBFIND_STALEOK flag is
set, this means we already tried to lookup stale data, so if that is
the case, don't use stale again.

(cherry picked from commit c6fd02aed534e21989fafd7b45b132a21c24fdbc)

5 years agoMerge branch '2468-cid-318094-null-pointer-dereferences-reverse_inull-v9_16' into...
Mark Andrews [Mon, 8 Feb 2021 05:39:01 +0000 (05:39 +0000)] 
Merge branch '2468-cid-318094-null-pointer-dereferences-reverse_inull-v9_16' into 'v9_16'

Remove redundant 'version == NULL' check

See merge request isc-projects/bind9!4663

5 years agoRemove redundant 'version == NULL' check
Mark Andrews [Wed, 3 Feb 2021 05:38:29 +0000 (16:38 +1100)] 
Remove redundant 'version == NULL' check

    *** CID 318094:  Null pointer dereferences  (REVERSE_INULL)
    /lib/dns/rbtdb.c: 1389 in newversion()
    1383      version->xfrsize = rbtdb->current_version->xfrsize;
    1384      RWUNLOCK(&rbtdb->current_version->rwlock, isc_rwlocktype_read);
    1385      rbtdb->next_serial++;
    1386      rbtdb->future_version = version;
    1387      RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_write);
    1388
       CID 318094:  Null pointer dereferences  (REVERSE_INULL)
       Null-checking "version" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
    1389      if (version == NULL) {
    1390      return (result);
    1391      }
    1392
    1393      *versionp = version;
    1394

(cherry picked from commit 456d53d1fb2cd32bef2cc5a0906d9c08e215389b)

5 years agoMerge branch '1697-isc_rwlock_init-can-no-longer-fail-in-master-clean-up-calls-v9_16...
Mark Andrews [Mon, 8 Feb 2021 05:13:40 +0000 (05:13 +0000)] 
Merge branch '1697-isc_rwlock_init-can-no-longer-fail-in-master-clean-up-calls-v9_16' into 'v9_16'

Cleanup redundant isc_rwlock_init() result checks

See merge request isc-projects/bind9!4662

5 years agoCleanup redundant isc_rwlock_init() result checks
Mark Andrews [Mon, 1 Feb 2021 04:59:41 +0000 (15:59 +1100)] 
Cleanup redundant isc_rwlock_init() result checks

(cherry picked from commit 3b11bacbb7b92aa2c1043ad27f8fd89763ed984b)

5 years agoMerge branch '2469-cid-281461-untrusted-loop-bound-v9_16' into 'v9_16'
Mark Andrews [Mon, 8 Feb 2021 03:59:47 +0000 (03:59 +0000)] 
Merge branch '2469-cid-281461-untrusted-loop-bound-v9_16' into 'v9_16'

Attempt to silence untrusted loop bound

See merge request isc-projects/bind9!4661

5 years agoAttempt to silence untrusted loop bound
Mark Andrews [Wed, 3 Feb 2021 06:20:09 +0000 (17:20 +1100)] 
Attempt to silence untrusted loop bound

Assign hit_len + key_len to len and test the result
rather than recomputing and letting the compiler simplify.

    213        isc_region_consume(&region, 2); /* hit length + algorithm */
        9. tainted_return_value: Function uint16_fromregion returns tainted data. [show details]
        10. tainted_data_transitive: Call to function uint16_fromregion with tainted argument *region.base returns tainted data.
        11. tainted_return_value: Function uint16_fromregion returns tainted data.
        12. tainted_data_transitive: Call to function uint16_fromregion with tainted argument *region.base returns tainted data.
        13. var_assign: Assigning: key_len = uint16_fromregion(&region), which taints key_len.
    214        key_len = uint16_fromregion(&region);
        14. lower_bounds: Casting narrower unsigned key_len to wider signed type int effectively tests its lower bound.
        15. Condition key_len == 0, taking false branch.
    215        if (key_len == 0) {
    216                RETERR(DNS_R_FORMERR);
    217        }
        16. Condition !!(_r->length >= _l), taking true branch.
        17. Condition !!(_r->length >= _l), taking true branch.
    218        isc_region_consume(&region, 2);
        18. lower_bounds: Casting narrower unsigned key_len to wider signed type int effectively tests its lower bound.
        19. Condition region.length < (unsigned int)(hit_len + key_len), taking false branch.
    219        if (region.length < (unsigned)(hit_len + key_len)) {
    220                RETERR(DNS_R_FORMERR);
    221        }
    222
        20. lower_bounds: Casting narrower unsigned key_len to wider signed type int effectively tests its lower bound.
        21. Condition _r != 0, taking false branch.
    223        RETERR(mem_tobuffer(target, rr.base, 4 + hit_len + key_len));
        22. lower_bounds: Casting narrower unsigned key_len to wider signed type int effectively tests its lower bound.
        23. var_assign_var: Compound assignment involving tainted variable 4 + hit_len + key_len to variable source->current taints source->current.
    224        isc_buffer_forward(source, 4 + hit_len + key_len);
    225
    226        dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE);

    CID 281461 (#1 of 1): Untrusted loop bound (TAINTED_SCALAR)
        24. tainted_data: Using tainted variable source->active - source->current as a loop boundary.
    Ensure that tainted values are properly sanitized, by checking that their values are within a permissible range.
    227        while (isc_buffer_activelength(source) > 0) {
    228                dns_name_init(&name, NULL);
    229                RETERR(dns_name_fromwire(&name, source, dctx, options, target));
    230        }

(cherry picked from commit 2f946c831a5ad4ed5c2694c51531dd4efa3b7aed)

5 years agoMerge branch 'mnowak/check-arm-pdf-validity-v9_16' into 'v9_16'
Michal Nowak [Wed, 3 Feb 2021 17:01:43 +0000 (17:01 +0000)] 
Merge branch 'mnowak/check-arm-pdf-validity-v9_16' into 'v9_16'

[v9_16] Check PDF file structure with QPDF

See merge request isc-projects/bind9!4651

5 years agoCheck PDF file structure with QPDF
Michal Nowak [Thu, 28 Jan 2021 13:21:15 +0000 (14:21 +0100)] 
Check PDF file structure with QPDF

"qpdf --check" checks file structure of generated ARM PDF.

(cherry picked from commit 359708b9d62581a99c80eff450cf9b2e283cef3c)

5 years agoMerge branch '2377-allow-a-records-below-an-_spf-label-as-a-check-names-exception...
Matthijs Mekking [Wed, 3 Feb 2021 16:48:58 +0000 (16:48 +0000)] 
Merge branch '2377-allow-a-records-below-an-_spf-label-as-a-check-names-exception-v9_16' into 'v9_16'

Resolve "Allow A records below an '_spf' label as a check-names exception"

See merge request isc-projects/bind9!4650

5 years agoAdd release note entry
Mark Andrews [Wed, 6 Jan 2021 03:31:03 +0000 (14:31 +1100)] 
Add release note entry

(cherry picked from commit 12949187026319aa2e1850fbf257e5931d078ab2)

5 years agoAdd CHANGES
Mark Andrews [Wed, 6 Jan 2021 03:25:47 +0000 (14:25 +1100)] 
Add CHANGES

(cherry picked from commit 2b5091ac1780af74d8dd00b08914a270d21aba88)

5 years agoCheck that A record is accepted with _spf label present
Mark Andrews [Mon, 11 Jan 2021 02:14:10 +0000 (13:14 +1100)] 
Check that A record is accepted with _spf label present

(cherry picked from commit a3b2b86e7f57fe48e5d2015a43d0df6c53cb93ce)

5 years agoAllow A records below '_spf' labels as recommend by RFC7208
Mark Andrews [Wed, 6 Jan 2021 03:22:00 +0000 (14:22 +1100)] 
Allow A records below '_spf' labels as recommend by RFC7208

(cherry picked from commit 63c16c85063b6f0b7de3132294a252633eab8a95)

5 years agoMerge branch '2375-dnssec-policy-three-is-a-crowd-rollover-bug-v9_16' into 'v9_16'
Matthijs Mekking [Wed, 3 Feb 2021 15:11:10 +0000 (15:11 +0000)] 
Merge branch '2375-dnssec-policy-three-is-a-crowd-rollover-bug-v9_16' into 'v9_16'

Resolve "three is a crowd" dnssec-policy key rollover bug (9.16)

See merge request isc-projects/bind9!4649

5 years agoAdd kasp test todo for [#2375]
Matthijs Mekking [Wed, 3 Feb 2021 12:55:54 +0000 (13:55 +0100)] 
Add kasp test todo for [#2375]

This bugfix has been manually verified but is missing a unit test.
Created GL #2471 to track this.

(cherry picked from commit 189f5a3f285705146b408b34a4f44b20d19d1c32)

5 years agoUse NUM_KEYSTATES constant where appropriate
Matthijs Mekking [Mon, 1 Feb 2021 08:40:44 +0000 (09:40 +0100)] 
Use NUM_KEYSTATES constant where appropriate

We use the number 4 a lot when working on key states. Better to use
the NUM_KEYSTATES constant instead.

(cherry picked from commit 98ace6d97df5d8a86a5200bb9073eb0f8a75cbaa)

5 years agoAdd change and release note for [#2375]
Matthijs Mekking [Thu, 7 Jan 2021 11:34:09 +0000 (12:34 +0100)] 
Add change and release note for [#2375]

News worthy.

(cherry picked from commit 7947f7f9c606c5545862f6ab1d590c16cd283197)

5 years agoCleanup keymgr.c
Matthijs Mekking [Thu, 7 Jan 2021 11:26:53 +0000 (12:26 +0100)] 
Cleanup keymgr.c

Three small cleanups:

1. Remove an unused keystr/dst_key_format.
2. Initialize a dst_key_state_t state with NA.
3. Update false comment about local policy (local policy only adds
   barrier on transitions to the RUMOURED state, not the UNRETENTIVE
   state).

(cherry picked from commit 189d9a2d21b44eec25245cd5189c86d7115e79af)

5 years agoFix DS/DNSKEY hidden or chained functions
Matthijs Mekking [Thu, 7 Jan 2021 11:12:46 +0000 (12:12 +0100)] 
Fix DS/DNSKEY hidden or chained functions

There was a bug in function 'keymgr_ds_hidden_or_chained()'.

The funcion 'keymgr_ds_hidden_or_chained()' implements (3e) of rule2
as defined in the "Flexible and Robust Key Rollover" paper. The rules
says: All DS records need to be in the HIDDEN state, or if it is not
there must be a key with its DNSKEY and KRRSIG in OMNIPRESENT, and
its DS in the same state as the key in question. In human langauge,
if all keys have their DS in HIDDEN state you can do what you want,
but if a DS record is available to some validators, there must be
a chain of trust for it.

Note that the barriers on transitions first check if the current
state is valid, and then if the next state is valid too. But
here we falsely updated the 'dnskey_omnipresent' (now 'dnskey_chained')
with the next state. The next state applies to 'key' not to the state
to be checked. Updating the state here leads to (true) always, because
the key that will move its state will match the falsely updated
expected state. This could lead to the assumption that Key 2 would be
a valid chain of trust for Key 1, while clearly the presence of any
DS is uncertain.

The fix here is to check if the DNSKEY and KRRSIG are in OMNIPRESENT
state for the key that does not have its DS in the HIDDEN state, and
only if that is not the case, ensure that there is a key with the same
algorithm, that provides a valid chain of trust, that is, has its
DNSKEY, KRRSIG, and DS in OMNIPRESENT state.

The changes in 'keymgr_dnskey_hidden_or_chained()' are only cosmetical,
renaming 'rrsig_omnipresent' to 'rrsig_chained' and removing the
redundant initialization of the DST_KEY_DNSKEY expected state to NA.

(cherry picked from commit 291bcc37217a7d375926921199c1acc8f2e92109)