Commit graph

33951 commits

Author SHA1 Message Date
Petr Špaček
00aeba54c9 Tweak and reword release notes 2022-01-20 11:37:08 +01:00
Michał Kępień
3d1544726b Merge branch '3080-rndc-catch-canceled-v9_16' into 'v9_16'
rndc: add an extra task reference

See merge request isc-projects/bind9!5740
2022-01-20 08:06:21 +00:00
Evan Hunt
3aa529a9e0 CHANGES for [GL #3080] 2022-01-19 12:01:45 -08:00
Evan Hunt
075722f8a2 rndc: add an extra task reference
adding an extra task before launching the rndc app prevents
a use-after-free when task events fire after the app has been
shut down by a signal.
2022-01-19 11:05:00 -08:00
Ondřej Surý
65314e437f Merge branch 'each-fix-changes-v9_16' into 'v9_16'
fix CHANGES

See merge request isc-projects/bind9!5723
2022-01-17 10:59:39 +00:00
Evan Hunt
e437ef6d6b fix misplaced CHANGES note
Change #5676 was incorrectly placed under 9.16.24 when backporting,
but is actually in 9.16.25.
2022-01-17 11:55:46 +01:00
Ondřej Surý
c7413e9f5d Merge branch 'djt-update-cookie-secret-doc-v9_16' into 'v9_16'
docs: Update ARM to reflect changes to acceptable cookie-secret values

See merge request isc-projects/bind9!5729
2022-01-17 10:53:57 +00:00
Dan Theisen
133b5c1a52 docs: Update ARM to reflect changes to acceptable cookie-secret values
(cherry picked from commit acf1d502d6)
2022-01-17 11:52:13 +01:00
Ondřej Surý
5beaf7638c Merge branch '3093-missing-libuv-code-v9_16' into 'v9_16'
add UV_ENOTSUP to isc___nm_uverr2result()

See merge request isc-projects/bind9!5728
2022-01-17 10:51:31 +00:00
Evan Hunt
464b09a804 add UV_ENOTSUP to isc___nm_uverr2result()
This error code is now mapped to ISC_R_FAMILYNOSUPPORT.

(cherry picked from commit be0bc24c7f)
2022-01-17 11:47:12 +01:00
Ondřej Surý
ea26c36d62 Merge branch 'ondrej/fix-missing-backtick-in-host.rst-v9_16' into 'v9_16'
Add missing backtick to host.rst

See merge request isc-projects/bind9!5725
2022-01-16 07:06:44 +00:00
Ondřej Surý
35aba6f078 Add missing backtick to host.rst
The missing backtick was causing formatting problems in the host
manpage.

(cherry picked from commit aaa31962d2)
2022-01-16 08:02:26 +01:00
Ondřej Surý
c79a35294e Merge branch '3095-invalid-recvmmsg-detection-v9_16' into 'v9_16'
Fix the UDP recvmmsg support

See merge request isc-projects/bind9!5717
2022-01-13 22:26:42 +00:00
Ondřej Surý
4666cb4a4e Add CHANGES and release notes for [GL #3095]
(cherry picked from commit 8d778f758b)
2022-01-13 23:05:38 +01:00
Ondrej Sury
04eeb67d97 Instead of detecting MUSL libc, detect padding in struct msghdr
The detection of MUSL libc via autoconf $host turned out to be
not reliable.

Convert the autoconf check from $host detection to actually detect
the padding used in the struct msghdr.
2022-01-13 23:05:38 +01:00
Ondřej Surý
86f9b16fd7 Revert "Always enqueue isc__nm_tcp_resumeread()"
The commit itself is harmless, but at the same time it is also useless,
so we are reverting it.

This reverts commit 11c869a3d5.

(cherry picked from commit 0a4e91ee47)
2022-01-13 21:39:57 +01:00
Ondrej Sury
de8dbcbfbc Disable udp recvmmsg support on systems with MUSL libc
The Linux kernel diverts from the POSIX specification for two members of
struct msghdr making them size_t sized (instead of int and socklen_t).
In glibc, the developers have decided to use that.  However, the MUSL
developers used padding for the struct and kept the members defined
according to the POSIX.

This creates a problem, because libuv doesn't use recvmmsg() library
call where the padding members are correctly zeroed and instead calls
the syscall directly, the struct msghdr is passed to the kernel with
enormous values in those two members (because of the random junk in the
padding members) and the syscall thus fail with EMSGSIZE.

Disable udp recvmmsg support on systems with MUSL libc until the libuv
starts zeroing the struct msghdr before passing it to the syscall.

(cherry picked from commit 287ea095f1)
2022-01-13 21:39:57 +01:00
Ondřej Surý
5b02f5a8a0 Fix the UDP recvmmsg support
Previously, the netmgr/udp.c tried to detect the recvmmsg detection in
libuv with #ifdef UV_UDP_<foo> preprocessor macros.  However, because
the UV_UDP_<foo> are not preprocessor macros, but enum members, the
detection didn't work.  Because the detection didn't work, the code
didn't have access to the information when we received the final chunk
of the recvmmsg and tried to free the uvbuf every time.  Fortunately,
the isc__nm_free_uvbuf() had a kludge that detected attempt to free in
the middle of the receive buffer, so the code worked.

However, libuv 1.37.0 changed the way the recvmmsg was enabled from
implicit to explicit, and we checked for yet another enum member
presence with preprocessor macro, so in fact libuv recvmmsg support was
never enabled with libuv >= 1.37.0.

This commit changes to the preprocessor macros to autoconf checks for
declaration, so the detection now works again.  On top of that, it's now
possible to cleanup the alloc_cb and free_uvbuf functions because now,
the information whether we can or cannot free the buffer is available to
us.

(cherry picked from commit 7370725008)
2022-01-13 21:38:43 +01:00
Ondřej Surý
570aae5b9b Merge branch 'ondrej/remove-util-copyrights-v9_16' into 'v9_16'
Remove the copyright handling via util/copyrights

See merge request isc-projects/bind9!5709
2022-01-11 12:06:11 +00:00
Ondřej Surý
b62feae347 Remove util/copyrights
(cherry picked from commit e1d2e26360)
2022-01-11 12:22:09 +01:00
Ondřej Surý
2bf7921c7e Update the copyright information in all files in the repository
This commit converts the license handling to adhere to the REUSE
specification.  It specifically:

1. Adds used licnses to LICENSES/ directory

2. Add "isc" template for adding the copyright boilerplate

3. Changes all source files to include copyright and SPDX license
   header, this includes all the C sources, documentation, zone files,
   configuration files.  There are notes in the doc/dev/copyrights file
   on how to add correct headers to the new files.

4. Handle the rest that can't be modified via .reuse/dep5 file.  The
   binary (or otherwise unmodifiable) files could have license places
   next to them in <foo>.license file, but this would lead to cluttered
   repository and most of the files handled in the .reuse/dep5 file are
   system test files.

(cherry picked from commit 58bd26b6cf)
2022-01-11 12:22:09 +01:00
Ondřej Surý
f27df9899b Add reuse lint CI job
Instead of checking for the licenses in the misc step, add a separate
job that uses the upstream provided image that has reuse tool installed
and run `reuse lint` from the separate job.

(cherry picked from commit dbcff56043)
2022-01-11 09:49:00 +01:00
Ondřej Surý
7b532569e3 Remove the copyright handling via util/copyrights
The copyright handling has been long obsolete, the works is covered as
whole by the COPYING/LICENSE file even if a specific file doesn't have
a copyright header.

The important thing to remember here is that any work is covered by a
copyright law and by explicitly giving it license we provide extra
rights to the users of the works.

(cherry picked from commit 09c32a8d75)
2022-01-11 09:48:58 +01:00
Mark Andrews
e38a74a610 Merge branch '3025-document-how-rate-limiting-uses-dns-cookies-v9_16' into 'v9_16'
[v9_16] Document how rate limiting uses DNS cookies

See merge request isc-projects/bind9!5701
2022-01-07 08:49:37 +00:00
Björn Persson
fd1d6b5d1c Document the interation of DNS COOKIE and RRL
Send back BADCOOKIE responses instead of TC=1 when slipping.

Skip rate limiting for UDP requests with valid server cookies.

(cherry picked from commit a59482b85c)
2022-01-07 19:29:26 +11:00
Ondřej Surý
e1d9996222 Merge branch '3079-always-enqueue-isc__nm_tcp_resumeread-v9_16' into 'v9_16'
Always enqueue isc__nm_tcp_resumeread()

See merge request isc-projects/bind9!5699
2022-01-06 19:32:18 +00:00
Ondřej Surý
21b74b8c48 Add CHANGES and release note for [GL #3079]
(cherry picked from commit 5563d06d62)
2022-01-06 20:00:44 +01:00
Ondřej Surý
8590251f5a Always enqueue isc__nm_tcp_resumeread()
The isc__nm_tcp_resumeread() was using maybe_enqueue function to enqueue
netmgr event which could case the read callback to be executed
immediately if there was enough data waiting in the TCP queue.

If such thing would happen, the read callback would be called before the
previous read callback was finished and the worker receive buffer would
be still marked "in use" causing a assertion failure.

This would affect only raw TCP channels, e.g. rndc and http statistics.

(cherry picked from commit 11c869a3d5)
2022-01-06 20:00:44 +01:00
Ondřej Surý
a06707c63e Merge branch 'ondrej/fix-taskmgr-exiting-access-v9_16' into 'v9_16'
On shutdown, return ISC_R_SHUTTINGDOWN from isc_taskmgr_excltask()

See merge request isc-projects/bind9!5698
2022-01-06 17:29:49 +00:00
Ondřej Surý
5be356760d Remove taskmgr->excl_lock, fix the locking for taskmgr->exiting
While doing code review, it was found that the taskmgr->exiting is set
under taskmgr->lock, but accessed under taskmgr->excl_lock in the
isc_task_beginexclusive().

Additionally, before the change that moved running the tasks to the
netmgr, the task_ready() subrouting of isc_task_detach() would lock
mgr->lock, requiring the mgr->excl to be protected mgr->excl_lock
to prevent deadlock in the code.  After !4918 has been merged, this is
no longer true, and we can remove taskmgr->excl_lock and use
taskmgr->lock in its stead.

Solve both issues by removing the taskmgr->excl_lock and exclusively use
taskmgr->lock to protect both taskmgr->excl and taskmgr->exiting which
now doesn't need to be atomic_bool, because it's always accessed from
within the locked section.

(cherry picked from commit e705f213ca)
2022-01-06 17:56:45 +01:00
Ondřej Surý
9ec7d78d16 On shutdown, return ISC_R_SHUTTINGDOWN from isc_taskmgr_excltask()
The isc_taskmgr_excltask() would return ISC_R_NOTFOUND either when the
exclusive task was not set (yet) or when the taskmgr is shutting down
and the exclusive task has been already cleared.

Distinguish between the two states and return ISC_R_SHUTTINGDOWN when
the taskmgr is being shut down instead of ISC_R_NOTFOUND.

(cherry picked from commit f9d90159b8)
2022-01-06 17:56:45 +01:00
Petr Špaček
39a8511084 Merge branch 'vicky-main-patch-33672-v9_16' into 'v9_16'
Update preface.rst of DNSSEC Guide with new contact info for Josh Kuo [v9_16]

See merge request isc-projects/bind9!5697
2022-01-06 15:26:30 +00:00
Vicky Risk
18322cd85b
Update preface.rst of DNSSEC Guide with new contact info for Josh Kuo
(cherry picked from commit 896fa924f3)
2022-01-06 16:20:11 +01:00
Ondřej Surý
ebec9c701a Merge branch '3071-signed-version-of-an-inline-signed-zone-may-be-dumped-without-unsigned-serial-number-fix-v9_16' into 'v9_16'
Check unsigned serial number in signed zone files

See merge request isc-projects/bind9!5693
2022-01-06 11:33:11 +00:00
Ondřej Surý
721c175bf4 Add CHANGES and release note for [GL #3071]
(cherry picked from commit ff8d37cbdb)
2022-01-06 12:27:12 +01:00
Ondřej Surý
4aed6821d7 Revert "Add CHANGES and release note for [GL #3071]"
This reverts commit 7a6365d02875ca1344013ad16ae2d33a51307bec.

(cherry picked from commit 5f36948176)
2022-01-06 12:27:12 +01:00
Michał Kępień
149285168e Do not detach raw zone until dumping is complete
When the signed version of an inline-signed zone is dumped to disk, the
serial number of the unsigned version of the zone is stored in the
raw-format header so that the contents of the signed zone can be
resynchronized after named restart if the unsigned zone file is modified
while named is not running.

In order for the serial number of the unsigned zone to be determined
during the dump, zone->raw must be set to a non-NULL value.  This should
always be the case as long as the signed version of the zone is used for
anything by named.

However, a scenario exists in which the signed version of the zone has
zone->raw set to NULL while it is being dumped:

 1. Zone dump is requested; zone_dump() is invoked.

 2. Another zone dump is already in progress, so the dump gets deferred
    until I/O is available (see zonemgr_getio()).

 3. The last external reference to the zone is released.
    zone_shutdown() gets queued to the zone's task.

 4. I/O becomes available for zone dumping.  zone_gotwritehandle() gets
    queued to the zone's task.

 5. The zone's task runs zone_shutdown().  zone->raw gets set to NULL.

 6. The zone's task runs zone_gotwritehandle().  zone->raw is determined
    to be NULL, causing the serial number of the unsigned version of the
    zone to be omitted from the raw-format dump of the signed zone file.

Note that the naïve solution - deferring the dns_zone_detach() call for
zone->raw until zone_free() gets called for the secure version of the
zone - does not work because it leads to a chicken-and-egg problem when
the inline-signed zone is about to get freed: the raw zone holds a weak
reference to the secure zone and that reference does not get released
until the reference count for the raw zone reaches zero, which in turn
would not happen until all weak references to the secure zone were
released.

Defer detaching from zone->raw in zone_shutdown() if the zone is in the
process of being dumped to disk.  Ensure zone->raw gets detached from
after the dump is finished if detaching gets deferred.  Prevent zone
dumping from being requeued upon failure if the zone is in the process
of being cleaned up as it opens up possibilities for the zone->raw
reference to leak, triggering a shutdown hang.

(cherry picked from commit ef625f5f06)
2022-01-06 12:27:12 +01:00
Ondřej Surý
b8e6dffdbc Revert "Ensure the correct ordering zone_shutdown() vs zone_gotwritehandle()"
This reverts commit cc1d4e1aa6.

(cherry picked from commit 1064b2fc47)
2022-01-06 12:27:12 +01:00
Michał Kępień
1904acc7ef Check unsigned serial number in signed zone files
All signed zone files present in bin/tests/system/inline/ns8 should
contain the unsigned serial number in the raw-format header.  Add a
check to ensure that is the case.  Extend the dnssec-signzone command
line in ns8/sign.sh with the -L option to allow the zones initially
signed there to pass the newly added check.  Add another zone to the
configuration for the ns8 named instance to ensure the check also passes
when multiple zones are inline-signed by a single named instance.

(cherry picked from commit ab49205af3)
2022-01-06 12:27:12 +01:00
Matthijs Mekking
be1efdcf24 Merge branch '3035-dnssec-policy-stops-signing-when-removing-zsk-v9_16' into 'v9_16'
Fix autosign system test, allow expired zone signatures to be replaced with KSK RRSIGs (9.16)

See merge request isc-projects/bind9!5694
2022-01-06 08:58:44 +00:00
Matthijs Mekking
99316385d3 Replace RSASHA1 in autosign test with default alg
Change RSASHA1 to $DEFAULT_ALGORITHM to be FIPS compliant.

There is one RSASHA1 occurence left, to test that dynamically adding an
NSEC3PARAM record to an NSEC-only zone fails.

(cherry picked from commit 6e9fed2d24)
2022-01-06 09:35:53 +01:00
Matthijs Mekking
b002ed569c Add CHANGES and release note for GL #3049
This is a bugfix worth mentioning.

(cherry picked from commit f3e668d630)
2022-01-06 09:35:48 +01:00
Matthijs Mekking
17ae663084 Update autosign test
Update the autosign system test with new expected behavior.

The 'nozsk.example' zone should have its expired zone signatures
deleted and replaced with signatures generated with the KSK.

The 'inaczsk.example' zone should have its expired zone signatures
deleted and replaced with signatures generated with the KSK.

In both scenarios, signatures are deleted, not retained, so the
"retaining signatures" warning should not be logged.

Furthermore, thsi commit fixex a test bug where the 'awk' command
always returned 0.

Finally, this commit adds a test case for an offline KSK, for the zone
'noksk.example'. In this case the expired signatures should be retained
(despite the zone being bogus, but resigning the DNSKEY RRset with the
ZSK won't help here).

(cherry picked from commit fbd559ad0d)
2022-01-06 09:35:42 +01:00
Matthijs Mekking
bdb91e3825 Fix bug introduced by #763 related to offline keys
In some cases we want to keep expired signatures. For example, if the
KSK is offline, we don't want to fall back to signing with the ZSK.
We could remove the signatures, but in any case we end up with a broken
zone.

The change made for GL #763 prevented the behavior to sign the DNSKEY
RRset with the ZSK if the KSK was offline (and signatures were expired).

The change causes the definition of "having both keys": if one key is
offline, we still consider having both keys, so we don't fallback
signing with the ZSK if KSK is offline.

That change also works the other way, if the ZSK is offline, we don't
fallback signing with the KSK.

This commit fixes that, so we only fallback signing zone RRsets with
the KSK, not signing key RRsets with the ZSK.

(cherry picked from commit beeefe35c4)
2022-01-06 09:35:36 +01:00
Matthijs Mekking
8e31f6981a Only warn if we could not delete signature
BIND can log this warning:

    zone example.ch/IN (signed): Key example.ch/ECDSAP256SHA256/56340
      missing or inactive and has no replacement: retaining signatures.

This log can happen when BIND tries to remove signatures because the
are about to expire or to be resigned. These RRsets may be signed with
the KSK if the ZSK files has been removed from disk. When we have
created a new ZSK we can replace the signatures creeated by the KSK
with signatures from the new ZSK.

It complains about the KSK being missing or inactive, but actually it
takes the key id from the RRSIG.

The warning is logged if BIND detects the private ZSK file is missing.

The warning is logged even if we were able to delete the signature.

With the change from this commit it only logs this warning if it is not
okay to delete the signature.

(cherry picked from commit 2d2858841a)
2022-01-06 09:35:29 +01:00
Ondřej Surý
0c2e37a064 Merge branch '3074-catz-excl-task-v9_16' into 'v9_16'
Prevent a shutdown race in catz_create_chg_task()

See merge request isc-projects/bind9!5691
2022-01-05 13:01:15 +00:00
Evan Hunt
e243f68f00 Add CHANGES note for [GL #3074]
(cherry picked from commit 81c09b005b)
2022-01-05 13:37:47 +01:00
Evan Hunt
21b0093440 Prevent a shutdown race in catz_create_chg_task()
If a catz event is scheduled while the task manager was being
shut down, task-exclusive mode is unavailable. This needs to be
handled as an error rather than triggering an assertion.

(cherry picked from commit 973ac1d891)
2022-01-05 13:37:46 +01:00
Matthijs Mekking
221adf3471 Merge branch '3023-auto-dnssec-documentation-bug-v9_16' into 'v9_16'
Update auto-dnssec documentation

See merge request isc-projects/bind9!5689
2022-01-05 11:24:37 +00:00
Matthijs Mekking
ec483977e4 Add CHANGES for #3023
(cherry picked from commit 447fa2a816)
2022-01-05 11:57:14 +01:00