Commit graph

35012 commits

Author SHA1 Message Date
Mark Andrews
2a9300a3bc Don't perform arithmetic on NULL pointers
When node is NULL when calling getparent() et al. they return NULL
but performing arithmetic on the NULL pointer is undefined.  Check
if 'node' or 'header' is NULL and skip the adjustment.
2023-01-10 17:45:51 +11:00
Matthijs Mekking
802f700d5a Merge branch '3678-serve-stale-servfailing-unexpectedly-v9_16' into 'v9_16'
[9.16] Add serve-stale CNAME check with stale-answer-client-timeout off

See merge request isc-projects/bind9!7311
2023-01-09 13:31:24 +00:00
Michał Kępień
ba1306bfb4 Check for NULL before dereferencing qctx->rpz_st
Commit 9ffb4a7ba1 causes Clang Static
Analyzer to flag a potential NULL dereference in query_nxdomain():

    query.c:9394:26: warning: Dereference of null pointer [core.NullDereference]
            if (!qctx->nxrewrite || qctx->rpz_st->m.rpz->addsoa) {
                                    ^~~~~~~~~~~~~~~~~~~
    1 warning generated.

The warning above is for qctx->rpz_st potentially being a NULL pointer
when query_nxdomain() is called from query_resume().  This is a false
positive because none of the database lookup result codes currently
causing query_nxdomain() to be called (DNS_R_EMPTYWILD, DNS_R_NXDOMAIN)
can be returned by a database lookup following a recursive resolution
attempt.  Add a NULL check nevertheless in order to future-proof the
code and silence Clang Static Analyzer.

(cherry picked from commit 07592d1315)
(cherry picked from commit a4547a1093)
2023-01-09 13:57:44 +01:00
Aram Sargsyan
36a439b91e Add a CHANGES note for [GL #3678]
(cherry picked from commit 40dee61a1e)
2023-01-09 13:57:44 +01:00
Matthijs Mekking
2696267b1f Consider non-stale data when in serve-stale mode
With 'stale-answer-enable yes;' and 'stale-answer-client-timeout off;',
consider the following situation:

A CNAME record and its target record are in the cache, then the CNAME
record expires, but the target record is still valid.

When a new query for the CNAME record arrives, and the query fails,
the stale record is used, and then the query "restarts" to follow
the CNAME target. The problem is that the query's multiple stale
options (like DNS_DBFIND_STALEOK) are not reset, so 'query_lookup()'
treats the restarted query as a lookup following a failed lookup,
and returns a SERVFAIL answer when there is no stale data found in the
cache, even if there is valid non-stale data there available.

With this change, query_lookup() now considers non-stale data in the
cache in the first place, and returns it if it is available.

(cherry picked from commit 91a1a8efc5)
2023-01-09 13:57:43 +01:00
Aram Sargsyan
869abb768b Add serve-stale CNAME check with stale-answer-client-timeout off
Prime the cache with the following records:

    shortttl.cname.example.	1	IN	CNAME	longttl.target.example.
    longttl.target.example.	600	IN	A	10.53.0.2

Wait for the CNAME record to expire, disable the authoritative server,
and query 'shortttl.cname.example' again, expecting a stale answer.

(cherry picked from commit 537187bf2f)
2023-01-09 13:57:43 +01:00
Tony Finch
d14a22b3d9 Merge branch '3745-delzone-catz-v9_16' into 'v9_16'
[9.16] Don't crash when rndc delzone encounters a catz member

See merge request isc-projects/bind9!7298
2023-01-04 19:32:40 +00:00
Tony Finch
01788b8852 Don't crash when rndc delzone encounters a catz member
Try to remove the zone from the NZF config only if it was
dynamically added but not by a catalog zone.

(cherry picked from commit 9fa20d6f6c)
2023-01-04 18:04:53 +00:00
Michał Kępień
e255032a67 Merge branch 'michal/update-copyright-year-to-2023-v9_16' into 'v9_16'
[9.16] Update copyright year to 2023

See merge request isc-projects/bind9!7284
2023-01-02 13:30:04 +00:00
Michał Kępień
f7bd3bd2b6 Update copyright year to 2023
(cherry picked from commit 1a5d707f52)
2023-01-02 14:24:23 +01:00
Tom Krizek
9d18a5b496 Merge branch 'tkrizek/default-alg-9.16-fixes' into 'v9_16'
[9.16] Skip test algorithm randomization in certain cases

See merge request isc-projects/bind9!7268
2022-12-23 12:07:38 +00:00
Tom Krizek
28b6171424
Don't check algorithm support during configure step
The 9.16 version of ./configure calls bin/tests/system/cleanall.sh
unless --without-make-clean is used. The cleanall.sh script then
includes bin/tests/system/conf.sh, which includes
bin/tests/system/conf.sh.common. At that point, dnssec-keygen which is
used to detect algorithm support isn't compiled, so it can't be used.

More importantly, algorithm selection for system tests during the
./configure phase is irrelevant, so it can be safely skipped.
2022-12-23 12:37:48 +01:00
Tom Krizek
6950dfe003
Disable test algorithm randomization if Python is missing
This change is motivated by the fact that our Windows CI image doesn't
have a Python interpreter.
2022-12-23 12:37:46 +01:00
Tom Krizek
9e895462d1 Merge branch 'tkrizek/dangerfile-backport-tweaks-v9_16' into 'v9_16'
[9.16] danger CI: tweak backport check and add Affects label check

See merge request isc-projects/bind9!7271
2022-12-23 08:58:39 +00:00
Tom Krizek
122c3f00e9
danger: check the Affects labels are set
Unless the MR is a backport, the Affects labels should be used to
indicate which versions are affected by the issue that prompted the MR.

(cherry picked from commit 64d71a1f5f)
2022-12-23 09:53:34 +01:00
Tom Krizek
413e94f2ca
danger: check version in MR title
Enforce the version indicator to be at the start of the MR title.

(cherry picked from commit d1172e011c)
2022-12-23 09:53:31 +01:00
Tom Krizek
fe08c7aa81 Merge branch 'tkrizek/default-alg-fixups-v9_16' into 'v9_16'
[9.16] Fix minor issues with DEFAULT_ALGORITHM selection in system tests

See merge request isc-projects/bind9!7267
2022-12-22 15:20:38 +00:00
Tom Krizek
527c69e2c9
Make Perl interpreter required for system tests
This change has no practical impact, as Perl was already required for
all system tests, this check only makes it more explicit.

(cherry picked from commit 084d72d1d5)

conf.sh.win32 was modified in addition of the mentioned commit.
2022-12-22 15:54:19 +01:00
Tom Krizek
2b93b47c32
Ensure test interpreters are defined before common config
Nothing from conf.sh.common is required to set these values. On the
contrary, a Python interpreter needs to be set in order to randomize the
algorithm set (which happens in conf.sh.common).

(cherry picked from commit 492992dca8)

conf.sh.win32 was modified in addition of the above mentioned commit.
2022-12-22 15:54:19 +01:00
Tom Krizek
4b32c5608a
Force quiet mode when using testcrypto.sh directly
When testcrypto.sh is used as a standalone script, always use quiet mode
to avoid using undefined commands (such as echo_i) which require
inclusion of the entire conf.sh machinery.

(cherry picked from commit ba35a6df9c)
2022-12-22 15:54:17 +01:00
Tom Krizek
d9471c5f3c Merge branch '3503-random-default-algorithm-in-tests2-v9_16' into 'v9_16'
[9.16] Random selection of DEFAULT_ALGORITHM in system tests at runtime

See merge request isc-projects/bind9!7265
2022-12-22 14:54:01 +00:00
Tom Krizek
0eb789efba
ci: disable algorithm support checking in softhsm
The algorithm support detection script doesn't seem to work when using
the SoftHSM module. For some reason, dnssec-keygen returns 'crypto
failure'. Since the tests themselves pass, this is likely to be some
bug/definiency in the test scripts that check algorithm support that get
confused by SoftHSM.

Since this issue only happens for the system:gcc:softhsm2.6 job in the
9.16 branch, use a workaround to not introduce this new feature for
this particular problematic job.
2022-12-22 15:17:41 +01:00
Tom Krizek
7324a7b5e4
Randomize algorithm selection for mkeys test
Use the ALGORITHM_SET option to use randomly selected default algorithm
in this test. Make sure the test works by using variables instead of
hard-coding values.

(cherry picked from commit f65f276f98)
2022-12-22 15:17:41 +01:00
Tom Krizek
aa5453f5e5
Set algorithms for system tests at runtime
Use the get_algorithms.py script to detect supported algorithms and
select random algorithms to use for the tests.

Make sure to load common.conf.sh after KEYGEN env var is exported.

(cherry picked from commit 69b608ee9f)
2022-12-22 15:17:41 +01:00
Tom Krizek
34497e2350
Script for random algorithm selection in system tests
Multiple algorithm sets can be defined in this script. These can be
selected via the ALGORITHM_SET environment variable. For compatibility
reasons, "stable" set contains the currently used algorithms, since our
system tests need some changes before being compatible with randomly
selected algorithms.

The script operation is similar to the get_ports.py - environment
variables are created and then printed out as `export NAME=VALUE`
commands, to be interpreted by shell. Once we support pytest runner for
system tests, this should be a fixture instead.

(cherry picked from commit 5f480c8485)
2022-12-22 15:17:41 +01:00
Tom Krizek
d45aa7581e
Export env variables in system tests
Certain variables have to be exported in order for the system tests to
work. It makes little sense to export the variables in one place/script
while they're defined in another place.

Since it makes no harm, export all the variables to make the behaviour
more predictable and consistent. Previously, some variables were
exported as environment variables, while others were just shell
variables which could be used once the configuration was sourced from
another script. However, they wouldn't be exposed to spawned processes.

For simplicity sake (and for the upcoming effort to run system tests
with pytest), export all variables that are used. TESTS, PARALLEL_UNIX
and SUBDIRS variables are automake-specific, aren't used anywhere else
and thus not exported.

(cherry picked from commit 37d14c69c0)

conf.sh.win32 was modified in addition of the above mentioned commit.
2022-12-22 15:17:41 +01:00
Tom Krizek
4d74430259
Support testcrypto.sh usage without including conf.sh
The only variable really needed for the script to work is the path to
the $KEYGEN binary. Allow setting this via an environment variable to
avoid loading conf.sh (and causing a chicken-egg problem). Also make
testcrypto.sh executable to allow its use from conf.sh.

(cherry picked from commit bb1c6bbdc7)
2022-12-22 15:17:41 +01:00
Tom Krizek
28815949f8
Unify indentation level in testcrypto.sh
(cherry picked from commit 01b293b055)
2022-12-22 15:17:39 +01:00
Tom Krizek
09ec13097f BIND 9.16.36
-----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQQenrxMWseszT2nKSgBYjubZSogpwUCY5c/RAAKCRABYjubZSog
 p4gnAQD4xJh1/+BZ98ox0eKbLG95Y1vNSa8Sfj7g99WMPXZ9xwD/YSnCkiPALrvs
 UXrT/oVnI4vC/MardpV42QoZG8pitwQ=
 =Re69
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQQenrxMWseszT2nKSgBYjubZSogpwUCY6QagAAKCRABYjubZSog
 p1NjAQDw2Z4RPrzGsNTG0KfTizde35McYMiKxKqeDmZXKesq5wEA4RZoBlyJGXrY
 RXf+hJxqwRg7uh6IUz8bQ8HPUd38HAI=
 =HuoN
 -----END PGP SIGNATURE-----

Merge tag 'v9_16_36' into v9_16

BIND 9.16.36
2022-12-22 09:51:08 +01:00
Tom Krizek
6770e16d8c Merge branch 'tkrizek/system-tests-conventions-v9_16' into 'v9_16'
[9.16] Unify system tests naming conventions

See merge request isc-projects/bind9!7258
2022-12-21 13:37:34 +00:00
Tom Krizek
18e2298ed3
Update tests gitignore file
The .mypy_cache was added to the system test dir gitignore, since it
should be ignored.

(cherry picked from commit 4145068bfa)
2022-12-21 13:58:24 +01:00
Tom Krizek
1283d5263b
Use common name convention for pytest files
It is better to use consistent file names to avoid issue with sorting
etc.

Using underscore in filenames as opposed to dash was chosen because it
seems more common in pytest/python to use underscore for filenames.

Also rename the bin/tests/system/timeouts/tests-tcp.py file to
bin/tests/system/timeouts/tests_tcp_timeouts.py to avoid pytest name
collision (there can't be two files named tests_tcp.py).

(cherry picked from commit f6409ee6ac)
2022-12-21 13:57:58 +01:00
Tom Krizek
3628613996 Merge branch 'tkrizek/danger-backports-v9_16' into 'v9_16'
Check backport workflow in danger CI [v9_16]

See merge request isc-projects/bind9!7246
2022-12-16 13:42:06 +00:00
Tom Krizek
9438051e86
danger: remove obsolete check for cherry pick msg
With proper backport commit detection, this check has been made
redundant.

(cherry picked from commit e8a5ebaee5)
2022-12-16 14:22:05 +01:00
Tom Krizek
90ce669183
danger: check backport commits for original commit IDs
A full backport must have all the commit from the original MR and the
original commit IDs must be referenced in the backport commit messages.

If the criteria above is not met, the MR should be marked as a partial
backport. In that case, any discrepencies are only logged as informative
messages rather than failures.

(cherry picked from commit c617f97784)
2022-12-16 14:22:05 +01:00
Tom Krizek
d03cbcf1f5
danger: check that original MR has been merged
When checking a backport MR, ensure that the original MR has been merged
already. This is vital for followup checks that verify commit IDs from
original commits are present in backport commit messages.

(cherry picked from commit 89530f1a1c)
2022-12-16 14:22:05 +01:00
Tom Krizek
dcfaba5398
danger: check backport links to the original MR
When doing archeology, it is much easier to find stuff if it's properly
linked. This check ensures that backport MR are linked to their original
MR via a "Backport of !XXXX" message.

The regular expression is fairly broad and has been tested to accept the
following variants of the message:
Backport of MR !XXXX
Backport of: !XXXX
backport of mr !XXXX
Backport of   !XXXX
Backport of https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/XXXX

(cherry picked from commit 12e0b05738)
2022-12-16 14:22:05 +01:00
Tom Krizek
ef9cecb79a
danger: ensure target branch is in the MR title
Having the MR title clearly marked in its title can be very useful when
looking through older issues/MRs.

This check also ensures that the version from the version label matches
the proper version branch (i.e. v9.16 must be marked with [v9_16]).

(cherry picked from commit 14b027cf83)
2022-12-16 14:22:04 +01:00
Tom Krizek
5e31882596
danger: support partial backport label
Treat the Backport::Partial label as a backport as well.

(cherry picked from commit 1c0c1ba8b9)
2022-12-16 14:22:01 +01:00
Tony Finch
0195cb6de8 Merge branch '3740-rpz-reconfig-v9_16' into 'v9_16'
A couple of RPZ options were not reconfigured as expected

See merge request isc-projects/bind9!7239
2022-12-16 10:26:47 +00:00
Tony Finch
2d5160a9b9 A couple of RPZ options were not reconfigured as expected
[bug]	Changes to the RPZ response-policy min-update-interval
	and add-soa options now take effect as expected when
	named is reconfigured. [GL #3740]

(cherry picked from commit d8a3d328db)
2022-12-16 09:54:47 +00:00
Arаm Sаrgsyаn
59a76a7fa0 Merge branch '3742-catz-update-log-incorrect-soa-serial-representation-v9_16' into 'v9_16'
[v9_16] Fix an incorrect SOA serial representation in catz

See merge request isc-projects/bind9!7237
2022-12-15 14:48:22 +00:00
Aram Sargsyan
18932eb635 Add a CHANGES note for [GL #3742]
(cherry picked from commit ac7149aa88)
2022-12-15 13:50:36 +00:00
Aram Sargsyan
a634488a24 Fix logging a uint32_t SOA serial value in dns_catz_update_from_db()
The dns_catz_update_from_db() function prints serial number as a signed
number (with "%d" in the format string), but the `vers` variable's type
is 'uint32_t'. This breaks serials bigger than 2^31.

Use PRIu32 instead of "d" in the format string.

(cherry picked from commit 72b1760ea6)
2022-12-15 13:49:58 +00:00
Aram Sargsyan
d510221f7e Add big SOA serial logging check into the catz system test
Check that the SOA serial numbers printed when updating a catalog zone
is represented correctly for numbers bigger than 2^31.

(cherry picked from commit de232ab446)
2022-12-15 13:48:30 +00:00
Tony Finch
edc12bd49f Merge branch 'fanf-rsasha236-v9_16' into 'v9_16'
Fix a typo RSASHA236 -> RSASHA256

See merge request isc-projects/bind9!7225
2022-12-14 12:47:23 +00:00
Tony Finch
f3d96ab1f1 Fix a typo RSASHA236 -> RSASHA256
Use dns_secalg_format() to avoid error-prone repetition.

(cherry picked from commit c18a9a208d)
2022-12-14 12:46:56 +00:00
Tony Finch
1adcd723b4 Merge branch 'fanf-dnssec-algorithm-loglevel-v9_16' into 'v9_16'
List supported DNSSEC algorithms at log level NOTICE

See merge request isc-projects/bind9!7227
2022-12-14 12:32:01 +00:00
Tony Finch
bdfb06eb5a List supported DNSSEC algorithms at log level NOTICE
NOTICE matches the other startup messages. WARNING weirdly
suggests the list is a problem.

(cherry picked from commit 72f8d03cad)
2022-12-14 11:04:35 +00:00
Mark Andrews
929042cb51 Merge branch '3737-fix-initialisation-of-local-in-isdotlocal-in-dig-v9_16' into 'v9_16'
Resolve "fix initialisation of local. in isdotlocal in dig" [v9_16]

See merge request isc-projects/bind9!7222
2022-12-14 00:32:34 +00:00