Commit Graph

36391 Commits

Author SHA1 Message Date
Artem Boldariev
d6041e5d45 *_noresponse, tlsdns_listen_noalpn: csends == 1 is not guaranteed
This commit removes an assertion from the unit test which cannot be
guaranteed.

According to the test, exactly one client send must succeed. However,
it cannot really be guaranteed, as do not start to read data in the
accept callback on the server nor attach to the accepted handle. Thus,
we can expect the connection to be closed soon after we have returned
from the callback.

Interestingly enough, the test would pass just fine on TCP because:

a) there are fewer layers involved and thus there is less processing;

b) it is possible for the data to be sent and end up in an internal OS
socket buffer without being touched by an application's code on the
server. In such a case the client's write callback still would be
called successfully;

There is a chance for the test to succeed over TLS as well (as it
happily did before), but as the code has been changed to close unused
connections as soon as possible, the chance is far slimmer now.

What can be guaranteed is:

* cconnects == 1 (number client connections equals 1);
* saccepts == 1 (number of accepted connections equals 1).

(cherry picked from commit 0f9b6a7bc1)
2022-07-12 15:31:20 +03:00
Artem Boldariev
c85949fbe1 TLSDNS: try pass incoming data to OpenSSL if there are any
Otherwise the code path will lead to a call to SSL_get_error()
returning SSL_ERROR_SSL, which in turn might lead to closing
connection to early in an unexpected way, as it is clearly not what is
intended.

The issue was found when working on loppmgr branch and appears to
be timing related as well. Might be responsible for some unexpected
transmission failures e.g. on zone transfers.

(cherry picked from commit 8585b92f98)
2022-07-12 15:29:36 +03:00
Artem Boldariev
ba7fabde01 TLS: bail out earlier when NM is stopping
In some operations - most prominently when establishing connection -
it might be beneficial to bail out earlier when the network manager
is stopping.

The issue is backported from loopmgr branch, where such a change is
not only beneficial, but required.

(cherry picked from commit fc74b15e67)
2022-07-12 15:28:15 +03:00
Artem Boldariev
0754def85d TLS: sometimes TCP conn. handle might be NULL on when connecting
In some cases - in particular, in case of errors, NULL might be passed
to a connection callback instead of a handle that could have led to
an abort. This commit ensures that such a situation will not occur.

The issue was found when working on the loopmgr branch.

(cherry picked from commit ac4fb34f18)
2022-07-12 15:26:50 +03:00
Artem Boldariev
c44633feb2 TLS: try to close sockets whenever there are no pending operations
This commit ensures that the underlying TCP socket of a TLS connection
gets closed earlier whenever there are no pending operations on it.

In the loop-manager branch, in some circumstances the connection
could have remained opened for far too long for no reason. This
commit ensures that will not happen.

(cherry picked from commit 88524e26ec)
2022-07-12 15:25:30 +03:00
Artem Boldariev
3e69cc35b8 TLS: Implement isc_nmhandle_setwritetimeout()
This commit adds a proper implementation of
isc_nmhandle_setwritetimeout() for TLS connections. Now it passes the
value to the underlying TCP handle.

(cherry picked from commit 237ce05b89)
2022-07-12 15:22:57 +03:00
Michal Nowak
4884ac3355 Merge branch 'mnowak/alpine-3.16-v9_18' into 'v9_18'
[v9_18] Add Alpine Linux 3.16

See merge request isc-projects/bind9!6548
2022-07-12 11:33:24 +00:00
Michal Nowak
1e386c5489 Add Alpine Linux 3.16
(cherry picked from commit 0d0ab3db10)
2022-07-12 13:11:48 +02:00
Mark Andrews
bcc5fc4a10 Merge branch '3389-unexpected-badkey-in-upforwd-system-test-v9_18' into 'v9_18'
Clone the message buffer before forwarding UPDATE messages [v9_18]

See merge request isc-projects/bind9!6544
2022-07-12 10:05:54 +00:00
Mark Andrews
4be9aba39e Add CHANGES note for [GL #3389]
(cherry picked from commit 09d8ed3970)
2022-07-12 19:01:18 +10:00
Mark Andrews
44bfc8a9b2 Clone the message buffer before forwarding UPDATE messages
this prevents named forwarding a buffer that may have been over
written.

(cherry picked from commit 7a42417d61)
2022-07-12 19:00:38 +10:00
Michał Kępień
068741dbe6 Merge branch 'michal/set-up-version-and-release-notes-for-bind-9.18.6' into 'v9_18'
Set up version and release notes for BIND 9.18.6

See merge request isc-projects/bind9!6539
2022-07-11 07:05:55 +00:00
Michał Kępień
c7f1ee665b Set up release notes for BIND 9.18.6 2022-07-11 08:51:32 +02:00
Michał Kępień
be9c6f44f3 Update BIND version to 9.18.6-dev 2022-07-11 08:51:32 +02:00
Mark Andrews
a93f5ed51d Merge branch '3433-support-default-hmac-v9_18' into 'v9_18'
Support DEFAULT_HMAC [v9_18]

See merge request isc-projects/bind9!6533
2022-07-07 05:06:48 +00:00
Mark Andrews
ba45075acb Add DEFAULT_HMAC to conf.sh.common
(cherry picked from commit 972d7fd682)
2022-07-07 13:26:16 +10:00
Mark Andrews
d4297eed9c Merge branch '3061-ifconfig-sh-down-messes-up-loopback-interfaces-v9_18' into 'v9_18'
update ifconfig.sh [v9_18]

See merge request isc-projects/bind9!6530
2022-07-07 00:52:51 +00:00
Mark Andrews
6311d9d2f6 Add CHANGES note for [GL #3061]
(cherry picked from commit e0708c8950)
2022-07-07 10:13:00 +10:00
Mark Andrews
5a58e8af8d update ifconfig.sh
* make it harder to get the interface numbers wrong by using 'max'
to specify the upper bound of the sequence of interfaces and use 'max'
when calculating the interface number
* extract the platform specific instruction into 'up' and 'down'
and call them from the inner loop so that the interface number is
calculated in one place.
* calculate the A and AAAA address in a single place rather than
in each command
* use /sbin/ipadm on Solaris 2.11 and greater

(cherry picked from commit abfb5b1173)
2022-07-07 10:13:00 +10:00
Evan Hunt
382cac0f4f Merge branch '3152-retry-on-formerr-v9_18' into 'v9_18'
try other servers when receiving FORMERR

See merge request isc-projects/bind9!6529
2022-07-06 22:39:36 +00:00
Evan Hunt
19be66772c CHANGES for [GL #3152]
(cherry picked from commit 43e38a21ef)
2022-07-06 22:19:20 +00:00
Evan Hunt
30534b125e try other servers when receiving FORMERR
previously, when an iterative query returned FORMERR, resolution
would be stopped under the assumption that other servers for
the same domain would likely have the same capabilities. this
assumption is not correct; some domains have been reported for
which some but not all servers will return FORMERR to a given
query; retrying allows recursion to succeed.

(cherry picked from commit f6abb80746)
2022-07-06 22:19:20 +00:00
Mark Andrews
12224771d0 Merge branch '3402-create-synth-from-dnssec-namespaces-v9_18' into 'v9_18'
Add a mechanism to record namespaces for synth-from-dnssec [v9_18]

See merge request isc-projects/bind9!6528
2022-07-06 22:18:23 +00:00
Mark Andrews
1872105f09 Add release note for [GL #3402]
(cherry picked from commit 07d5c23cac)
2022-07-07 07:47:45 +10:00
Mark Andrews
fa4eb975b8 Add CHANGES note for [GL #3402]
(cherry picked from commit 682c6eb533)
2022-07-07 07:47:45 +10:00
Mark Andrews
443fb79a2c Test grafting and synth-from-dnssec using primary zone
(cherry picked from commit 33454fb0e9)
2022-07-07 07:47:45 +10:00
Mark Andrews
00db079f79 Add system test for forward only grafted zone with synth-from-dnssec
We are grafting on an unsigned zone "example.internal" where the higher
zone (".") is signed and would otherwise cause named to synthesise a
NXDOMAIN for example.internal.  We prime the cache by performing a
lookup for "internal" and then lookup "example.internal".

(cherry picked from commit 8af5d0ad68)
2022-07-07 07:47:45 +10:00
Mark Andrews
30d4e3ee89 Add synth-from-dnssec namespaces for keytable entries
We do this by adding callbacks for when a node is added or deleted
from the keytable.  dns_keytable_add and dns_keytable_delete where
extended to take a callback.  dns_keytable_deletekey does not remove
the node so it was not extended.

(cherry picked from commit a5b57ed293)
2022-07-07 07:47:45 +10:00
Mark Andrews
90467f4127 Add synth-from-dnssec namespace entries for forward only namespaces
Currently forward entries are only removed on view destruction so
there is no matching dns_view_sfd_del call.

(cherry picked from commit a559d6fdd1)
2022-07-07 07:47:45 +10:00
Mark Andrews
107c3a452a Add entries to the synth-from-dnssec namespace tree for zones
When a zone is attached or detached from the view (zone->view is
updated) update the synth-from-dnssec namespace tree.

(cherry picked from commit f716bd68d4)
2022-07-07 07:47:45 +10:00
Mark Andrews
4d9287dca5 Check the synth-form-dnssec namespace when synthesising responses
Call dns_view_sfd_find to find the namespace to be used to verify
the covering NSEC records returned for the given QNAME.  Check that
the NSEC owner names are within that namespace.

(cherry picked from commit 228dadb026)
2022-07-07 07:47:45 +10:00
Mark Andrews
b979b6be40 Add a mechanism to record namespaces for synth-from-dnssec
When namespace is grafted on, the DNSSEC proofs for non existance
need to come from that namespace and not a higher namespace.  We
add 3 function dns_view_sfd_add, dns_view_sfd_del and dns_view_sfd_find
to add, remove and find the namespace that should be used when
checking NSEC records.

dns_view_sfd_add adds a name to a tree, creating the tree if needed.
If the name already existed in the tree the reference count is
increased otherwise it is initalised to 1.

dns_view_sfd_del removes a reference to a name in the tree, if the
count goes to 0 the node is removed.

dns_view_sfd_find returns the namespace to be used to entered name.
If there isn't an enclosing name in the tree, or the tree does not
yet exist, the root name is returned.

Access to the tree is controlled by a read/write lock.

(cherry picked from commit 3619cad141)
2022-07-07 07:47:45 +10:00
Mark Andrews
f94fb633ef Merge branch '3429-detect-overflow-in-generate-directive-v9_18' into 'v9_18'
Check for overflow in $GENERATE computations [v9_18]

See merge request isc-projects/bind9!6526
2022-07-06 02:04:45 +00:00
Mark Andrews
ea80e643f7 Add CHANGES note for [GL #3429]
(cherry picked from commit d935ead14b)
2022-07-06 11:26:02 +10:00
Evan Hunt
2936264dc4 Improve $GENERATE documentation
Clarify the documentation of $GENERATE modifiers and add an example.

(cherry picked from commit 13fb2faf7a)
2022-07-06 11:25:20 +10:00
Mark Andrews
656e33ce18 Tighten $GENERATE directive parsing
The original sscanf processing allowed for a number of syntax errors
to be accepted.  This included missing the closing brace in
${modifiers}

Look for both comma and right brace as intermediate seperators as
well as consuming the final right brace in the sscanf processing
for ${modifiers}.  Check when we got right brace to determine if
the sscanf consumed more input than expected and if so behave as
if it had stopped at the first right brace.

(cherry picked from commit 7be64c0e94)
2022-07-06 11:25:20 +10:00
Mark Andrews
72999440bd Check for overflow in $GENERATE computations
$GENERATE uses 'int' for its computations and some constructions
can overflow values that can be represented by an 'int' resulting
in undefined behaviour.  Detect these conditions and return a
range error.

(cherry picked from commit 5327b9708f)
2022-07-06 11:25:20 +10:00
Evan Hunt
301d8f9fe0 Merge branch 'each-require-has-side-effects-v9_18' into 'v9_18'
REQUIRE should not have side effects

See merge request isc-projects/bind9!6525
2022-07-05 21:08:17 +00:00
Evan Hunt
b061e86d17 REQUIRE should not have side effects
it's a style violation to have REQUIRE or INSIST contain code that
must run for the server to work. this was being done with some
atomic_compare_exchange calls. these have been cleaned up.  uses
of atomic_compare_exchange in assertions have been replaced with
a new macro atomic_compare_exchange_enforced, which uses RUNTIME_CHECK
to ensure that the exchange was successful.

(cherry picked from commit a499794984)
2022-07-05 13:04:17 -07:00
Mark Andrews
e8a5d0444e Merge branch '3437-cds-error-window-too-small-v9_18' into 'v9_18'
Only report not matching stderr content when we look for it [v9_18]

See merge request isc-projects/bind9!6523
2022-07-05 18:34:20 +00:00
Mark Andrews
aedcc7c725 Increase the amount of time allowed for signing to occur in
On slow systems we have seen this take 9 seconds.  Increased the
allowance from 3 seconds to 10 seconds to reduce the probabilty of
a false negative from the system test.

(cherry picked from commit 4db847e80e)
2022-07-05 23:12:12 +10:00
Mark Andrews
287241d449 Only report not matching stderr content when we look for it
The previous test code could emit "D:cds:stderr did not match ''" rather
that just showing the contents of stderr.  Moved the debug line inside
the if/else block.

Replaced backquotes with $() and $(()) as approriate.

(cherry picked from commit 304d33fb32)
2022-07-05 23:12:12 +10:00
Petr Špaček
5f382729bf Merge branch 'pspacek/arm-hyperlinks-v9_18' into 'v9_18'
ARM hyperlinking [v9_18]

See merge request isc-projects/bind9!6519
2022-07-04 14:27:33 +00:00
Petr Špaček
5b8fe7d47e Hyperlink adjustments for v9_18
Release notes subdirectory did not match content of the main branch so
we had to do couple more manual tweaks to replace obsolete explicit
links with references to statement link anchors.
2022-07-04 16:22:12 +02:00
Petr Špaček
8db3a6789b Manually hyperlink algorithm, key, options, secret, and server
These statements/block are ambiguos because they occur in named.conf and
rndc.conf as well. All occurences now link link to the matching
definition.

(cherry picked from commit c3fed5ce40)
2022-07-04 16:09:25 +02:00
Petr Špaček
61ecaf55f5 Remove links from logging category names
Some logging categories have the same names as configuration statements.
This caused some category names to be replaced with links to statement
definitions, which confuses util/check-categories.sh script.

(cherry picked from commit e5a12144bd)
2022-07-04 16:09:25 +02:00
Suzanne Goldlust
e78ef65ef7 Grammar fixes and assorted text edits in the ARM
(cherry picked from commit 6db988e7e3)
2022-07-04 16:09:25 +02:00
Petr Špaček
9ee192d412 Add tables with statements by tag
(cherry picked from commit dd4dc78899)
2022-07-04 16:09:24 +02:00
Petr Špaček
6ef0b58026 Define topmost configuration blocks
(cherry picked from commit f91cbcf996)
2022-07-04 16:09:24 +02:00
Petr Špaček
6e8ee641a0 Alphabetize grammar glossary
(cherry picked from commit 8aea6694bf)
2022-07-04 16:09:24 +02:00