Commit Graph

37198 Commits

Author SHA1 Message Date
Ondřej Surý
cb3990001f Add CHANGES and release note for [GL #3772] 2023-01-11 10:42:03 +01:00
Ondřej Surý
d0d9e7dfb2 Don't honour single read per client isc_nm_read() call in the TLSDNS
This reverts commit f17f5e831b that made
following change:

> The TLSDNS transport was not honouring the single read callback for
> TLSDNS client.  It would call the read callbacks repeatedly in case the
> single TLS read would result in multiple DNS messages in the decoded
> buffer.

Turns out that this change broke XoT, so we are reverting the change
until we figure out a proper fix that will keep the design promise and
not break XoT at the same time.
2023-01-11 10:17:55 +01:00
Matthijs Mekking
614d5c3334 Merge branch '3743-unexpected-prohibited-ede-v9_18' into 'v9_18'
[9.18] Fix unexpected "Prohibited" extended DNS error on allow-recursion mismatch

See merge request isc-projects/bind9!7324
2023-01-10 10:02:22 +00:00
Matthijs Mekking
29963f4c0e Add system test for #3743
(cherry picked from commit 8db8ec1f6e)
2023-01-10 10:02:14 +00:00
Matthijs Mekking
f8b7bb7c9f Add release note and CHANGES for #3743
(cherry picked from commit e43a26fd1e)
2023-01-10 10:02:14 +00:00
Matthijs Mekking
f481073110 Don't set EDE in ns_client_aclchecksilent
The ns_client_aclchecksilent is used to check multiple ACLs before
the decision is made that a query is denied. It is also used to
determine if recursion is available. In those cases we should not
set the extended DNS error "Prohibited".

(cherry picked from commit 798c8f57d4)
2023-01-10 10:02:14 +00:00
Mark Andrews
81f8b8fc14 Merge branch '3787-siphash-c-105-26-runtime-error-applying-zero-offset-to-null-pointer-v9_18' into 'v9_18'
[9.18] Accept 'in=NULL' with 'inlen=0' in isc_{half}siphash24

See merge request isc-projects/bind9!7341

Backport of MR !7339
2023-01-10 08:28:15 +00:00
Mark Andrews
f99593a9ca Accept 'in=NULL' with 'inlen=0' in isc_{half}siphash24
Arthimetic on NULL pointers is undefined.  Avoid arithmetic operations
when 'in' is NULL and require 'in' to be non-NULL if 'inlen' is not zero.

(cherry picked from commit 349c23dbb7)
2023-01-10 18:36:08 +11:00
Evan Hunt
12de356ed6 Merge branch '3773-remove-dscp-v9_18' into 'v9_18'
[9.18] Merge branch '3773-remove-dscp' into 'main'

See merge request isc-projects/bind9!7336
2023-01-10 00:20:14 +00:00
Evan Hunt
55d728a678 CHANGES and release note for [GL #3773]
(cherry picked from commit 34a7166029)
2023-01-09 14:24:23 -08:00
Evan Hunt
5fd93c66aa remove nonfunctional DSCP implementation
DSCP has not been fully working since the network manager was
introduced in 9.16, and has been completely broken since 9.18.
This seems to have caused very few difficulties for anyone,
so we have now marked it as obsolete and removed the
implementation.

To ensure that old config files don't fail, the code to parse
dscp key-value pairs is still present, but a warning is logged
that the feature is obsolete and should not be used. Nothing is
done with configured values, and there is no longer any
range checking.

(cherry picked from commit 916ea26ead)
2023-01-09 14:23:26 -08:00
Michal Nowak
703c799376 Merge branch 'mnowak/abort-on-ubsan-errors-v9_18' into 'v9_18'
[9.18] Abort on UBSAN errors

See merge request isc-projects/bind9!7327
2023-01-09 17:07:44 +00:00
Michal Nowak
addd4141a7 Abort on UBSAN errors
Previously, UBSAN errors might slip undetected.

(cherry picked from commit 1451bb7390)
2023-01-09 17:40:32 +01:00
Matthijs Mekking
815ac08a26 Merge branch '3678-serve-stale-servfailing-unexpectedly-v9_18' into 'v9_18'
[9.18] Resolve "stale-serve and RPZ put in SERVFAIL cache unexpected record"

See merge request isc-projects/bind9!7310
2023-01-09 15:01:49 +00:00
Michał Kępień
90408617d7 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 14:26:02 +01:00
Aram Sargsyan
096d980a87 Add a CHANGES note for [GL #3678]
(cherry picked from commit 40dee61a1e)
2023-01-09 14:26:02 +01:00
Matthijs Mekking
271bc20b1c 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 14:26:02 +01:00
Aram Sargsyan
d54e7052ab 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 14:26:02 +01:00
Ondřej Surý
bea3d7994a Merge branch '3766-pin-TCP-dispatch-to-threads-v9_18' into 'v9_18'
[9.18] Pin the dns_dispatch to threads when reusing

See merge request isc-projects/bind9!7302
2023-01-05 10:25:32 +00:00
Ondřej Surý
0e263b34c6 Pin the dns_dispatch to threads when reusing
Previously, dns_dispatch_gettcp() could pick a TCP connection created by
different thread - this breaks our contractual promise to DNS dispatch
by using the TCP connection on a different thread than it was created.
Add .tid member to the dns_dispatch_t struct and skip the dispatches
from other threads when looking up a TCP dispatch that we can reuse in
dns_request.

NOTE: This is going to be properly refactored, but this change could be
also backported to 9.18 for better stability and thread-affinity.

(cherry picked from commit 1a999353cd)
2023-01-05 10:20:47 +01:00
Tony Finch
3c411ad294 Merge branch '3745-delzone-catz-v9_18' into 'v9_18'
[9.18] Don't crash when rndc delzone encounters a catz member

See merge request isc-projects/bind9!7297
2023-01-04 18:56:07 +00:00
Tony Finch
03beb6e355 Don't crash when rndc delzone encounters a catz member
This bug was masked in the tests because the `catz` test script did an
`rndc addzone` before an `rndc delzone`. The `addzone` autovivified
the NZF config, so `delzone` worked OK.

This commit swaps the order of two sections of the `catz` test script
so that it uses `delzone` before `addzone`, which provokes a crash
when `delzone` requires a non-NULL NZF config.

To fix the crash, we now 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 17:50:44 +00:00
Ondřej Surý
f5e7192691 Merge branch '3723-dont-shutdown-invalid-tasks-v9_18' into 'v9_18'
[v9.18] Don't cleanup uninitialized dns_resolver buckets

See merge request isc-projects/bind9!7286
2023-01-03 11:54:21 +00:00
Ondřej Surý
d48f5e253f Don't cleanup uninitialized dns_resolver buckets
If the isc_task_create_bound() fails in the middle of buckets
initialization - the most common case would be shutdown initialized
during reload, not all tasks would be initialized, but the cleanup
code would try to cleanup all buckets.

Make sure that we cleanup only the initialized buckets by setting
ntasks to the number of already initialized tasks on the error path.
2023-01-03 10:33:23 +01:00
Michał Kępień
04d4a608b8 Merge branch 'michal/update-copyright-year-to-2023-v9_18' into 'v9_18'
[9.18] Update copyright year to 2023

See merge request isc-projects/bind9!7283
2023-01-02 13:16:50 +00:00
Michał Kępień
d72070f30e Update copyright year to 2023
(cherry picked from commit 1a5d707f52)
2023-01-02 14:12:23 +01:00
Arаm Sаrgsyаn
a21562c6cf Merge branch 'aram/dns_dispatch_createtcp-bugfix-v9_18' into 'v9_18'
[9.18] Don't pass a NULL pointer to isc_sockaddr_format()

See merge request isc-projects/bind9!7278
2022-12-28 14:54:16 +00:00
Aram Sargsyan
35b5ba2ff4 Don't pass a NULL pointer to isc_sockaddr_format()
The 'localaddr' pointer can be NULL, which causes an assertion failure.

Use '&disp->local' instead when printing a debug log message.

(cherry picked from commit 41ca9d419e)
2022-12-28 14:19:37 +00:00
Tom Krizek
5102e676e7 Merge branch 'tkrizek/gitignore-fixes-v9_18' into 'v9_18'
[9.18] Don't track gitignored files in the repo

See merge request isc-projects/bind9!7274
2022-12-23 14:14:28 +00:00
Michał Kępień
df5c90843b Detect "ignored yet tracked" files in GitLab CI
Ensure that no .gitignore file in the tree contains patterns matching
files tracked by Git by adding a simple script that detects such
situations and running that script as part of the "misc" job in the
"precheck" stage of every GitLab CI pipeline.

(cherry picked from commit 5b28da7ea0)
2022-12-23 14:29:48 +01:00
Tom Krizek
ee4a18ee23 Remove obsolete gitignore file in mysqldyn
The Makefile used to be autogenerated prior to
67f76b1269 which is the reason why the
.gitignore existed in the first place. Since then, a static Makefile is
used and is supposed to be tracked in the git repo.

(cherry picked from commit a02da6cf21)
2022-12-23 14:29:47 +01:00
Tom Krizek
6b56dad1cd Make gitignore matching in rpzrecurse more precise
The pre-defined test cases use named.$TESTCASE.conf naming convention,
where TESTCASE is a human readable name contaning actual word(s). The
autogenerated test cases' names always start with a number from 1 to 6.

(cherry picked from commit e03daf22ec)
2022-12-23 14:29:47 +01:00
Tom Krizek
b9065fb187 Remove ans.pl system test files from gitignore
The ans*.pl scripts are part of system tests and should be part of the
repository. The gitignore entires for these files have been removed.

(cherry picked from commit b8616e457f)
2022-12-23 14:29:47 +01:00
Tom Krizek
bff1f5af2b Rename dig reference files in the rrsetorder test
bin/tests/system/rrsetorder/dig.out* files match a gitignore expression
present in bin/tests/system/.gitignore.  Since these are meant to be
reference files that are compared to the files generated when the
"rrsetorder" system test is run, rename them to avoid listing tracked
files in .gitignore files.

(cherry picked from commit c5708044e7)
2022-12-23 14:29:44 +01:00
Artem Boldariev
5a4b3491f9 Merge branch '3748-rename-tls-caches-creation-functions-v9-18' into 'v9_18'
[9.18] Rename isc_tlsctx_cache_new() to isc_tlsctx_cache_create(), tlsctx_client_session_cache_new() to tlsctx_client_session_create()

See merge request isc-projects/bind9!7272
2022-12-23 12:43:55 +00:00
Artem Boldariev
bccbf28249 tlsctx_client_session_cache_new() -> tlsctx_client_session_create()
Additionally to renaming, it changes the function definition so that
it accepts a pointer to pointer instead of returning a pointer to the
new object.

It is mostly done to make it in line with other functions in the
module.

(cherry picked from commit 7962e7f575)
2022-12-23 13:58:14 +02:00
Artem Boldariev
b05b05cb48 Rename isc_tlsctx_cache_new() -> isc_tlsctx_cache_create()
Additionally to renaming, it changes the function definition so that
it accepts a pointer to pointer instead of returning a pointer to the
new object.

It is mostly done to make it in line with other functions in the
module.

(cherry picked from commit f102df96b8)
2022-12-23 13:58:14 +02:00
Arаm Sаrgsyаn
3922728175 Merge branch '3752-resolver-adb-quota-bug-v9_18' into 'v9_18'
[9.18] Fix an ADB quota management bug in the resolver

See merge request isc-projects/bind9!7273
2022-12-23 10:44:19 +00:00
Aram Sargsyan
0e849a99cf Add CHANGES and release notes for [GL #3752]
(cherry picked from commit a4def095f3)
2022-12-23 10:08:00 +00:00
Aram Sargsyan
926f0323b6 Fix an ADB quota management error in the resolver
Normally, when a 'resquery_t' object is created in fctx_query(),
we call dns_adb_beginudpfetch() (which increases the ADB quota)
only if it's a UDP query. Then, in fctx_cancelquery(), we call
dns_adb_endudpfetch() to decreases back the ADB quota, again only
if it's a UDP query.

The problem is that a UDP query can become a TCP query, preventing
the quota from adjusting back in fctx_cancelquery() later.

Call dns_adb_beginudpfetch() also when switching the query type
from UDP to TCP.

(cherry picked from commit 53afe1f978)
2022-12-23 10:08:00 +00:00
Aram Sargsyan
650f3098e1 INSIST that active quota is 0 in destroy_adbentry()
This should catch ADB quota management errors in the resolver.

(cherry picked from commit c7ba26c3d6)
2022-12-23 10:08:00 +00:00
Tom Krizek
02f775a447 Merge branch 'tkrizek/dangerfile-backport-tweaks-v9_18' into 'v9_18'
[9.18] danger CI: tweak backport check and add Affects label check

See merge request isc-projects/bind9!7270
2022-12-23 08:57:53 +00:00
Tom Krizek
893d6dc98f 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:52:40 +01:00
Tom Krizek
8bc806a9f2 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:52:32 +01:00
Tom Krizek
2c2148fb23 Merge tag 'v9_18_10' into v9_18
BIND 9.18.10
2022-12-22 10:06:46 +01:00
Arаm Sаrgsyаn
fc122887f8 Merge branch '3750-legacy-system-test-dig-timed-out-fix-v9_18' into 'v9_18'
[9.18] Fix DiG "timed out" message check in "legacy" system test

See merge request isc-projects/bind9!7260
2022-12-21 15:09:50 +00:00
Aram Sargsyan
5e57ffbd51 Fix DiG "timed out" message check in "legacy" system test
The test expects a "connection timed out" message from DiG when it
experiences a timeout, while the current version of DiG prints just
a "timed out" message, like below:

    ;; communications error to 10.53.0.1#11314: timed out
    ;; communications error to 10.53.0.1#11314: timed out
    ;; communications error to 10.53.0.1#11314: timed out

    ; <<>> DiG 9.19.9-dev <<>> -p 11314 +tries +time +tcp +tries +time @10.53.0.1 dropedns. TXT
    ; (1 server found)
    ;; global options: +cmd
    ;; no servers could be reached

Change the expected string to match the current DiG output.

Use the '-F' switch for "grep" for matching a fixed string.

(cherry picked from commit 35988748f3)
2022-12-21 14:32:18 +00:00
Tom Krizek
e64dbb578b Merge branch 'tkrizek/system-tests-conventions-v9_18' into 'v9_18'
[9.18] Unify system tests naming conventions

See merge request isc-projects/bind9!7257
2022-12-21 13:44:34 +00:00
Tom Krizek
3c29317ad3 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 14:02:47 +01:00
Tom Krizek
873feb0c53 Rename engine_pkcs11 system test
In order to have a common naming convention for system tests, rename the
only outlier "engine_pkcs11" to "enginepkcs11", which was the only
system test using an underscore in its name.

The only allowed word separators for system test names are either dash
or no separator.

(cherry picked from commit 62eea511db)
2022-12-21 14:02:47 +01:00