Commit Graph

33377 Commits

Author SHA1 Message Date
Matthijs Mekking
313de3a7e2 Add purge-keys config option
Add a new option 'purge-keys' to 'dnssec-policy' that will purge key
files for deleted keys. The option determines how long key files
should be retained prior to removing the corresponding files from
disk.

If set to 0, the option is disabled and 'named' will not remove key
files from disk.
2021-02-23 09:16:48 +01:00
Mark Andrews
d4cb312555 Merge branch '2509-cid-281489-resource-leaks-resource_leak' into 'main'
Resolve "CID 281489:  Resource leaks  (RESOURCE_LEAK)"

Closes #2509

See merge request isc-projects/bind9!4723
2021-02-22 22:39:23 +00:00
Mark Andrews
003dd8cc70 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
2021-02-22 12:22:31 +11:00
Ondřej Surý
bb124d6056 Merge branch 'ondrej/add-tls_p.h-to-Makefile.am' into 'main'
Include lib/isc/tls_p.h in release tarballs

See merge request isc-projects/bind9!4716
2021-02-19 12:30:50 +00:00
Ondřej Surý
f53e7ed12c Include lib/isc/tls_p.h in release tarballs
The addition of lib/isc/tls_p.h to the source tree was not accounted for
in the relevant variable in lib/isc/Makefile.am and thus the former file
is not being included in release tarballs prepared using "make dist".
Fix by tweaking the libisc_la_SOURCES list in lib/isc/Makefile.am
accordingly.
2021-02-19 13:25:18 +01:00
Michał Kępień
5d473f92ed Merge branch '2504-do-not-require-libtool-in-PATH-at-build-time' into 'main'
Do not require libtool in PATH at build time

Closes #2504

See merge request isc-projects/bind9!4715
2021-02-19 12:09:48 +00:00
Michał Kępień
c8bddd2e64 Add CHANGES entry 2021-02-19 11:52:56 +01:00
Michał Kępień
b630c698f9 Do not require libtool in PATH at build time
The build-time requirement for libtool was introduced inadvertently:

 1. Commit 1628f5865a added a check to
    configure.ac which claims to test whether the libtool script is
    available.  There are two problems with that check:

      - it is effectively a no-op as the AC_PROG_LIBTOOL() macro always
        sets the LIBTOOL variable [1],

      - this check was intended to be performed before autoreconf is
        run, not when ./configure is run; the libtool script is supposed
        to be dynamically generated by ./configure on the build host and
        thus there is no need for a standalone libtool script to be
        installed system-wide on every host attempting to build BIND 9
        e.g. from a tarball produced by "make dist".

 2. Commit a7982d14dd was based on the
    incorrect assumption that the AC_PROG_LIBTOOL() macro looks for the
    libtool binary in PATH and sets the LIBTOOL variable accordingly,
    which is what other AC_PROG_*() macros do.  Meanwhile, the
    AC_PROG_LIBTOOL() macro only initializes libtool for use with
    Automake.  It is not necessary for a standalone libtool script to be
    available in PATH on the build host when ./configure is run.

Do not look for libtool in PATH at build time as it prevents hosts
without a libtool script available system-wide from building BIND 9 from
source tarballs prepared using "make dist".  Note that libtool m4
macros, utilities, etc. still need to be present on a given host if
autoreconf is to be run on it.

[1] https://git.savannah.gnu.org/cgit/libtool.git/tree/m4/libtool.m4?h=v2.4.6#n89
2021-02-19 11:52:56 +01:00
Mark Andrews
0b8d2bfb4c Merge branch '2499-a-loc-record-with-a-invalid-direction-field-triggers-an-insist' into 'main'
Resolve "A LOC record with a invalid direction field triggers an INSIST"

Closes #2499

See merge request isc-projects/bind9!4704
2021-02-18 22:37:41 +00:00
Mark Andrews
3d340ecfd2 Add release note for [GL #2499] 2021-02-19 09:18:08 +11:00
Mark Andrews
6f47e0956c Add CHANGES for [GL #2499] 2021-02-19 09:18:06 +11:00
Mark Andrews
009358d77d Correctly detect when get_direction failed 2021-02-19 09:17:32 +11:00
Mark Andrews
07902d9f9d Test a LOC record with an invalid direction field 2021-02-19 09:17:32 +11:00
Ondřej Surý
3547c0c1ff Merge branch '2433-improve-memory-contention' into 'main'
Resolve "investigate and improve lock contention around mctx"

Closes #2433

See merge request isc-projects/bind9!4659
2021-02-18 20:08:09 +00:00
Ondřej Surý
0302e54892 Add CHANGES note for GL #2433 2021-02-18 19:33:54 +01:00
Ondřej Surý
494d0da522 Use library constructor/destructor to initialize OpenSSL
Instead of calling isc_tls_initialize()/isc_tls_destroy() explicitly use
gcc/clang attributes on POSIX and DLLMain on Windows to initialize and
shutdown OpenSSL library.

This resolves the issue when isc_nm_create() / isc_nm_destroy() was
called multiple times and it would call OpenSSL library destructors from
isc_nm_destroy().

At the same time, since we now have introduced the ctor/dtor for libisc,
this commit moves the isc_mem API initialization (the list of the
contexts) and changes the isc_mem_checkdestroyed() to schedule the
checking of memory context on library unload instead of executing the
code immediately.
2021-02-18 19:33:54 +01:00
Ondřej Surý
4bde4f050b Disable calling DllMain() on thread creation/destruction
Disables the DLL_THREAD_ATTACH and DLL_THREAD_DETACH notifications for
the specified dynamic-link library (DLL).  This can reduce the size of
the working set for some applications.
2021-02-18 19:33:54 +01:00
Ondřej Surý
f225462055 Fix the invalid condition variable
Although harmless, the memmove() in tlsdns and tcpdns was guarded by a
current message length variable that was always bigger than 0 instead of
correct current buffer length remainder variable.
2021-02-18 19:33:54 +01:00
Ondřej Surý
4775e9f256 Move most of the OpenSSL initialization to isc_tls
Since we now require both libcrypto and libssl to be initialized for
netmgr, we move all the OpenSSL initialization code except the engine
initialization to isc_tls API.

The isc_tls_initialize() and isc_tls_destroy() has been made idempotent,
so they could be called multiple time.  However when isc_tls_destroy()
has been called, the isc_tls_initialize() could not be called again.
2021-02-18 19:33:54 +01:00
Ondřej Surý
ff47b47f1a Remove overrun checking code from memory allocator
The ISC_MEM_CHECKOVERRUN would add canary byte at the end of every
allocations and check whether the canary byte hasn't been changed at the
free time.  The AddressSanitizer and valgrind memory checks surpases
simple checks like this, so there's no need to actually keep the code
inside the allocator.
2021-02-18 19:33:54 +01:00
Ondřej Surý
549e5b693a Modify the way we benchmark mem_{get,put}
Previously, the mem_{get,put} benchmark would pass the allocation size
as thread_create argument.  This has been now changed, so the allocation
size is stored and decremented (divided) in atomic variable and the
thread create routing is given a memory context.  This will allow to
write tests where each thread is given different memory context and do
the same for mempool benchmarking.
2021-02-18 19:33:54 +01:00
Ondřej Surý
f34f943b16 Disable memory debugging features in non-developer build
The two memory debugging features: ISC_MEM_DEFAULTFILL
(ISC_MEMFLAG_FILL) and ISC_MEM_TRACKLINES were always enabled in all
builds and the former was only disabled in `named`.

This commits disables those two features in non-developer build to make
the memory allocator significantly faster.
2021-02-18 19:33:54 +01:00
Ondřej Surý
c9fe12443f Make the mempool names unconditional
The named memory pools were default and always compiled-in.  Remove the
extra complexity by removing the #define and #ifdefs around the code.
2021-02-18 19:33:54 +01:00
Ondřej Surý
b09106e93a Make the memory and mempool counters to be stdatomic types
This is yet another step into unlocking some parts of the memory
contexts.  All the regularly updated variables has been turned into
atomic types, so we can later remove the locks when updating various
counters.

Also unlock as much code as possible without breaking anything.
2021-02-18 19:33:51 +01:00
Ondřej Surý
0f44139145 Bump the maximum number of hazard pointers in tests
On 24-core machine, the tests would crash because we would run out of
the hazard pointers.  We now adjust the number of hazard pointers to be
in the <128,256> interval based on the number of available cores.

Note: This is just a band-aid and needs a proper fix.
2021-02-18 19:32:55 +01:00
Ondřej Surý
7de846977b Remove the extra level of indirection via isc_memmethods_t
Previously, the applications using libisc would be able to override the
internal memory methods with own implementation.  This was no longer
possible, but the extra level of indirection was not removed.  This
commit removes the extra level of indirection for the memory methods and
the default_memalloc() and default_memfree().
2021-02-18 19:32:55 +01:00
Ondřej Surý
55ace5d3aa Remove the internal memory allocator
The internal memory allocator had an extra code to keep a list of blocks
for small size allocation.  This would help to reduce the interactions
with the system malloc as the memory would be already allocated from the
system, but there's an extra cost associated with that - all the
allocations/deallocations must be locked, effectively eliminating any
optimizations in the system allocator targeted at multi-threaded
applications. While the isc_mem API is still using locks pretty heavily,
this is a first step into reducing the memory allocation/deallocation
contention.
2021-02-18 19:32:02 +01:00
Michal Nowak
706c57280f Merge branch 'mnowak/fix-feature-test-tool-location' into 'main'
Use FEATURETEST variable instead of a path

See merge request isc-projects/bind9!4694
2021-02-18 14:43:29 +00:00
Michal Nowak
102f012631 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
2021-02-18 15:41:09 +01:00
Michał Kępień
da21650949 Merge branch 'michal/add-a-checklist-for-handling-cves' into 'main'
Add a checklist for handling security issues

See merge request isc-projects/bind9!3950
2021-02-18 10:16:57 +00:00
Michał Kępień
3e5efc46d4 Add a checklist for handling security issues 2021-02-18 11:11:40 +01:00
Michał Kępień
a55f4106ef Merge branch 'v9_17_10-release' into 'main'
Merge 9.17.10 release branch

See merge request isc-projects/bind9!4699
2021-02-17 21:29:03 +00:00
Michał Kępień
ac95a9db99 Set up release notes for BIND 9.17.11 2021-02-17 22:25:26 +01:00
Michał Kępień
2b88a255d9 Update BIND version to 9.17.10 2021-02-17 22:20:24 +01:00
Michał Kępień
a02c5c350e Add a CHANGES marker 2021-02-17 22:20:24 +01:00
Michał Kępień
77026a0fc2 Merge branch 'michal/prepare-documentation-for-bind-9.17.10' into 'v9_17_10-release'
Prepare documentation for BIND 9.17.10

See merge request isc-private/bind9!237
2021-02-17 22:20:24 +01:00
Michał Kępień
48353879e5 Prepare release notes for BIND 9.17.10 2021-02-17 22:20:24 +01:00
Michał Kępień
5c15c6ab21 Add release note for GL #2073 2021-02-17 22:20:24 +01:00
Michał Kępień
fc4b7e72cc Reorder release notes 2021-02-17 22:20:24 +01:00
Michał Kępień
3799e66f04 Tweak and reword release notes 2021-02-17 22:20:24 +01:00
Michał Kępień
589cbe9bad Tweak and reword recent CHANGES entries 2021-02-17 22:20:24 +01:00
Michał Kępień
234ff52725 Use :rfc:<number> references in release notes 2021-02-17 22:20:24 +01:00
Michał Kępień
e63b385073 Document the build-time requirement for nghttp2 2021-02-17 22:20:24 +01:00
Michal Nowak
8836a6e2b5 Merge branch 'mnowak/system-test-check-for-file-not-removed' into 'main'
Check for "file not removed" in system test output

See merge request isc-projects/bind9!4680
2021-02-17 16:08:26 +00:00
Michal Nowak
f310b75250 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
2021-02-17 16:35:21 +01:00
Michal Nowak
14a104d121 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:clang:freebsd11:amd64:
- I:tkey:file tkey/ns1/named.conf-e not removed

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

system:gcc:xenial:amd64:
- I:rpzextra:file rpzextra/.cache/v/cache/lastfailed not removed
- I:rpzrecurse:file rpzrecurse/ns3/named.run.prev not removed
- I:shutdown:file shutdown/.cache/v/cache/lastfailed not removed
2021-02-17 16:35:21 +01:00
Michal Nowak
e48d7db13a Copy testcrypto.sh to out-of-tree directory
System tests run in out-of-tree directory fail to find testcrypto.sh and
produce:

    /bin/bash: ../testcrypto.sh: No such file or directory
2021-02-17 16:35:21 +01:00
Michal Nowak
4a2778abdf Check for "file not removed" in system test output
Run this check only when in Git repository, because the run.sh function
which produces the "file not removed" warning is run only when build
directory is the same as the source directory, that is only for in-tree
builds.
2021-02-17 16:35:21 +01:00
Michal Nowak
10bf725ee2 Add system test name to "file not removed" info 2021-02-17 16:35:21 +01:00
Michal Nowak
09acebd910 Merge branch 'mnowak/enable-dh-unit-test-to-run-under-pkcs11' into 'main'
Drop USE_OPENSSL constraint from dh_test

See merge request isc-projects/bind9!4621
2021-02-17 11:44:39 +00:00