Commit graph

36405 commits

Author SHA1 Message Date
Evan Hunt
b66cd7b2fc clear fctx->magic and fetch->magic when destroying
fctx_destroy() and dns_resolver_destroyfetch() did not clear the
'magic' field during destruction.

(cherry picked from commit 5ec077e6aa)
2022-07-13 02:12:35 +00:00
Mark Andrews
b8d5763494 Merge branch '3446-autosign-s-checking-revoked-key-with-duplicate-key-id-test-was-incomplete-v9_18' into 'v9_18'
Make "checking revoked key with duplicate key ID" work [v9_18]

See merge request isc-projects/bind9!6559
2022-07-13 01:54:03 +00:00
Mark Andrews
484c74f5f4 Make "checking revoked key with duplicate key ID" work
There should be 2 keys with the same key id after the numerically
lower one is revoked (serial space arithmetic).  The DS points
at the non-revoked key so validation should still succeed.

(cherry picked from commit 513cb24b55)
2022-07-13 11:22:52 +10:00
Mark Andrews
f62e6d870d Merge branch '3445-update-libdns_la_libadd-instead-of-libdns_la_ldflags-v9_18' into 'v9_18'
Update libdns_la_LIBADD rather than libdns_la_LDFLAGS [v9_18]

See merge request isc-projects/bind9!6557
2022-07-13 01:02:14 +00:00
Mark Andrews
7f101aeb53 Update libdns_la_LIBADD rather than libdns_la_LDFLAGS
the wrong macro was being update with MAXMINDDB_LIBS making
it difficult to adjust link order.

(cherry picked from commit 5b51610174)
2022-07-13 10:46:37 +10:00
Evan Hunt
7994f1368c Merge branch '2683-ixfr-logging-v9_18' into 'v9_18'
log the reason for falling back to AXFR from IXFR at level info

See merge request isc-projects/bind9!6551
2022-07-12 23:52:38 +00:00
Evan Hunt
cc3070a0b3 log the reason for falling back to AXFR from IXFR at level info
messages indicating the reason for a fallback to AXFR (i.e, because
the requested serial number is not present in the journal, or because
the size of the IXFR response would exceeed "max-ixfr-ratio") are now
logged at level info instead of debug(4).

(cherry picked from commit df1d81cf96)
2022-07-12 16:26:13 -07:00
Matthijs Mekking
06c6c3d2f3 Merge branch '3438-dnssec-policy-does-not-set-inline-signing-v9_18' into 'v9_18'
[v9_18] Fix inheritance for dnssec-policy when checking for inline-signing

See merge request isc-projects/bind9!6546
2022-07-12 15:23:09 +00:00
Matthijs Mekking
383fe2f4ba Add release note and change entry for #3438
Bug worth mentioning.

(cherry picked from commit 689215a675)
2022-07-12 17:22:39 +02:00
Matthijs Mekking
235b89dbcd Inherit dnssec-policy in check for inline-signing
When dnssec-policy is used, and the zone is not dynamic, BIND will
assume that the zone is inline-signed. But the function responsible
for this did not inherit the dnssec-policy option from the view or
options level, and thus never enabled inline-signing, while the zone
should have been.

This is fixed by this commit.

(cherry picked from commit 576b21b168)
2022-07-12 17:22:39 +02:00
Matthijs Mekking
718d7bdeb9 Test setting of inline-signing with dnssec-policy
When dnssec-policy is used, and the zone is not dynamic, BIND will
assume that the zone is inline-signed. Add test cases to verify this.

(cherry picked from commit efa8a4e88d)
2022-07-12 17:22:39 +02:00
Matthijs Mekking
3f54a0f051 Fix kasp system test bugs
Fix a comment, ensuring the right parameters are used (zone is
parameter $3, not $2) and add view and policy parameters to the comment.

Fix the view tests and test the correct view (example3 instead of
example2).

Fix placement of "n=$((n+1)" for two test cases.

(cherry picked from commit ff65f07779)
2022-07-12 17:22:39 +02:00
Artem Boldariev
3d98312a7b Merge branch 'artem-backport-tls-related-fixes-from-loopmgr-branch-v9-18' into 'v9_18'
[Backport to 9.18] Backport TLS-related fixes from the loopmgr-branch

See merge request isc-projects/bind9!6550
2022-07-12 13:13:39 +00:00
Artem Boldariev
814baa3e6b TLS: do not ignore accept callback result
Before this change the TLS code would ignore the accept callback result,
and would not try to gracefully close the connection. This had not been
noticed, as it is not really required for DoH. Now the code tries to
shut down the TLS connection gracefully when accepting it is not
successful.

(cherry picked from commit ffcb54211e)
2022-07-12 15:32:45 +03:00
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