Commit Graph

33974 Commits

Author SHA1 Message Date
Aram Sargsyan
b5735ec37a Fix invalid control port number in the catz system test
When failure is expected, the `rndc` command in the catz system test
is being called directly instead of using a function, i.e.:

    $RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reconfig \
        > /dev/null 2>&1 && ret=1

... instead of:

    rndccmd 10.53.0.2 reconfig && ret=1

This is done to suppress messages like "lt-rndc: 'reconfig' failed:
failure" appearing in the message log of the test, because failure
is actually expected, and the appearance of that message can be
confusing.

The port value used in this case is not correct, making the
`rndc reload` command to fail.  This error was not detected earlier
only because the failure of the command is actually expected, but
the failure happens for a "wrong" reason, and the test still passes.

Fix the error by using the existing variable instead of the fixed
number.

(cherry picked from commit 5f9d4b5db4)
2022-01-26 08:19:02 +00:00
Aram Sargsyan
094e416fff Add a system test for view reverting after a failed reconfiguration
Test the view reverting code by introducing a faulty dlz configuration
in named.conf and using `rndc reconfig` to check if named handles the
situation correctly.

We use "dlz" because the dlz processing code is located in an ideal
place in the view configuration function for the test to cover the
view reverting code.

This test is specifically added to the catz system test to additionally
cover the catz reconfiguration during the mentioned failed
reconfiguration attempt.

(cherry picked from commit 62337d433f)
2022-01-26 08:19:02 +00:00
Aram Sargsyan
acc774e4dd Add CHANGES and release notes for [GL #3060]
(cherry picked from commit d7dfa2dc4b)
2022-01-26 08:19:02 +00:00
Aram Sargsyan
a663216c0e Improve the zones' view reverting logic when a zone is a catalog zone
When a zone is being configured with a new view, the catalog zones
structure will also be linked to that view. Later on, in case of some
error, should the zone be reverted to the previous view, the link
between the catalog zones structure and the view won't be reverted.

Change the dns_zone_setviewrevert() function so it calls
dns_zone_catz_enable() during a zone revert, which will reset the
link between `catzs` and view.

(cherry picked from commit 2fd967136a)
2022-01-26 08:19:02 +00:00
Aram Sargsyan
885e44650b Separate the locked parts of dns_zone_catz_enable/disable functions
Separate the locked parts of dns_zone_catz_enable() and
dns_zone_catz_disable() functions into static functions.  This will
let us perform those tasks from the other parts of the module while
the zone is locked, avoiding one pair of additional unlocking and
locking operations.

(cherry picked from commit 6b937ed5f6)
2022-01-26 08:19:02 +00:00
Aram Sargsyan
f555f1d2eb Improve the view configuration error handling and reverting logic
If a view configuration error occurs during a named reconfiguration
procedure, BIND can end up having twin views (old and new), with some
zones and internal structures attached to the old one, and others
attached to the new one, which essentially creates chaos.

Implement some additional view reverting mechanisms to avoid the
situation described above:

 1. Revert rpz configuration.

 2. Revert catz configuration.

 3. Revert zones to view attachments.

(cherry picked from commit 3697560f04)
2022-01-26 08:19:02 +00:00
Evan Hunt
8e9e2d7608 Merge branch '3111-fix-dlz-pthreads' into 'v9_16'
restore missing lines in dlz_pthread.h

See merge request isc-projects/bind9!5757
2022-01-26 05:09:10 +00:00
Evan Hunt
5996c73516 restore missing lines in dlz_pthread.h
some lines were accidentally deleted during a backport that
made it imposisble to build DLZ modules.
2022-01-25 12:28:48 -08:00
Petr Špaček
7b50984350 Merge branch 'pspacek/fix-historical-relnotes' into 'v9_16'
[v9_16] Fix historical release notes

See merge request isc-projects/bind9!5722
2022-01-24 16:39:22 +00:00
Petr Špaček
675f6c6b57 Remove reference to (unavailable) nsdname-wait-recurse option from ARM
This option is available only in 9.16-S edition, but docs for it were
accidentally imported when documentation was migrated to Sphinx in
!3536.
2022-01-24 17:34:53 +01:00
Petr Špaček
ea4a90a96a Fix inconsistent release note for #1807
This was an omission in !3495.
2022-01-24 17:34:53 +01:00
Petr Špaček
c3a1287e1f Add missing release notes for CVE-2020-8616 and CVE-2020-8617
These release notes were lost when converting docs from XML to RST
formats. These two notes were removed by commit
5a855f6754.

Related: #1388, #1703, !3536
2022-01-24 17:34:48 +01:00
Ondřej Surý
5656609879 Merge branch 'ondrej/use-utc-for-reproducible-builds-v9_16' into 'v9_16'
Use UTC datetime for reproducible builds

See merge request isc-projects/bind9!5751
2022-01-24 15:35:09 +00:00
Ondřej Surý
7df5065c75 Use UTC datetime for reproducible builds
For reproducible builds, we use last modification time of the CHANGES
file.  This works pretty well, unless the builds are made in different
timezones.

Use UTC option to date command to make the builds reproducible.
2022-01-24 16:24:36 +01:00
Petr Špaček
c4769937a5 Merge branch 'pspacek/remove-duplicate-named.conf.rst-v9_16' into 'v9_16'
Remove duplicate named.conf.rst file [v9_16]

See merge request isc-projects/bind9!5746
2022-01-21 14:43:21 +00:00
Petr Špaček
da70d59f40 Remove duplicate named.conf.rst file
As far as I can tell, it is some leftover from the times when Sphinx
docs were introduced (commit 9fb6d11abb).
It seems like it is not referenced from anywhere.

(cherry picked from commit 0a5c2c23bb)
2022-01-21 15:33:40 +01:00
Michał Kępień
fbb824c167 Merge branch 'v9_16_25-release' into 'v9_16'
Merge 9.16.25 release branch

See merge request isc-projects/bind9!5742
2022-01-20 10:43:21 +00:00
Michał Kępień
5111a76eb0 Prepare release notes for BIND 9.16.26 2022-01-20 11:38:18 +01:00
Tinderbox User
f4cdb2448c Merge branch 'prep-release' into v9_16_25-release 2022-01-20 11:37:08 +01:00
Michał Kępień
4a2f91272c Merge branch 'pspacek/prepare-documentation-for-bind-9.16.25' into 'v9_16_25-release'
Prepare documentation for BIND 9.16.25

See merge request isc-private/bind9!343
2022-01-20 11:37:08 +01:00
Tinderbox User
4e0d55cdcd prep 9.16.25 2022-01-20 11:37:08 +01:00
Michał Kępień
9987ff1edf Prepare release notes for BIND 9.16.25 2022-01-20 11:37:08 +01:00
Michał Kępień
c5f7ece3ad Reorder release notes 2022-01-20 11:37:08 +01:00
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