Commit graph

29681 commits

Author SHA1 Message Date
Michał Kępień
810cbde0bc Add CentOS 8 to GitLab CI
Ensure BIND can be tested on CentOS 8 in GitLab CI to more quickly catch
build and test errors on that operating system.

(cherry picked from commit dce1c05042)
2019-10-29 08:53:56 +01:00
Mark Andrews
4689f8cec6 Merge branch '876-documentation-feedback-2-v9_14' into 'v9_14'
dnskey-sig-validity 0;

See merge request isc-projects/bind9!2487
2019-10-24 17:09:53 -04:00
Mark Andrews
c452db5790 add named-checkconf tests for dnskey-sig-validity at range limits
(cherry picked from commit 918f020f9f)
2019-10-25 07:12:36 +11:00
Mark Andrews
85d89c00da accept 0 for dnskey-sig-validity (indicates off)
(cherry picked from commit 20647657f9)
2019-10-25 07:12:03 +11:00
Mark Andrews
f59321d972 Merge branch '1281-dnstap-per-view-configuration-v9_14' into 'v9_14'
Resolve "dnstap per view configuration"

See merge request isc-projects/bind9!2479
2019-10-21 19:29:09 -04:00
Mark Andrews
aface50cfe add CHANGES
(cherry picked from commit 6ce1e2e731)
2019-10-22 08:23:32 +11:00
Mark Andrews
c46f4d14f5 check for relationship between dnstap and dnstap-output seperately
(cherry picked from commit c2fcc9f16f)
2019-10-22 08:23:32 +11:00
Mark Andrews
71f33e0c24 add more dnstap/dnstap-output combinations
(cherry picked from commit f3d53630c3)
2019-10-22 08:23:32 +11:00
Tinderbox User
6330f2c6c8 Merge branch 'security-v9_14' into v9_14 2019-10-19 23:34:28 +00:00
Michał Kępień
afb1e0758f Merge branch 'michal/address-cppcheck-1.89-warnings-v9_14' into 'v9_14'
[v9_14] Address cppcheck 1.89 warnings

See merge request isc-projects/bind9!2473
2019-10-17 05:50:06 -04:00
Michał Kępień
c62c7c2f86 Suppress cppcheck 1.89 false positive
cppcheck 1.89 emits a false positive for lib/dns/spnego_asn1.c:

    lib/dns/spnego_asn1.c:700:9: error: Uninitialized variable: data [uninitvar]
     memset(data, 0, sizeof(*data));
            ^
    lib/dns/spnego.c:1709:47: note: Calling function 'decode_NegTokenResp', 3rd argument '&resp' value is <Uninit>
     ret = decode_NegTokenResp(buf + taglen, len, &resp, NULL);
                                                  ^
    lib/dns/spnego_asn1.c:700:9: note: Uninitialized variable: data
     memset(data, 0, sizeof(*data));
            ^

This message started appearing with cppcheck 1.89 [1], but it will be
gone in the next release [2], so just suppress it for the time being.

[1] af214e8212

[2] 2595b82634

(cherry picked from commit db7fd16346)
2019-10-17 10:52:19 +02:00
Michał Kępień
2a2a346340 Fix cppcheck 1.89 warnings
cppcheck 1.89 enabled certain value flow analysis mechanisms [1] which
trigger null pointer dereference false positives in lib/dns/rpz.c:

    lib/dns/rpz.c:584:7: warning: Possible null pointer dereference: tgt_ip [nullPointer]
      if (KEY_IS_IPV4(tgt_prefix, tgt_ip)) {
          ^
    lib/dns/rpz.c:1425:44: note: Calling function 'adj_trigger_cnt', 4th argument '(void*)0' value is 0
      adj_trigger_cnt(rpzs, rpz_num, rpz_type, NULL, 0, true);
                                               ^
    lib/dns/rpz.c:584:7: note: Null pointer dereference
      if (KEY_IS_IPV4(tgt_prefix, tgt_ip)) {
          ^
    lib/dns/rpz.c:598:7: warning: Possible null pointer dereference: tgt_ip [nullPointer]
      if (KEY_IS_IPV4(tgt_prefix, tgt_ip)) {
          ^
    lib/dns/rpz.c:1425:44: note: Calling function 'adj_trigger_cnt', 4th argument '(void*)0' value is 0
      adj_trigger_cnt(rpzs, rpz_num, rpz_type, NULL, 0, true);
                                               ^
    lib/dns/rpz.c:598:7: note: Null pointer dereference
      if (KEY_IS_IPV4(tgt_prefix, tgt_ip)) {
          ^
    lib/dns/rpz.c:612:7: warning: Possible null pointer dereference: tgt_ip [nullPointer]
      if (KEY_IS_IPV4(tgt_prefix, tgt_ip)) {
          ^
    lib/dns/rpz.c:1425:44: note: Calling function 'adj_trigger_cnt', 4th argument '(void*)0' value is 0
      adj_trigger_cnt(rpzs, rpz_num, rpz_type, NULL, 0, true);
                                               ^
    lib/dns/rpz.c:612:7: note: Null pointer dereference
      if (KEY_IS_IPV4(tgt_prefix, tgt_ip)) {
          ^

It seems that cppcheck no longer treats at least some REQUIRE()
assertion failures as fatal, so add extra assertion macro definitions to
lib/isc/include/isc/util.h that are only used when the CPPCHECK
preprocessor macro is defined; these definitions make cppcheck 1.89
behave as expected.

There is an important requirement for these custom definitions to work:
cppcheck must properly treat abort() as a function which does not
return.  In order for that to happen, the __GNUC__ macro must be set to
a high enough number (because system include directories are used and
system headers compile attributes away if __GNUC__ is not high enough).
__GNUC__ is thus set to the major version number of the GCC compiler
used, which is what that latter does itself during compilation.

[1] aaeec462e6

(cherry picked from commit abfde3d543)
2019-10-17 10:50:51 +02:00
Michał Kępień
4ea4e9b0b0 Merge branch 'michal/cleanup-with-cc-alg-remnants-v9_14' into 'v9_14'
[v9_14] Remove remnants of the --with-cc-alg option

See merge request isc-projects/bind9!2469
2019-10-15 16:35:12 -04:00
Michał Kępień
847879f772 Remove remnants of the --with-cc-alg option
Commit afa81ee4e4 omitted some spots in
the source tree which are still referencing the removed --with-cc-alg
"configure" option.  Make sure the latter is removed completely.

(cherry picked from commit 428dcf3b49)
2019-10-15 21:58:48 +02:00
Michał Kępień
97a940041f Merge branch 'michal/limit-triggers-for-openbsd-system-test-jobs-v9_14' into 'v9_14'
[v9_14] Limit triggers for OpenBSD system test jobs

See merge request isc-projects/bind9!2467
2019-10-15 15:52:45 -04:00
Michał Kępień
695e099c67 Limit triggers for OpenBSD system test jobs
When a GitLab CI runner is not under load, a single OpenBSD system test
job completes in about 12 minutes, which is considered decent.  However,
such jobs are usually multiplexed with other system test jobs on the
same host, which causes each of them to take even 40 minutes to
complete.  Taking retries into account, this is completely unacceptable
for everyday use, so only start OpenBSD system test jobs for pipelines
created through GitLab's web interface and for pipelines created for Git
tags.

(cherry picked from commit 603e04563b)
2019-10-15 21:48:43 +02:00
Michał Kępień
c2faa4dd64 Merge branch 'michal/minor-gitlab-ci-tweaks-v9_14' into 'v9_14'
[v9_14] Minor GitLab CI tweaks

See merge request isc-projects/bind9!2464
2019-10-15 15:45:57 -04:00
Michał Kępień
765cdd284b Tweak dependencies for the Windows build job
Since the Windows build job does not use the files created as a result
of running "autoreconf -fi" in the "autoreconf:sid:amd64" job, set its
dependencies to an empty list.

Since it is currently not possible to use "needs: []" for jobs which do
not belong to the first stage of a pipeline, set the "needs" key for the
Windows build job to the "autoreconf:sid:amd64" job so that all build
jobs are started at the same time (without this change, the Windows
build job does not start until all jobs in the "precheck" stage are
finished).

As a side note, these changes also attempt to eliminate intermittent,
bogus GitLab error messages ("There has been a missing dependency
failure").

(cherry picked from commit dd97dfdc14)
2019-10-15 20:49:28 +02:00
Michał Kępień
5599892021 Fix artifacts created by the "autoreconf" CI job
The intended purpose of the "autoreconf:sid:amd64" GitLab CI job is to
run "autoreconf -fi" and then pass the updated files on to subsequent
non-Windows build jobs.  However, the artifacts currently created by
that job only include files which are not tracked by Git.  Since we
currently do track e.g. "configure" with Git, the aforementioned job is
essentially a no-op.  Fix by manually specifying the files generated by
the "autoreconf:sid:amd64" job that should be passed on to subsequent
build jobs.

(cherry picked from commit e83b322f7f)
2019-10-15 20:49:28 +02:00
Michał Kępień
feaed60540 Merge branch 'michal/add-openbsd-to-gitlab-ci-v9_14' into 'v9_14'
[v9_14] Add OpenBSD to GitLab CI

See merge request isc-projects/bind9!2459
2019-10-15 14:44:41 -04:00
Michał Kępień
9d24eba876 Add OpenBSD to GitLab CI
Ensure BIND can be tested on OpenBSD in GitLab CI to more quickly catch
build and test errors on that operating system.

Some notes:

  - While GCC is packaged for OpenBSD, only old versions (4.2.1, 4.9.4)
    are readily available and none of them is the default system
    compiler, so we are only doing Clang builds in GitLab CI.

  - Unit tests are currently not run on OpenBSD because it ships with an
    old version of kyua which does not handle skipped tests properly.
    These jobs will be added when we move away from using kyua in the
    future as the test code itself works fine.

  - All OpenBSD jobs are run inside QEMU virtual machines, using GitLab
    Runner Custom executor.

(cherry picked from commit 07d2fcb544)
2019-10-15 16:38:24 +02:00
Michał Kępień
2395288c2e Work around an OpenBSD "make" quirk
Consider the following Makefile:

    foo:
    	false

On OpenBSD, the following happens for this Makefile:

  - "make foo" returns 1,
  - "make -k foo" returns 0,
  - "make -k -j6 foo" returns 1.

However, if the .NOTPARALLEL pseudo-target is added to this Makefile,
"make -k -j6 foo" will return 0 as well.

Since bin/tests/Makefile contains the .NOTPARALLEL pseudo-target,
running "make -k -j6 test" from bin/tests/ on OpenBSD prevents any
errors from being reported through that command's exit code.

Work around the issue by running "make -k -j6 test" in the
bin/tests/system/ directory instead as bin/tests/system/Makefile does
not contain the .NOTPARALLEL pseudo-target and thus things work as
expected there.

(cherry picked from commit 6b5426e1a7)
2019-10-15 16:38:23 +02:00
Mark Andrews
71db12db0f Merge branch '1143-a-minor-documentation-issue-consideration-of-parsing-inconsistencies-in-ipv4s-in-address-match-lists-and-in-a-controls-inet-statement-v9_14' into 'v9_14'
Resolve "A minor documentation issue & consideration of parsing inconsistencies in IPv4s in address match lists and in a controls/inet statement"

See merge request isc-projects/bind9!2454
2019-10-13 10:59:37 -04:00
Mark Andrews
446de056b6 Detect partial prefixes / incomplete IPv4 address in acls.
(cherry picked from commit fb87e669fb)
2019-10-14 01:31:44 +11:00
Ondřej Surý
7076fd6825 Merge branch 'ondrej/1-week-artifact-expiration-v9_14' into 'v9_14'
Synchronize the lifetime of artifact to 1 week

See merge request isc-projects/bind9!2449
2019-10-10 02:10:04 -04:00
Ondřej Surý
540f25194b Synchronize the lifetime of artifact to 1 week
(cherry picked from commit 85c0bede78)
2019-10-10 07:47:41 +02:00
Tinderbox User
5b7e2059ca Merge branch 'fix-doc' into security-v9_14 2019-10-09 20:54:55 +00:00
Tinderbox User
98f2e7149b regenerate doc 2019-10-09 20:54:43 +00:00
Ondřej Surý
148d39afbd Merge branch 'security-v9_14-issue-numbers' into 'security-v9_14'
Fix the GitLab issue numbers in CHANGES and notes.xml

See merge request isc-private/bind9!120
2019-10-09 02:34:53 -04:00
Ondřej Surý
bfb08a9780 Fix the GitLab issue numbers in CHANGES and notes.xml 2019-10-09 08:02:05 +02:00
Mark Andrews
348077c1e6 Merge branch 'marka-missing-runtime-check-v9_14' into 'v9_14'
missing RUNTIME_CHECK

See merge request isc-projects/bind9!2417
2019-10-04 00:34:22 -04:00
Mark Andrews
0f51b41094 add CHANGES
(cherry picked from commit 346624fe38)
2019-10-04 14:08:26 +10:00
Ondřej Surý
3c20623436 Move the failure handling block closer to the only place where it could fail
(cherry picked from commit 69ecc711ac)
2019-10-04 14:08:26 +10:00
Ondřej Surý
aebea22fab Replace RUNTIME_CHECK(dns_name_copy(..., NULL)) with dns_name_copynf()
Use the semantic patch from the previous commit to replace all the calls to
dns_name_copy() with NULL as third argument with dns_name_copynf().

(cherry picked from commit c2dad0dcb2)
2019-10-04 14:08:26 +10:00
Ondřej Surý
c8c6718ee4 Add semantic patch to replace RUNTIME_CHECK(dns_name_copy(..., NULL)) with dns_name_copynf
(cherry picked from commit ac26ecf540)
2019-10-04 14:08:25 +10:00
Ondřej Surý
a1ef76cd78 Split dns_name_copy() into dns_name_copy() and dns_name_copynf()
The dns_name_copy() function followed two different semanitcs that was driven
whether the last argument was or wasn't NULL.  This commit splits the function
in two where now third argument to dns_name_copy() can't be NULL and
dns_name_copynf() doesn't have third argument.

(cherry picked from commit f7aef3738a)
2019-10-04 14:08:25 +10:00
Ondřej Surý
660307283e The final round of adding RUNTIME_CHECK() around dns_name_copy() calls
This commit was done by hand to add the RUNTIME_CHECK() around stray
dns_name_copy() calls with NULL as third argument.  This covers the edge cases
that doesn't make sense to write a semantic patch since the usage pattern was
unique or almost unique.

(cherry picked from commit 5efa29e03a)
2019-10-04 14:08:25 +10:00
Ondřej Surý
77fe5da647 Add RUNTIME_CHECK() around result = dns_name_copy(..., NULL) calls
This second commit uses second semantic patch to replace the calls to
dns_name_copy() with NULL as third argument where the result was stored in a
isc_result_t variable.  As the dns_name_copy(..., NULL) cannot fail gracefully
when the third argument is NULL, it was just a bunch of dead code.

Couple of manual tweaks (removing dead labels and unused variables) were
manually applied on top of the semantic patch.

(cherry picked from commit 89b269b0d2)
2019-10-04 14:08:25 +10:00
Ondřej Surý
9adb3ae2d5 Add RUNTIME_CHECK() around plain dns_name_copy(..., NULL) calls using spatch
This commit add RUNTIME_CHECK() around all simple dns_name_copy() calls where
the third argument is NULL using the semantic patch from the previous commit.

(cherry picked from commit 35bd7e4da0)
2019-10-04 14:08:25 +10:00
Ondřej Surý
500b5b9f79 Add semantic patches to correctly check dns_name_copy(..., NULL) return code
The dns_name_copy() function cannot fail gracefully when the last argument
(target) is NULL.  Add RUNTIME_CHECK()s around such calls.

The first semantic patch adds RUNTIME_CHECK() around any call that ignores the
return value and is very safe to apply.

The second semantic patch attempts to properly add RUNTIME_CHECK() to places
where the return value from `dns_name_copy()` is recorded into `result`
variable.  The result of this semantic patch needs to be reviewed by hand.

Both patches misses couple places where the code surrounding the
`dns_name_copy(..., NULL)` usage is more complicated and is better suited to be
fixed by a human being that understands the surrounding code.

(cherry picked from commit 406eba0c41)
2019-10-04 14:08:25 +10:00
Mark Andrews
2894de2ab3 Merge branch 'marka-cppcheck-fixes-v9_12-and-v9_14' into 'v9_14'
Address cppcheck reports (v9_11/v9_14)

See merge request isc-projects/bind9!2342
2019-10-03 23:36:19 -04:00
Mark Andrews
fcebc4f15b Address cppcheck reports 2019-10-04 13:06:00 +10:00
Mark Andrews
b396c9dfde Merge branch 'marka-silence-clang-v9_14' into 'v9_14'
silence clang warning by using local variable.

See merge request isc-projects/bind9!2441
2019-10-03 21:58:45 -04:00
Mark Andrews
b997237f49 silence clang warning by using local variable.
'isc_commandline_index' is a global variable so it can theoretically
change result between if expressions.  Save 'argv[isc_commandline_index]'
to local variable 'arg1' and use 'arg1 == NULL' in if expressions
instead of 'argc < isc_commandline_index + 1'.  This allows clang
to correctly determine what code is reachable.

(cherry picked from commit 1b27ab8642)
2019-10-04 11:36:19 +10:00
Ondřej Surý
418b340a8f Merge branch 'ondrej/fix-docs-autoreconf-v9_14' into 'v9_14'
Fix docs -> autoreconf dependencies in the .gitlab-ci.yml (v9_14)

See merge request isc-projects/bind9!2439
2019-10-03 10:08:05 -04:00
Ondřej Surý
3b339eb43f Fix the triggering rule for autoreconf job (take 2) 2019-10-03 15:34:09 +02:00
Ondřej Surý
cc4c5482ef Fix docs -> autoreconf dependencies in the .gitlab-ci.yml 2019-10-03 15:34:06 +02:00
Ondřej Surý
c70c4be5c4 Merge branch 'ondrej/enable-cppcheck-v9_14' into 'v9_14'
Enable Cppcheck for v9_14 branch

See merge request isc-projects/bind9!2432
2019-10-03 08:20:18 -04:00
Ondřej Surý
2ae68cd120 Use util/suppressions.txt for Cppcheck suppressions list 2019-10-03 14:02:08 +02:00
Ondřej Surý
36b0c5a517 lib/isc/tests/md_test.c: Silence sizeofFunctionCall Cppcheck 2019-10-03 12:44:02 +02:00