2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00
Commit Graph

29918 Commits

Author SHA1 Message Date
Mark Andrews
4a5400c1b7 use test specific shell variables 2019-09-26 03:30:43 -04:00
Ondřej Surý
83a2db79fb Merge branch '1119-tsan-lib/dns/rbt.c' into 'master'
Prevent TSAN being trigged when DNS_RBTFIND_EMPTYDATA is set

See merge request isc-projects/bind9!2369
2019-09-25 14:30:26 -04:00
Mark Andrews
7f30540727 prevent TSAN being trigged when DNS_RBTFIND_EMPTYDATA is set 2019-09-25 14:05:12 -04:00
Ondřej Surý
9b5969eab0 Merge branch '1119-tsan-bin/rndc/rndc.c' into 'master'
Protect globally accessed variables in rndc.c by making them atomic

See merge request isc-projects/bind9!2370
2019-09-25 08:05:10 -04:00
Ondřej Surý
0aa8c078e4 Protect globally accessed variables in rndc.c by making them atomic 2019-09-25 13:39:04 +02:00
Ondřej Surý
16fbd0f204 Merge branch '1119-tsan-lib/dns/rbtdb.c' into 'master'
Fix unprotected access to rbtnode in lib/dns/rbtdb.c:add32()

See merge request isc-projects/bind9!2371
2019-09-25 07:10:22 -04:00
Ondřej Surý
e307273307 Fix unprotected access to rbtnode in lib/dns/rbtdb.c:add32() 2019-09-25 12:29:13 +02:00
Ondřej Surý
6a39627355 Merge branch '1119-tsan-lib/isc/unix/socket.c' into 'master'
lib/isc/unix/socket.c: Convert couple isc__socket_t members to atomic to prevent data race

See merge request isc-projects/bind9!2356
2019-09-24 15:32:38 -04:00
Ondřej Surý
718a317dc7 Fix unprotected access to thread->epoll_events[fd] in unwatch_fd() 2019-09-24 08:11:50 -04:00
Ondřej Surý
9808d7360e Move the lock from internal_{accept,connect,recv,send} to global level to protect more socket variables 2019-09-24 08:11:50 -04:00
Ondřej Surý
43f3b3211f Convert couple isc__socket_t members to atomic to prevent data race (from TSAN) 2019-09-24 08:11:50 -04:00
Mark Andrews
8f2dd1ac71 Merge branch '1205-named-crashes-when-setting-nsec3param' into 'master'
Resolve "named crashes when setting nsec3param"

Closes #1205

See merge request isc-projects/bind9!2300
2019-09-23 21:21:15 -04:00
Mark Andrews
31c8f66f25 add CHANGES 2019-09-24 10:48:59 +10:00
Mark Andrews
456888c00f Queue nsec3param setting until receive_secure_serial has completed. 2019-09-24 10:45:49 +10:00
Mark Andrews
4e686f40e0 Move dns_zone_setdb() to after the db is created.
Addresses the database changing w/o the changes being done under task lock.
Fix: build the database before assigning it to the zone.
2019-09-24 10:45:24 +10:00
Michał Kępień
6aec894c4c Merge branch 'michal/run-freebsd-jobs-automatically-for-all-pipelines' into 'master'
Run FreeBSD jobs automatically for all pipelines

See merge request isc-projects/bind9!2350
2019-09-17 14:26:12 -04:00
Michał Kępień
f7bc95409d Run FreeBSD jobs automatically for all pipelines
No problems have been observed on the FreeBSD GitLab CI runner during
the burn-in period, when FreeBSD jobs needed to be triggered manually.
Thus, make the FreeBSD jobs run automatically along other GitLab CI
jobs.
2019-09-17 20:24:12 +02:00
Michal Nowak
90835966dc Merge branch 'mnowak/Red_Hat_find_docbook-xsl' into 'master'
Find docbook-xsl and dblatex templates on Red Hat/Fedora

See merge request isc-projects/bind9!2324
2019-09-17 10:45:42 -04:00
Michal Nowak
c871dda0aa Remove unused configure checks for dblatex 2019-09-17 16:42:16 +02:00
Michal Nowak
0055b9616e Find docbook-xsl and dblatex templates on Red Hat/Fedora
`/usr/share/sgml/docbook/xsl-stylesheets` and `/usr/share/dblatex` are
places where docbook-style-xsl and, respectively, dblatex packages on
Red Hat systems put their XSL templates. Unless we hint this place it
has to be added to `./configure` manually (`--with-docbook-xsl=...`):
https://src.fedoraproject.org/rpms/bind/blob/master/f/bind.spec#_691.

On Fedora 30:

Before
```
./configure
...
checking for Docbook-XSL path... auto
checking for html/docbook.xsl... "not found"
checking for xhtml/docbook.xsl... "not found"
checking for manpages/docbook.xsl... "not found"
checking for html/chunk.xsl... "not found"
checking for xhtml/chunk.xsl... "not found"
checking for html/chunktoc.xsl... "not found"
checking for xhtml/chunktoc.xsl... "not found"
checking for html/maketoc.xsl... "not found"
checking for xhtml/maketoc.xsl... "not found"
checking for xsl/docbook.xsl... "not found"
checking for xsl/latex_book_fast.xsl... "not found"
```

After:
```
./configure
...
checking for Docbook-XSL path... auto
checking for html/docbook.xsl... /usr/share/sgml/docbook/xsl-stylesheets/html/docbook.xsl
checking for xhtml/docbook.xsl... /usr/share/sgml/docbook/xsl-stylesheets/xhtml/docbook.xsl
checking for manpages/docbook.xsl... /usr/share/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl
checking for html/chunk.xsl... /usr/share/sgml/docbook/xsl-stylesheets/html/chunk.xsl
checking for xhtml/chunk.xsl... /usr/share/sgml/docbook/xsl-stylesheets/xhtml/chunk.xsl
checking for html/chunktoc.xsl... /usr/share/sgml/docbook/xsl-stylesheets/html/chunktoc.xsl
checking for xhtml/chunktoc.xsl... /usr/share/sgml/docbook/xsl-stylesheets/xhtml/chunktoc.xsl
checking for html/maketoc.xsl... /usr/share/sgml/docbook/xsl-stylesheets/html/maketoc.xsl
checking for xhtml/maketoc.xsl... /usr/share/sgml/docbook/xsl-stylesheets/xhtml/maketoc.xsl
checking for xsl/docbook.xsl... /usr/share/dblatex/xsl/docbook.xsl
checking for xsl/latex_book_fast.xsl... /usr/share/dblatex/xsl/latex_book_fast.xsl
```
2019-09-17 16:42:15 +02:00
Ondřej Surý
12142cbeb6 Merge branch 'ondrej/improve-flycheck-configuration' into 'master'
Remove the current directory from the flycheck configuration

See merge request isc-projects/bind9!2347
2019-09-17 07:30:59 -04:00
Ondřej Surý
265039effc Remove the current directory from the flycheck configuration 2019-09-17 13:05:10 +02:00
Ondřej Surý
c3d684cf9e Merge branch '414-use-p11-kit-headers' into 'master'
Resolve "Legal issue with pkcs11 headers"

Closes #414

See merge request isc-projects/bind9!2251
2019-09-16 09:22:33 -04:00
Ondřej Surý
f6922d6e78 Use standard PKCS#11 standard error codes instead of custom error codes
* CKR_CRYPTOKI_ALREADY_INITIALIZED: This value can only be returned by
  `C_Initialize`. It means that the Cryptoki library has already been
  initialized (by a previous call to `C_Initialize` which did not have a
  matching `C_Finalize` call).

* CKR_FUNCTION_NOT_SUPPORTED: The requested function is not supported by this
  Cryptoki library. Even unsupported functions in the Cryptoki API should have a
  “stub” in the library; this stub should simply return the value
  CKR_FUNCTION_NOT_SUPPORTED.

* CKR_LIBRARY_LOAD_FAILED: The Cryptoki library could not load a dependent
  shared library.
2019-09-16 04:47:50 -04:00
Ondřej Surý
c47fad2431 Replace the OASIS PKCS#11 header file with one from p11-kit
The OASIS pkcs11.h header has a restrictive license.  Replace the
pkcs11.h pkcs11f.h and pkcs11t.h headers with pkcs11.h from p11-kit.

For source distribution, the license for the OASIS headers itself
doesn't pose any licensing problem when combined with MPL license, but
it possibly creates problem for downstream distributors of BIND 9.
2019-09-16 04:47:50 -04:00
Ondřej Surý
3699545dac Merge branch 'ondrej/check-for-return-values-in-mutexatomics.h' into 'master'
Check isc_mutex_{lock,unlock}() return values in mutexatomic.h shim

See merge request isc-projects/bind9!2343
2019-09-13 04:55:55 -04:00
Ondřej Surý
aea3631fd5 Check isc_mutex_{lock,unlock}() return values in mutexatomic.h shim 2019-09-13 10:55:14 +02:00
Mark Andrews
7300866778 Merge branch '1184-invalid-reference-counting' into 'master'
Resolve "Invalid reference counting"

Closes #1184

See merge request isc-projects/bind9!2266
2019-09-12 23:40:11 -04:00
Mark Andrews
9edcaa0832 Convert cache->live_tasks to reference counter. 2019-09-13 12:45:06 +10:00
Ondřej Surý
ed494fe29d Unify how we use isc_refcount_decrement() to destroy object
The isc_refcount_decrement() was either used as:

    if (isc_refcount_decrement() == 1) { destroy(); }

or

    if (isc_refcount_decrement() != 1) { return; } destroy();

This commits eradicates the last usage of the later, so the code is unified to
use the former.
2019-09-13 12:44:49 +10:00
Mark Andrews
c3bcb4d47a Remove potential use after free (fctx) in rctx_resend. 2019-09-13 12:44:12 +10:00
Mark Andrews
b125b7031c Use reference counts instead of ISC_LIST_EMPTY to determine when to destroy ecdb. 2019-09-13 12:43:52 +10:00
Michal Nowak
6ba5a08c8a Merge branch 'mnowak_README_fixes' into 'master'
Various README.md and README fixes

See merge request isc-projects/bind9!2323
2019-09-12 12:15:41 -04:00
Michal Nowak
4e2fdd7ee9 Various README.md and README fixes
Fixing typos, typographical glitches. Added backticks around binaries,
modules, and libraries so it's more consistent. Added a paragraph with
ISC Security Policy.
2019-09-12 16:11:01 +02:00
Michał Kępień
7a3896ef1a Merge branch 'michal/add-freebsd-to-ci' into 'master'
Add FreeBSD to CI

See merge request isc-projects/bind9!2242
2019-09-12 08:58:24 -04:00
Michał Kępień
51af91d007 Add FreeBSD to GitLab CI
Ensure BIND can be tested on FreeBSD in GitLab to more quickly catch
build and test errors on that operating system.  Make the relevant jobs
optional until the CI environment supporting them is deemed stable
enough for continuous use.

FreeBSD jobs are run using the Custom executor feature of GitLab Runner.
Unlike the Docker executor, the Custom executor does not support the
"image" option and thus some way of informing the runner about the OS
version to use for a given job is necessary.  Arguably the simplest way
of doing that without a lot of code duplication in .gitlab-ci.yml would
be to use a YAML template with a "variables" block specifying the
desired FreeBSD release to use, but including such a template in a job
definition would cause issues in case other variables also needed to be
set for that job (e.g. CFLAGS or EXTRA_CONFIGURE for build jobs).  Thus,
only one FreeBSD YAML template is defined instead and the Custom
executor scripts on FreeBSD runners extract the OS version to use from
the CI job name.  This allows .gitlab-ci.yml variables to be defined for
FreeBSD jobs in the same way as for Docker-based jobs.
2019-09-12 14:25:57 +02:00
Michał Kępień
154f2ca6f6 Tweak lib/dns/tests/tkey_test requirements
Currently, the lib/dns/tests/tkey_test unit test is only run when the
linker supports the --wrap option.  However, linker support for that
option is only needed for static builds.  As a result, the unit test
mentioned before is not being run everywhere it can be run as even for
builds done using --with-libtool, the test is not run unless the linker
supports the --wrap option.

Tweak preprocessor directives in lib/dns/tests/tkey_test.c so that this
test is run:

  - for all builds using --with-libtool,
  - for static builds done using a linker supporting the --wrap option.
2019-09-12 14:25:57 +02:00
Michał Kępień
119f3e0c2e Make lib/dns/tests/tkey_test.c more portable
Weak symbols are handled differently by different dynamic linkers.  With
glibc, lib/dns/tests/tkey_test works as expected no matter whether
--with-libtool is used or not: __attribute__((weak)) prevents a static
build from failing and it just so happens that the desired symbols are
picked at runtime for dynamic builds.  However, with BSD libc, the
libdns functions called from lib/dns/tests/tkey_test.c use the "real"
memory allocation functions from libisc, thus breaking that unit test.
(Note: similar behavior can be reproduced with glibc by setting the
LD_DYNAMIC_WEAK environment variable.)

The simplest way to make lib/dns/tests/tkey_test work reliably is to
drop all uses of __attribute__((weak)) in it - this way, the memory
functions inside lib/dns/tests/tkey_test.c will always be used instead
of the "real" libisc ones for dynamic builds.  However, this would not
work with static builds as it would result in multiple strong symbols
with the same name being present in a single binary.

Work around the problem by only compiling in the overriding definitions
of memory functions when building using --with-libtool.  For static
builds, keep relying on the --wrap linker option for replacing calls to
the functions we are interested in.
2019-09-12 14:25:57 +02:00
Michał Kępień
1bffa602ba Set --logfile for all kyua invocations
When kyua is called without the --logfile command line option, the log
file is created at a default location which is derived from the HOME
environment variable.  On FreeBSD GitLab CI runners, /home is a
read-only directory and thus kyua invocations not using the --logfile
option fail when HOME is set to something beneath /home.  Set --logfile
to /dev/null for all kyua invocations whose logs are irrelevant in order
to prevent kyua failures caused by HOME being non-writable.
2019-09-12 14:25:57 +02:00
Michał Kępień
87018ce225 Merge branch 'michal/misc-doc-fixes' into 'master'
Miscellaneous documentation fixes

See merge request isc-projects/bind9!2329
2019-09-12 08:01:31 -04:00
Michał Kępień
995d6b7417 Fix latest BIND version number in CHANGES
BIND version number in CHANGES was not updated when the 9.15.4 release
was prepared.  Make sure the correct version number is used.
2019-09-12 13:57:24 +02:00
Michał Kępień
b0ee065e65 Fix <command> XML tag
Restore proper spelling of the <command> XML tag to prevent release note
text from getting mangled.
2019-09-12 13:57:24 +02:00
Michał Kępień
5af0b1d1d3 README: do not mention /usr/include on macOS
For newer versions of Xcode, "xcode-select --install" no longer installs
system headers into /usr/include (instead, they are installed in the
Xcode directory tree), so do not mention that path in the macOS section
of README to prevent confusion.
2019-09-12 13:57:24 +02:00
Mark Andrews
0023060dc0 Merge branch 'marka-split-notes-master' into 'master'
split notes.xml into sections

See merge request isc-projects/bind9!2326
2019-09-12 05:53:41 -04:00
Mark Andrews
0d51dec350 split notes.xml into sections 2019-09-12 05:53:09 -04:00
Mark Andrews
44fa4d20dd Merge branch '1043-cppcheck-detected-code-issues' into 'master'
Resolve "cppcheck-detected code issues"

Closes #1043

See merge request isc-projects/bind9!2239
2019-09-12 04:29:02 -04:00
Mark Andrews
b59fe46e76 address or suppress cppcheck warnings 2019-09-12 17:59:28 +10:00
Ondřej Surý
30b6e93a70 Merge branch 'ondrej/refactor-and-cleanup-isc_mem_create' into 'master'
Refactor and cleanup isc_mem_create()

See merge request isc-projects/bind9!2315
2019-09-12 03:50:22 -04:00
Ondřej Surý
aeea5ece97 Remove now useless ISC_MEMFLAG_NOLOCK memflag
Previously the libisc allocator had ability to run unlocked when threading was
disabled.  As the threading is now always on, remove the ISC_MEMFLAG_NOLOCK
memory flag as it serves no purpose.
2019-09-12 09:26:09 +02:00
Ondřej Surý
19fbdef31e Remove unused isc_mem_createx() function
The isc_mem_createx() function was only used in the tests to eliminate using the
default flags (which as of writing this commit message was ISC_MEMFLAG_INTERNAL
and ISC_MEMFLAG_FILL).  This commit removes the isc_mem_createx() function from
the public API.
2019-09-12 09:26:09 +02:00