2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 05:57:52 +00:00

32308 Commits

Author SHA1 Message Date
Evan Hunt
45ab0603eb use an isc_task to execute rndc commands
- using an isc_task to execute all rndc functions makes it relatively
  simple for them to acquire task exclusive mode when needed
- control_recvmessage() has been separated into two functions,
  control_recvmessage() and control_respond(). the respond function
  can be called immediately from control_recvmessage() when processing
  a nonce, or it can be called after returning from the task event
  that ran the rndc command function.
2020-07-13 13:16:53 -07:00
Evan Hunt
3551d3ffd2 convert rndc and control channel to use netmgr
- updated libisccc to use netmgr events
- updated rndc to use isc_nm_tcpconnect() to establish connections
- updated control channel to use isc_nm_listentcp()

open issues:

- the control channel timeout was previously 60 seconds, but it is now
  overridden by the TCP idle timeout setting, which defaults to 30
  seconds. we should add a function that sets the timeout value for
  a specific listener socket, instead of always using the global value
  set in the netmgr. (for the moment, since 30 seconds is a reasonable
  timeout for the control channel, I'm not prioritizing this.)
- the netmgr currently has no support for UNIX-domain sockets; until
  this is addressed, it will not be possible to configure rndc to use
  them. we will need to either fix this or document the change in
  behavior.
2020-07-13 13:16:53 -07:00
Evan Hunt
002c328437 don't use exclusive mode for rndc commands that don't need it
"showzone" and "tsig-list" both used exclusive mode unnecessarily;
changing this will simplify future refactoring a bit.
2020-07-13 13:12:33 -07:00
Evan Hunt
0580d9cd8c style cleanup
clean up style in rndc and the control channel in preparation for
changing them to use the new network manager.
2020-07-13 12:41:04 -07:00
Evan Hunt
e7602e2d51 Merge branch 'each-lmdb-lock-fix' into 'main'
ensure new_zone_lock is released after count_newzones()

See merge request isc-projects/bind9!3833
2020-07-13 19:26:46 +00:00
Evan Hunt
ed37c63e2b make sure new_zone_lock is locked before unlocking it
it was possible for the count_newzones() function to try to
unlock view->new_zone_lock on return before locking it, which
caused a crash on shutdown.
2020-07-13 12:06:26 -07:00
Diego dos Santos Fronza
4aaef76c58 Merge branch '1719-observed-stats-underflow-in-multiple-stats' into 'main'
Resolve "Observed stats underflow in multiple stats"

Closes #1719

See merge request isc-projects/bind9!3818
2020-07-13 18:28:58 +00:00
Diego Fronza
a22e61d554 Add CHANGES and release note for #1719 2020-07-13 11:48:55 -03:00
Diego Fronza
aab691d512 Fix ns_statscounter_recursclients underflow
The basic scenario for the problem was that in the process of
resolving a query, if any rrset was eligible for prefetching, then it
would trigger a call to query_prefetch(), this call would run in
parallel to the normal query processing.

The problem arises due to the fact that both query_prefetch(), and,
in the original thread, a call to ns_query_recurse(), try to attach
to the recursionquota, but recursing client stats counter is only
incremented if ns_query_recurse() attachs to it first.

Conversely, if fetch_callback() is called before prefetch_done(),
it would not only detach from recursionquota, but also decrement
the stats counter, if query_prefetch() attached to te quota first
that would result in a decrement not matched by an increment, as
expected.

To solve this issue an atomic bool was added, it is set once in
ns_query_recurse(), allowing fetch_callback() to check for it
and decrement stats accordingly.

For a more compreensive explanation check the thread comment below:
https://gitlab.isc.org/isc-projects/bind9/-/issues/1719#note_145857
2020-07-13 11:46:18 -03:00
Mark Andrews
600128ac27 Merge branch '1235-system-tests-fail-with-new-etc-bind-keys-installed' into 'main'
Fallback to built in trust-anchors, managed-keys, or trusted-keys

Closes #1235

See merge request isc-projects/bind9!3827
2020-07-13 05:09:10 +00:00
Mark Andrews
d02a14c795 Fallback to built in trust-anchors, managed-keys, or trusted-keys
if the bind.keys file cannot be parsed.
2020-07-13 14:12:14 +10:00
Mark Andrews
1d739a95dd Merge branch '1989-rndc-dnstap-roll-with-too-big-a-argument-128-can-cause-a-buffer-overflow' into 'main'
Resolve "'rndc dnstap --roll' with too big a argument (>128) can cause a buffer overflow."

Closes #1989

See merge request isc-projects/bind9!3788
2020-07-13 03:52:02 +00:00
Mark Andrews
42b2290c3a Add changes for [GL #1989] 2020-07-13 13:10:45 +10:00
Mark Andrews
6ca78bc57d Address overrun in remove_old_tsversions
If too many versions of log / dnstap files to be saved where requests
the memory after to_keep could be overwritten.  Force the number of
versions to be saved to a save level.  Additionally the memmove length
was incorrect.
2020-07-13 13:10:45 +10:00
Mark Andrews
98de853740 Merge branch '2012-add-assertion-check-to-silence-dereference-before-null-check-in-tsig_test-c-v9_11' into 'main'
Resolve "Add assertion check to silence dereference before NULL check in tsig_test.c"

Closes #2012

See merge request isc-projects/bind9!3814
2020-07-13 03:06:25 +00:00
Mark Andrews
827746e89b Assert tsigout is non-NULL 2020-07-13 02:26:06 +00:00
Mark Andrews
1c73ea491b Merge branch '2014-statschannel-system-test-failed-at-setup-stage' into 'main'
Resolve "Statschannel system test failed at setup stage."

Closes #2014

See merge request isc-projects/bind9!3823
2020-07-13 02:22:09 +00:00
Mark Andrews
a0e8a11cc6 Don't verify the zone when setting expire to "now+1s" as it can fail
as too much wall clock time may have elapsed.

Also capture signzone output for forensic analysis
2020-07-13 01:39:13 +00:00
Mark Andrews
ef55dbf4fc Merge branch '2013-unchecked-returns-of-inet_pton-in-geoip_test-c' into 'main'
Resolve "Unchecked returns of inet_pton in geoip_test.c"

Closes #2013

See merge request isc-projects/bind9!3815
2020-07-13 01:21:52 +00:00
Mark Andrews
9499adeb5e check returns from inet_pton() 2020-07-13 00:31:29 +00:00
Mark Andrews
2e89dd7cb8 Merge branch 'marka-placeholder' into 'main'
placeholder for [GL #2010]

See merge request isc-projects/bind9!3834
2020-07-13 00:23:01 +00:00
Mark Andrews
93a336e248 placeholder for [GL #2010] 2020-07-13 00:21:22 +00:00
Mark Andrews
b02c3e4f8e Merge branch '2003-remove-redundant-listener-null-check' into 'main'
Resolve "Remove redundant listener != NULL check"

Closes #2003

See merge request isc-projects/bind9!3806
2020-07-13 00:13:52 +00:00
Mark Andrews
c91dc92410 Remove redundant check for listener being non-NULL 2020-07-12 23:46:35 +00:00
Michał Kępień
a87ac96b56 Merge branch '1976-fix-locking-for-lmdb-0.9.26' into 'main'
Fix locking for LMDB 0.9.26

Closes #1976

See merge request isc-projects/bind9!3758
2020-07-10 09:50:47 +00:00
Michał Kępień
7fffa5abba Add CHANGES for GL #1976 2020-07-10 11:29:18 +02:00
Michał Kępień
53120279b5 Fix locking for LMDB 0.9.26
When "rndc reconfig" is run, named first configures a fresh set of views
and then tears down the old views.  Consider what happens for a single
view with LMDB enabled; "envA" is the pointer to the LMDB environment
used by the original/old version of the view, "envB" is the pointer to
the same LMDB environment used by the new version of that view:

 1. mdb_env_open(envA) is called when the view is first created.
 2. "rndc reconfig" is called.
 3. mdb_env_open(envB) is called for the new instance of the view.
 4. mdb_env_close(envA) is called for the old instance of the view.

This seems to have worked so far.  However, an upstream change [1] in
LMDB which will be part of its 0.9.26 release prevents the above
sequence of calls from working as intended because the locktable mutexes
will now get destroyed by the mdb_env_close() call in step 4 above,
causing any subsequent mdb_txn_begin() calls to fail (because all of the
above steps are happening within a single named process).

Preventing the above scenario from happening would require either
redesigning the way we use LMDB in BIND, which is not something we can
easily backport, or redesigning the way BIND carries out its
reconfiguration process, which would be an even more severe change.

To work around the problem, set MDB_NOLOCK when calling mdb_env_open()
to stop LMDB from controlling concurrent access to the database and do
the necessary locking in named instead.  Reuse the view->new_zone_lock
mutex for this purpose to prevent the need for modifying struct dns_view
(which would necessitate library API version bumps).  Drop use of
MDB_NOTLS as it is made redundant by MDB_NOLOCK: MDB_NOTLS only affects
where LMDB reader locktable slots are stored while MDB_NOLOCK prevents
the reader locktable from being used altogether.

[1] 2fd44e3251
2020-07-10 11:29:18 +02:00
Ondřej Surý
42f8f17627 Merge branch 'ondrej/update-pregenerated-manpages' into 'main'
Fixup the manpages after ddns-confgen.rst -> tsig-keygen.rst rename

See merge request isc-projects/bind9!3817
2020-07-08 10:19:15 +00:00
Ondřej Surý
3da9909430 Fail the build if it updates any of the files in the git repository
There are still some pregenerated files left in the git
repository (cleaned up during `make maintainer-clean`) and we currently
don't notice if any of those needs to be updated in the git repository
because we ignore changes in the repository done during the build.

This commit adds a safeguard that fails the build job if the contents of
the git repository gets modified during the build.
2020-07-08 11:05:24 +02:00
Ondřej Surý
514ab2cc4f Fixup the manpages after ddns-confgen.rst -> tsig-keygen.rst rename
There were some missing bits in the other rst files and Makefile.am(s)
that didn't reflect the rename of the main document.  Also add
ddns-confgen.8 manpage.
2020-07-08 11:05:24 +02:00
Mark Andrews
1dd265df8f Merge branch '2011-off-by-one-error-in-dns_rdatatype_attributes' into 'main'
Resolve "Off-by-one error in dns_rdatatype_attributes?"

Closes #2011

See merge request isc-projects/bind9!3820
2020-07-08 03:01:05 +00:00
Mark Andrews
092a159dcd Adjust range limit of unknown meta types 2020-07-08 02:04:16 +00:00
Mark Andrews
13321a20ce Merge branch '2009-update-isc-logo-in-documentation' into 'main'
Resolve "Update ISC logo in documentation"

Closes #2009

See merge request isc-projects/bind9!3811
2020-07-08 02:00:31 +00:00
Mark Andrews
875a637eeb Update ISC logo 2020-07-08 02:00:11 +00:00
Mark Andrews
bb60192f70 Merge branch '1475-convert-header-attributes-to-atomic' into 'main'
Convert header->attributes to stdatomic

Closes #1475

See merge request isc-projects/bind9!3750
2020-07-08 01:24:10 +00:00
Mark Andrews
adf7cb4ba7 Add CHANGES note for [GL #1475] 2020-07-08 10:50:52 +10:00
Ondřej Surý
81d4230e60 Update STALE and ANCIENT header attributes atomically
The ThreadSanitizer found a data race when updating the stale header.
Instead of trying to acquire the write lock and failing occasionally
which would skew the statistics, the dns_rdatasetheader_t.attributes
field has been promoted to use stdatomics.  Updating the attributes in
the mark_header_ancient() and mark_header_stale() now uses the cmpxchg
to update the attributes forfeiting the need to hold the write lock on
the tree.  Please note that mark_header_ancient() still needs to hold
the lock because .dirty is being updated in the same go.
2020-07-08 10:50:52 +10:00
Mark Andrews
ef41dc097b Merge branch 'ondrej/add-16-bit-stdatomic-shims' into 'main'
Make the stdatomic shim and mutexatomic type complete

See merge request isc-projects/bind9!3816
2020-07-08 00:26:26 +00:00
Mark Andrews
bccea5862d Make the stdatomic shim and mutexatomic type complete
The stdatomic shims for non-C11 compilers (Windows, old gcc, ...) and
mutexatomic implemented only and minimal subset of the atomic types.
This commit adds 16-bit operations for Windows and all atomic types as
defined in standard.
2020-07-08 09:39:02 +10:00
Evan Hunt
f34b179d12 Merge branch '1998-fully-rename-tsig-keygen' into 'main'
use 'tsig-keygen' as the primary name for the tool

Closes #1998

See merge request isc-projects/bind9!3801
2020-07-06 09:00:26 +00:00
Evan Hunt
ba52377b37 use 'tsig-keygen' as the primary name for the tool
'ddns-confgen' is now an alias for 'tsig-keygen', rather than
the other way around.
2020-07-06 01:41:52 -07:00
Mark Andrews
858082de51 Merge branch '1990-bad-isc_mem_put-size' into 'main'
Resolve "Bad  isc_mem_put size."

Closes #1990

See merge request isc-projects/bind9!3790
2020-07-06 00:53:13 +00:00
Mark Andrews
c2c333e3f3 Bad isc_mem_put() size when an invalid type was specified in a ssu rule. 2020-07-06 10:33:27 +10:00
Mark Andrews
4e7cca965c Merge branch '1991-cleanup-redundant-non-null-check' into 'main'
Resolve "Cleanup redundant non-NULL check."

Closes #1991

See merge request isc-projects/bind9!3791
2020-07-06 00:14:42 +00:00
Mark Andrews
2fa2dbd5fb remove redundant rctx != NULL check 2020-07-05 23:52:19 +00:00
Matthijs Mekking
2995024458 Merge branch '1988-windows-rndc-dnssec-status-bad-output' into 'main'
Increase rndc output buffer size for rndc dnssec -status

Closes #1988

See merge request isc-projects/bind9!3802
2020-07-03 13:13:05 +00:00
Matthijs Mekking
9347e7db7e Increase "rndc dnssec -status" output size
BUFSIZ (512 bytes on Windows) may not be enough to fit the status of a
DNSSEC policy and three DNSSEC keys.

Set the size of the relevant buffer to a hardcoded value of 4096 bytes,
which should be enough for most scenarios.
2020-07-03 12:14:53 +02:00
Ondřej Surý
ee5b77ccb0 Merge branch '1925-additional-text-edits-to-bind-arm' into 'main'
Resolve "Additional text edits to BIND ARM"

Closes #1925

See merge request isc-projects/bind9!3800
2020-07-03 07:20:48 +00:00
Suzanne Goldlust
4cd6be18d3 Add missing named.conf man page 2020-07-03 09:02:41 +02:00
Suzanne Goldlust
056f12eb34 Final text edits to BIND 9 ARM in this round of updates 2020-07-03 09:02:15 +02:00