Commit Graph

34220 Commits

Author SHA1 Message Date
Michał Kępień
d559c8ac0c Reorder release notes 2022-04-11 17:05:07 +02:00
Michał Kępień
ab0923a9ce Tweak and reword release notes 2022-04-11 17:05:07 +02:00
Michał Kępień
1c35cb1aa0 Merge branch 'michal/fix-forward-system-test-requirements-v9_16' into 'v9_16'
[v9_16] Fix "forward" system test requirements

See merge request isc-projects/bind9!6112
2022-04-11 13:33:16 +00:00
Michał Kępień
55f2457526 Fix "forward" system test requirements
Commit 59d1eb3ff8 added a Python-based
name server (bin/tests/system/forward/ans11/ans.py) to the "forward"
system test, but did not update the bin/tests/system/forward/prereq.sh
script to ensure Python is present in the test environment before the
"forward" system test is run.  Update bin/tests/system/forward/prereq.sh
to enforce that requirement.
2022-04-11 14:40:20 +02:00
Petr Špaček
7ee090be53 Merge branch '2950-cache-acceptance-rules-test-v9_16' into 'v9_16'
[CVE-2021-25220] Add tests for forwarder cache poisoning scenarios [v9_16]

See merge request isc-projects/bind9!6106
2022-04-08 08:13:15 +00:00
Mark Andrews
59d1eb3ff8 Add tests for forwarder cache poisoning scenarios
- Check that an NS in an authority section returned from a forwarder
  which is above the name in a configured "forward first" or "forward
  only" zone (i.e., net/NS in a response from a forwarder configured for
  local.net) is not cached.
- Test that a DNAME for a parent domain will not be cached when sent
  in a response from a forwarder configured to answer for a child.
- Check that glue is rejected if its name falls below that of zone
  configured locally.
- Check that an extra out-of-bailiwick data in the answer section is
  not cached (this was already working correctly, but was not explicitly
  tested before).

(cherry picked from commit bf3fffff67)
2022-04-08 10:12:24 +02:00
Michal Nowak
cc0954631d Merge branch '3112-test-lingering-tcp-sockets-in-closewait-v9_16' into 'v9_16'
[v9_16] Add system test lingering CLOSE_WAIT TCP sockets

See merge request isc-projects/bind9!6104
2022-04-08 08:03:14 +00:00
Ondřej Surý
260e0ceaf5 Add system test **/named.* modifier files to .reuse/dep5
There's couple of files that modify behaviour of named when started via
bin/tests/system/start.pl.  Add those files as CC-1.0 to .reuse/dep5 as
they are just empty placeholders.

(cherry picked from commit b6eb31a0e3)
2022-04-08 09:36:08 +02:00
Matthijs Mekking
a8313a6c3c Add system test lingering CLOSE_WAIT TCP sockets
Add a test case to check for lingering TCP sockets stuck in the
CLOSE_WAIT state. This can happen if a client sends some garbage after
its first query.

The system test runs the reproducer script and then sends another TCP
query to the resolver. The resolver is configured to allow one TCP
client only. If BIND has its TCP socket stuck in CLOSE_WAIT, it does
not have the resources available to answer the second query.

Note: A better test would be to check if the named daemon does not
have a TCP socket stuck in CLOSE_WAIT for example with netstat. When
running this test locally you can examine named with netstat manually.
But since netstat is platform specific it is not a good candidate to do
this as a system test.

If you, if you could return, don't let it burn.
Do you have to let it linger?
- Cranberries

(cherry picked from commit b9ebde705b)
2022-04-08 09:36:08 +02:00
Petr Špaček
237d88fe22 Allow py.test system test to skip itself
Enable use of shortcuts like pytest.importorskip and other tricks
which can cause test to skip itself.

(cherry picked from commit b8829c801f)

In addition to b8829c801f,
"R:$systest:SKIPPED" is not being printed when pytests are skipped
because that leads to two `R:` lines - SKIPPED and PASS/FAIL which is
determined later based on other conditions (core files identified,
assertion failures, shell test result, ...) - which is wrong and
testsummary.sh rightfully stumbles on it:

    I:Found 106 test results, but 105 tests were run
2022-04-08 09:20:55 +02:00
Petr Špaček
7cffcce36f Merge branch 'pspacek/manpage-hyperlinks-v9_16' into 'v9_16'
Backport helpers for hyperlinks in manual pages [v9_16]

See merge request isc-projects/bind9!6086
2022-04-07 14:14:07 +00:00
Petr Špaček
148f6f20e7 Ignore :option: references in rst files to to simplify doc backports
Override Sphinx built-in :option: to act and render as `` literal.
This avoids problems with undefined :option:`target`s when merging
doc backports.
2022-04-07 15:46:55 +02:00
Petr Špaček
c9a512247d Introduce new Sphinx role iscman for ISC manual pages
The new directive and role "iscman" allow to tag & reference man pages in
our source tree. Essentially it is just namespacing for ISC man pages,
but it comes with couple benefits.

Differences from .. _man_program label we formerly used:
- Does not expand :ref:`man_program` into full text of the page header.
- Generates index entry with category "manual page".
- Rendering style is closer to ubiquitous to the one produced
  by ``named`` syntax.

Differences from Sphinx built-in :manpage: role:
- Supports all builders with support for cross-references.
- Generates internal links (unlike :manpage: which generates external
  URLs).
- Checks that target exists withing our source tree.

(cherry-picked from commit 7e7a946d44)
2022-04-07 15:46:52 +02:00
Michał Kępień
ecc6ec0754 Merge branch '3208-add-CHANGES-entry-v9_16' into 'v9_16'
[v9_16] Add CHANGES entry for GL #3208

See merge request isc-projects/bind9!6101
2022-04-07 13:08:10 +00:00
Michał Kępień
197e8989c9 Add CHANGES entry for GL #3208
(cherry picked from commit 059a602551)
2022-04-07 15:04:51 +02:00
Ondřej Surý
47eaecf69f Merge branch '3249-rename-configuration-option-to-reuseport-v9_16' into 'v9_16'
Rename the configuration option to load balance sockets to reuseport [v9.16]

See merge request isc-projects/bind9!6095
2022-04-06 16:07:52 +00:00
Ondřej Surý
a7f893e836 Rename the configuration option to load balance sockets to reuseport
After some back and forth, it was decidede to match the configuration
option with unbound ("so-reuseport"), PowerDNS ("reuseport") and/or
nginx ("reuseport").

(cherry picked from commit 7e71c4d0cc)
2022-04-06 17:51:12 +02:00
Ondřej Surý
f943504b03 Merge branch '3190-offload-rpz-updates-revert-v9_16' into 'v9_16'
Revert "Run the RPZ update as offloaded work" [v9.16]

See merge request isc-projects/bind9!6092
2022-04-06 11:43:57 +00:00
Ondřej Surý
daa7d6d6db Revert "General cleanup of dns_rpz implementation"
This reverts commit 84e62cece5.
2022-04-06 10:41:49 +02:00
Ondřej Surý
f5fbe2c26f Revert "Refactor the dns_rpz_add/delete to use local rpz copy"
This reverts commit 635147d01a.
2022-04-06 10:41:39 +02:00
Ondřej Surý
b68ccdc48e Revert "Run the RPZ update as offloaded work"
This reverts commit 73a0bb8588.
2022-04-06 10:31:23 +02:00
Ondřej Surý
be936a10b0 Revert "Add CHANGES and release note for [GL #3190]"
This reverts commit 639e0600f0.
2022-04-06 10:31:21 +02:00
Ondřej Surý
d346d188ae Merge branch '3249-fix-windows-sockets-v9_16' into 'v9_16'
Fix the Windows code paths modified for load balanced sockets

See merge request isc-projects/bind9!6083
2022-04-05 14:35:22 +00:00
Ondřej Surý
d836f23f79 Fix the Windows paths modified for load balanced sockets
When backporting the load balanced sockets to BIND 9.16, the Windows
specific paths were missed.  Add the #if(n)def _WIN32 back into the
appropriate places.
2022-04-05 11:53:18 +02:00
Ondřej Surý
93d61ae5d2 Merge branch '3249-add-configuration-option-to-disable-SO_REUSEPORT_LB-fix-v9_16' into 'v9_16'
Enable the load-balance-sockets configuration [v9.16]

See merge request isc-projects/bind9!6079
2022-04-05 00:35:17 +00:00
Ondřej Surý
5f27873d01 Rename shutdown() to test_shutdown() in timer_test.c
The shutdown() is part of standard library (POSIX-1), don't use such
name in the timer_test.c, but rather rename it to test_shutdown().
2022-04-05 02:17:47 +02:00
Ondřej Surý
9159837315 Enable the load-balance-sockets configuration
Previously, HAVE_SO_REUSEPORT_LB has been defined only in the private
netmgr-int.h header file, making the configuration of load balanced
sockets inoperable.

Move the missing HAVE_SO_REUSEPORT_LB define the isc/netmgr.h and add
missing isc_nm_getloadbalancesockets() implementation.

(cherry picked from commit 142c63dda8)
2022-04-05 02:17:47 +02:00
Ondřej Surý
8f16a25522 Merge branch '3249-add-configuration-option-to-disable-SO_REUSEPORT_LB-v9_16' into 'v9_16'
Add option to configure load balance sockets [v9.16]

See merge request isc-projects/bind9!6075
2022-04-04 23:52:46 +00:00
Ondřej Surý
4026c3559b Add CHANGES and release note for [GL #3249]
(cherry picked from commit 855f49cfba)
2022-04-05 01:21:50 +02:00
Ondřej Surý
8993ebc01a Add option to configure load balance sockets
Previously, the option to enable kernel load balancing of the sockets
was always enabled when supported by the operating system (SO_REUSEPORT
on Linux and SO_REUSEPORT_LB on FreeBSD).

It was reported that in scenarios where the networking threads are also
responsible for processing long-running tasks (like RPZ processing, CATZ
processing or large zone transfers), this could lead to intermitten
brownouts for some clients, because the thread assigned by the operating
system might be busy.  In such scenarious, the overall performance would
be better served by threads competing over the sockets because the idle
threads can pick up the incoming traffic.

Add new configuration option (`load-balance-sockets`) to allow enabling
or disabling the load balancing of the sockets.

(cherry picked from commit 85c6e797aa)
2022-04-05 01:21:50 +02:00
Ondřej Surý
cd9dd70594 Merge branch '3190-offload-rpz-updates-v9_16' into 'v9_16'
Run the RPZ update as offloaded work [v9.16]

See merge request isc-projects/bind9!6074
2022-04-04 22:53:55 +00:00
Ondřej Surý
639e0600f0 Add CHANGES and release note for [GL #3190]
(cherry picked from commit 23a4559b34)
(cherry picked from commit f3ae14d8c3)
2022-04-05 00:30:39 +02:00
Ondřej Surý
73a0bb8588 Run the RPZ update as offloaded work
Previously, the RPZ updates ran quantized on the main nm_worker loops.
As the quantum was set to 1024, this might lead to service
interruptions when large RPZ update was processed.

Change the RPZ update process to run as the offloaded work.  The update
and cleanup loops were refactored to do as little locking of the
maintenance lock as possible for the shortest periods of time and the db
iterator is being paused for every iteration, so we don't hold the rbtdb
tree lock for prolonged periods of time.

(cherry picked from commit f106d0ed2b)
(cherry picked from commit e128b6a951)
2022-04-05 00:30:39 +02:00
Ondřej Surý
635147d01a Refactor the dns_rpz_add/delete to use local rpz copy
Previously dns_rpz_add() were passed dns_rpz_zones_t and index to .zones
array.  Because we actually attach to dns_rpz_zone_t, we should be using
the local pointer instead of passing the index and "finding" the
dns_rpz_zone_t again.

Additionally, dns_rpz_add() and dns_rpz_delete() were used only inside
rpz.c, so make them static.

(cherry picked from commit b6e885c97f)
(cherry picked from commit f4cba0784e)
2022-04-05 00:30:39 +02:00
Ondřej Surý
84e62cece5 General cleanup of dns_rpz implementation
Do a general cleanup of lib/dns/rpz.c style:

 * Removed deprecated and unused functions
 * Unified dns_rpz_zone_t naming to rpz
 * Unified dns_rpz_zones_t naming to rpzs
 * Add and use rpz_attach() and rpz_attach_rpzs() functions
 * Shuffled variables to be more local (cppcheck cleanup)

(cherry picked from commit 840179a247)
(cherry picked from commit bfee462403)
2022-04-05 00:02:35 +02:00
Tony Finch
ae34c574bb Merge branch 'fanf/macos-ifconfig-v9_16' into 'v9_16'
MacOS needs more IP addresses to run the system tests (backport to 9.16)

See merge request isc-projects/bind9!6070
2022-04-04 14:29:21 +00:00
Tony Finch
3f4a63332a MacOS needs more IP addresses to run the system tests
The launchd script only counted up to 8 whereas ifconfig.sh went all
the way up to 10, and even a bit further than that.

(cherry picked from commit 29a3e77425)
2022-04-04 15:08:45 +01:00
Mark Andrews
e9ff292be3 Merge branch '3191-issue-45178-in-oss-fuzz-bind9-dns_master_load_fuzzer-integer-overflow-in-generate-v9_16' into 'v9_16'
Prevent arithmetic overflow of 'i' in master.c:generate

See merge request isc-projects/bind9!6056
2022-04-01 22:24:11 +00:00
Evan Hunt
975a3da84e add a system test for $GENERATE with an integer overflow
the line "$GENERATE 19-28/2147483645 $ CNAME x" should generate
a single CNAME with the owner "19.example.com", but prior to the
overflow bug it generated several CNAMEs, half of them with large
negative values.

we now test for the bugfix by using "named-checkzone -D" and
grepping for a single CNAME in the output.

(cherry picked from commit bd814b79d4)
2022-04-01 21:47:24 +11:00
Evan Hunt
fc7ed00d70 update shell syntax
clean up the shell syntax in the checkzone test prior to adding
a new test.

(cherry picked from commit 2261c853b5)
2022-04-01 21:46:33 +11:00
Mark Andrews
f06c446ae8 Add test case for issue-45178
(cherry picked from commit 9039aad0f8)
2022-04-01 21:42:53 +11:00
Mark Andrews
c284112bec Prevent arithmetic overflow of 'i' in master.c:generate
the value of 'i' in generate could overflow when adding 'step' to
it in the 'for' loop.  Use an unsigned int for 'i' which will give
an additional bit and prevent the overflow.  The inputs are both
less than 2^31 and and the result will be less than 2^32-1.

(cherry picked from commit 5abdee9004)
2022-04-01 21:42:53 +11:00
Tony Finch
6cb79ead4c Merge branch '3209-notauth-subdomain-v9_16' into 'v9_16'
Log "not authoritative for update zone" more clearly (v9.16)

See merge request isc-projects/bind9!6048
2022-03-30 13:24:49 +00:00
Tony Finch
a5d65815bc Log "not authoritative for update zone" more clearly
Ensure the update zone name is mentioned in the NOTAUTH error message
in the server log, so that it is easier to track down problematic
update clients. There are two cases: either the update zone is
unrelated to any of the server's zones (previously no zone was
mentioned); or the update zone is a subdomain of one or more of the
server's zones (previously the name of the irrelevant parent zone was
misleadingly logged).

Closes #3209

(cherry picked from commit 84c4eb02e7)
2022-03-30 13:24:56 +01:00
Ondřej Surý
78971e9a57 Merge branch 'ondrej/cleanup-unreachable-calls-v9_16' into 'v9_16'
Consistenly use UNREACHABLE() instead of ISC_UNREACHABLE()

See merge request isc-projects/bind9!6044
2022-03-28 22:16:38 +00:00
Ondřej Surý
79b7804ce8 Consistenly use UNREACHABLE() instead of ISC_UNREACHABLE()
In couple places, we have missed INSIST(0) or ISC_UNREACHABLE()
replacement on some branches with UNREACHABLE().  Replace all
ISC_UNREACHABLE() or INSIST(0) calls with UNREACHABLE().
2022-03-28 23:28:05 +02:00
Ondřej Surý
3512e4985a Merge branch 'ondrej/dont-use-__builtin_unreachable-on-win32-v9_16' into 'v9_16'
Add win32 __builtin_unreachable() shim

See merge request isc-projects/bind9!6039
2022-03-28 21:22:23 +00:00
Ondřej Surý
4d1d91d709 Add win32 __builtin_unreachable() shim
The backport of using modern compiler features broken Windows debug
build because there's no __builtin_unreachable() in MSVC.

Define __builtin_unreachable() shim on MSVC using __assume(0).
2022-03-28 12:57:42 +02:00
Ondřej Surý
626c17af72 Merge branch '3210-dns64-errors-v9_16' into 'v9_16'
More explicit dns64 prefix errors [v9.16]

See merge request isc-projects/bind9!6031
2022-03-25 15:48:20 +00:00
Tony Finch
b000f5a7c1 Add CHANGES note for [GL #3210]
(cherry picked from commit 132f30b623)
2022-03-25 16:09:34 +01:00