Commit Graph

33178 Commits

Author SHA1 Message Date
Michal Nowak
56cd1f041c Set copyright year to the current year
To ensure that a release with outdated copyright year is not produced at
the beginning of a year, set copyright year to the current year.

(cherry picked from commit 7eb44b05c5)
2021-05-14 14:47:35 +02:00
Ondřej Surý
a822caa3f3 Merge branch 'each-backport-netmgr' into 'v9_16'
Full backport of netmgr/taskmgr to 9.16

See merge request isc-projects/bind9!5018
2021-05-14 11:17:56 +00:00
Evan Hunt
4c9c6a8823 CHANGES, release notes 2021-05-14 12:52:48 +02:00
Ondřej Surý
4d027ab945 Remove TLSDNS, TLS and HTTP protocols from netmgr
For further stabilization of the 9.16 branch, we are removing the unused
protocols from the netmgr.
2021-05-14 12:52:48 +02:00
Ondřej Surý
6a1dba7232 Fix nanosleep and usleep
- Add POSIX nanosleep() and usleep() shim implementation for Windows
  to help implementors use less #ifdef _WIN32 in the code.
- Use uv_sleep when possible in the netmgr code and define usleep based
  shim for libuv << 1.34.0.
2021-05-14 12:52:48 +02:00
Ondřej Surý
6da96c61f8 Fix the outgoing UDP socket selection on Windows
The outgoing UDP socket selection would pick unintialized children
socket on Windows, because we have more netmgr workers than we have
listening sockets.  This commit fixes the selection by keeping the
outgoing socket the same, so it's always run on existing socket.

(cherry picked from commit cd413234f7)
2021-05-14 12:52:48 +02:00
Evan Hunt
e4c9652382 hacks to get dyndb working without libtool
- memory tracing failed if the driver didn't have access
  to the isc_mem_debugging variable.
- remove RTLD_DEEPBIND from dlopen() flags as it causes
  shared libraries to be unable to access thread-local storage,
  which is needed when enqueuing tasks.
2021-05-14 12:52:48 +02:00
Evan Hunt
ef1d909fa9 backport of netmgr/taskmgr to 9.16
this rolls up numerous changes that have been applied to the
main branch, including moving isc_task operations into the
netmgr event loops, and other general stabilization.
2021-05-14 12:52:48 +02:00
Ondřej Surý
d98ad30c0d Merge branch 'ondrej/add-nanosleep-and-usleep-windows-shims-v9_16' into 'v9_16'
Add nanosleep and usleep Windows shims

See merge request isc-projects/bind9!5026
2021-05-14 10:21:36 +00:00
Ondřej Surý
a09822b624 Add nanosleep and usleep Windows shims
This commit adds POSIX nanosleep() and usleep() shim implementation for
Windows to help implementors use less #ifdef _WIN32 in the code.

(cherry picked from commit c37ff5d188)
2021-05-14 12:19:48 +02:00
Ondřej Surý
906cca09dc Merge branch 'ondrej/replace-CreateThreads-with-isc_thread_create-v9_16' into 'v9_16'
Add trampoline around iocompletionport_createthreads()

See merge request isc-projects/bind9!5025
2021-05-14 10:16:00 +00:00
Ondřej Surý
7e8f4b1df6 Add trampoline around iocompletionport_createthreads()
On Windows, the iocompletionport_createthreads() didn't use
isc_thread_create() to create new threads for processing IO, but just a
simple CreateThread() function that completely circumvent the
isc_trampoline mechanism to initialize global isc_tid_v.  This lead to
segmentation fault in isc_hp API because '-1' isn't valid index to the
hazard pointer array.

This commit changes the iocompletionport_createthreads() to use
isc_thread_create() instead of CreateThread() to properly initialize
isc_tid_v.

(cherry picked from commit cd54bbbd9a)
2021-05-14 12:14:23 +02:00
Mark Andrews
5feb6f79b8 Merge branch '2528-check-soa-rdata-v9_16' into 'v9_16'
Check that the first and last SOA of an AXFR are consistent

See merge request isc-projects/bind9!5015
2021-05-13 13:35:48 +00:00
Evan Hunt
6f6ac57cb5 system test
Attempt a zone transfer with mismatched SOA records.

(cherry picked from commit 4d94f82232)
2021-05-13 23:17:06 +10:00
Mark Andrews
eded531bee Add CHANGES entry for [GL #2528]
(cherry picked from commit 7e54d8d2cb)
2021-05-13 16:01:51 +10:00
Mark Andrews
0ec28efe86 Check that the first and last SOA of an AXFR are consistent
(cherry picked from commit e86508708d)
2021-05-13 16:01:27 +10:00
Matthijs Mekking
43dbce7f0b Merge branch '2603-test-dnssec-policy-none-v9_16' into 'v9_16'
dnssec-policy check for duplicate writable file (9.16)

See merge request isc-projects/bind9!5000
2021-05-05 17:12:50 +00:00
Matthijs Mekking
72deed194d Use isdigit instead of checking character range
When looking for key files, we could use isdigit rather than checking
if the character is within the range [0-9].

Use (unsigned char) cast to ensure the value is representable in the
unsigned char type (as suggested by the isdigit manpage).

Change " & 0xff" occurrences to the recommended (unsigned char) type
cast.

(cherry picked from commit 1998ad6c776a9c17c27788b17765dee90d9e25df)
2021-05-05 18:23:53 +02:00
Matthijs Mekking
353161bd3c Changes and release notes for [#2603]
(cherry picked from commit 7663c17f3b3d2b1600a6864bec90bb045763a96a)
2021-05-05 18:23:51 +02:00
Matthijs Mekking
861b2a14bb Check for filename clashes /w dnssec-policy zones
Just like with dynamic and/or inline-signing zones, check if no two
or more zone configurations set the same filename. In these cases,
the zone files are not read-only and named-checkconf should catch
a configuration where multiple zone statements write to the same file.

Add some bad configuration tests where KASP zones reference the same
zone file.

Update the good-kasp test to allow for two zones configure the same
file name, dnssec-policy none.

(cherry picked from commit 0b5fc0afcfd1a0bb7c1f16b63872b7ee26fb2777)
2021-05-05 18:22:42 +02:00
Matthijs Mekking
f42234fef0 Check zonefile is untouched if dnssec-policy none
Make sure no DNSSEC contents are added to the zonefile if dnssec-policy
is set to "none" (and no .state files exist for the zone).

(cherry picked from commit 5246c16f43e6fda7587193a4dd801951cf87db14)
2021-05-05 18:22:32 +02:00
Mark Andrews
9bb1adb347 Merge branch '2670-always-set-rewrite-when-compacting-a-version-1-journal-v9_16' into 'v9_16'
Allow named-journalprint to compact journals at a given serial

See merge request isc-projects/bind9!4999
2021-05-05 13:52:52 +00:00
Mark Andrews
054c2c6490 Add release note for [GL #2670]
(cherry picked from commit a60b54e1df)
2021-05-05 23:36:06 +10:00
Mark Andrews
84dbaad15a Add CHANGES note for [GL #2670]
(cherry picked from commit 79da175a76)
2021-05-05 23:36:06 +10:00
Mark Andrews
966bcfb89d Check journal compaction
(cherry picked from commit ae1ae07b03)
2021-05-05 23:36:06 +10:00
Mark Andrews
c659fed6ad Always perform a re-write when processing a version 1 journal
version 1 journals may have a mix of type 1 and type 2 transaction
headers so always use the recovery code.

(cherry picked from commit 4a8e33b9f0)
2021-05-05 23:36:06 +10:00
Mark Andrews
f10645f21d Allow named-journalprint to compact journals at a given serial
(cherry picked from commit 71df4fb84c)
2021-05-05 23:36:06 +10:00
Matthijs Mekking
d15e4dbc6e Merge branch '2596-dnssec-policy-keys-inaccessiblev9_16' into 'v9_16'
Don't roll keys when private key is offline (9.16)

See merge request isc-projects/bind9!4998
2021-05-05 12:13:17 +00:00
Matthijs Mekking
68bdca4730 No longer need to strcmp for "none"
When we introduced "dnssec-policy insecure" we could have removed the
'strcmp' check for "none", because if it was set to "none", the 'kasp'
variable would have been set to NULL.

(cherry picked from commit 636ff1e15c)
2021-05-05 12:54:05 +02:00
Matthijs Mekking
1d16443fde Changes and release notes for [#2596]
(cherry picked from commit 366ed047dd)
2021-05-05 12:54:05 +02:00
Matthijs Mekking
bc641fc965 Add kasp tests for offline keys
Add a test for default.kasp that if we remove the private key file,
no successor key is created for it. We need to update the kasp script
to deal with a missing private key. If this is the case, skip checks
for private key files.

Add a test with a zone for which the private key of the ZSK is missing.

Add a test with a zone for which the private key of the KSK is missing.

(cherry picked from commit 4a8ad0a77f)
2021-05-05 12:50:07 +02:00
Matthijs Mekking
23b85a4679 Update smart signing when key is offline
BIND 9 is smart about when to sign with what key. If a key is offline,
BIND will delete the old signature anyway if there is another key to
sign the RRset with.

With KASP we don't want to fallback to the KSK if the ZSK is missing,
only for the SOA RRset. If the KSK is missing, but we do have a ZSK,
deleting the signature is fine. Otherwise it depends on if we use KASP
or not. Update the 'delsig_ok' function to reflect that.

(cherry picked from commit 6a60bf637d)
2021-05-05 12:50:00 +02:00
Matthijs Mekking
4e87664fef Don't roll offline keys
When checking the current DNSSEC state against the policy, consider
offline keys. If we didn't found an active key, check if the key is
offline by checking the public key list. If there is a match in the
public key list (the key data is retrieved from the .key and the
.state files), treat the key as offline and don't create a successor
key for it.

(cherry picked from commit 3e6fc49c16)
2021-05-05 12:49:49 +02:00
Matthijs Mekking
ff4930951c rndc dnssec -status should include offline keys
The rndc command 'dnssec -status' only considered keys from
'dns_dnssec_findmatchingkeys' which only includes keys with accessible
private keys. Change it so that offline keys are also listed in the
status.

(cherry picked from commit b3a5859a9b)
2021-05-05 12:49:38 +02:00
Matthijs Mekking
ebb793bfd5 Try to read state when reading keylist from rdata
The function 'dns_dnssec_keylistfromrdataset()' creates a keylist from
the DNSKEY RRset. If we attempt to read the private key, we also store
the key state. However, if the private key is offline, the key state
will not be stored. To fix this, first attempt to read the public key
file. If then reading the private key file fails, and we do have a
public key, add that to the keylist, with appropriate state. If we
also failed to read the public key file, add the DNSKEY to the keylist,
as we did before.

(cherry picked from commit 7ed089576f)
2021-05-05 12:49:30 +02:00
Matthijs Mekking
87e90f27a8 When reading public key from file, also read state
The 'dst_key_fromnamedfile()' function did not read and store the
key state from the .state file when reading a public key file.

(cherry picked from commit fa05c1b8da)
2021-05-05 12:49:22 +02:00
Matthijs Mekking
03e90aa50a Fix a kasp lock issue
The kasp lock would stay locked if 'dns_keymgr_run' failed.

(cherry picked from commit cf17698f87)
2021-05-05 12:49:12 +02:00
Ondřej Surý
4c2c75a806 Merge branch '2671-change-default-for-max-ixfr-ratio-to-unlimited-on-bind-9-16' into 'v9_16'
Change the max-ixfr-ratio default value to unlimited

See merge request isc-projects/bind9!4993
2021-05-05 09:10:34 +00:00
Ondřej Surý
ce5f036cff Add CHANGES and release note for [GL #2671] 2021-05-05 10:24:42 +02:00
Ondřej Surý
8d92112de9 Change the max-ixfr-ratio default value to unlimited
When the feature was backported, we should have leave it disabled by
default, it turns out the default `100%` is producing some unexpected
results (under investigation), so for the time being, we are going to to
disable the max-ixfr-ratio.
2021-05-05 10:24:42 +02:00
Mark Andrews
059358c494 Merge branch '2678-named-checkconf-doesn-t-catch-redefinition-of-dnssec-policy-insecure-v9_16' into 'v9_16'
named-checkconf now detects redefinition of dnssec-policy 'insecure'

See merge request isc-projects/bind9!4995
2021-05-05 07:29:44 +00:00
Mark Andrews
cb77a8efed named-checkconf now detects redefinition of dnssec-policy 'insecure'
(cherry picked from commit dba13d280a)
2021-05-05 17:05:17 +10:00
Michal Nowak
7cc68a9def Merge branch 'mnowak/use-sigabrt-from-start.pl-v9_16' into 'v9_16'
[v9_16] Use SIGABRT instead of SIGKILL to produce cores on failed start

See merge request isc-projects/bind9!4991
2021-05-04 15:54:08 +00:00
Ondřej Surý
82c9e477a1 Use SIGABRT instead of SIGKILL to produce cores on failed start
When the `named` would hang on startup it would be killed with SIGKILL
leaving us with no information about the state the process was in.
This commit changes the start.pl script to send SIGABRT instead, so we
can properly collect and process the coredump from the hung named
process.

(cherry picked from commit 861a236937)
2021-05-04 17:18:45 +02:00
Matthijs Mekking
d627c63f2d Merge branch '2624-kasp-test-failure-job-1630205-v9_16' into 'v9_16'
Fix intermittent kasp test failure

See merge request isc-projects/bind9!4986
2021-05-04 08:59:28 +00:00
Matthijs Mekking
cced7fdaf4 Fix intermittent kasp test failure
The kasp system test performs for each zone a couple of checks to make
sure the zone is signed correctly. To avoid test failures caused by
timing issues, there is first a check to ensure the zone is done
signing, 'wait_for_done_signing'. This function waits with the DNSSEC
checks until a "zone_rekey done" log message is seen for a specific
key.

Unfortunately this is not sufficient to avoid test failures due to
timing issues, because there is a small amount of time in between this
log message and the newly signed zone actually being served.

Therefore, in 'check_apex', retry for three seconds the DNSKEY query
check. After that, additional checks should pass without retries,
because at that point we know for sure the zone has been resigned with
the expected keys.

Also reduce the number of redundant 'check_signatures'

(cherry picked from commit 572f421df4)
2021-05-04 10:25:25 +02:00
Mark Andrews
50a4b15835 Merge branch '2621-pull-request-to-fix-rdnc-addzone-doc-v9_16' into 'v9_16'
Remove spurious $ and \ in addzone example

See merge request isc-projects/bind9!4984
2021-05-04 03:02:45 +00:00
Mark Andrews
18f710c438 Remove spurious $ and \ in addzone example
(cherry picked from commit 205d1bb762)
2021-05-04 12:44:22 +10:00
Matthijs Mekking
733fb98cf4 Merge branch 'matthijs-nsupdate-update_test-v9_16' into 'v9_16'
Update nsupdate test (9.16)

See merge request isc-projects/bind9!4978
2021-04-30 14:28:42 +00:00
Matthijs Mekking
fd01889b8a Update nsupdate test
The nsupdate system test did not record failures from the
'update_test.pl' Perl script. This was because the 'ret' value was
not being saved outside the '{ $PERL ... || ret=1 } cat_i' scope.

Change this piece to store the output in a separate file and then
cat its contents. Now the 'ret' value is being saved.

Also record failures in 'update_test.pl' if sending the update
failed.

Add missing 'n' incrementals to 'nsupdate/test.sh' to keep track of
test numbers.

(cherry picked from commit 5b31811b5f)
2021-04-30 14:28:30 +02:00