Commit graph

36636 commits

Author SHA1 Message Date
Michał Kępień
648eca7698 Merge branch '3493-confidential-compression-buffer-reuse-v9_18' into 'security-v9_18'
[v9_18][CVE-2022-2881] compression buffer was not reused correctly

See merge request isc-private/bind9!436
2022-09-08 09:43:50 +00:00
Evan Hunt
2312c45ff2 CHANGES and release notes for CVE-2022-2881 [GL #3493]
(cherry picked from commit 430ee6c427)
2022-09-08 11:40:18 +02:00
Evan Hunt
13333db69f compression buffer was not reused correctly
when the compression buffer was reused for multiple statistics
requests, responses could grow beyond the correct size. this was
because the buffer was not cleared before reuse; compressed data
was still written to the beginning of the buffer, but then the size
of used region was increased by the amount written, rather than set
to the amount written. this caused responses to grow larger and
larger, potentially reading past the end of the allocated buffer.

(cherry picked from commit 47e9fa981e)
2022-09-08 11:40:18 +02:00
Michał Kępień
74ba7f89d7 Merge branch '3394-security-cve-2022-2795-mitigation-v9_18' into 'security-v9_18'
[CVE-2022-2795] [v9_18] Bound the amount of work performed for delegations

See merge request isc-private/bind9!452
2022-09-08 09:37:26 +00:00
Michał Kępień
7f6cb0d0cc Add release note for GL #3394
(cherry picked from commit 672072812c)
2022-09-08 11:11:30 +02:00
Michał Kępień
97a9f586c4 Add CHANGES entry for GL #3394
(cherry picked from commit e802beedfc)
2022-09-08 11:11:30 +02:00
Michał Kępień
e2014ba9e3 Bound the amount of work performed for delegations
Limit the amount of database lookups that can be triggered in
fctx_getaddresses() (i.e. when determining the name server addresses to
query next) by setting a hard limit on the number of NS RRs processed
for any delegation encountered.  Without any limit in place, named can
be forced to perform large amounts of database lookups per each query
received, which severely impacts resolver performance.

The limit used (20) is an arbitrary value that is considered to be big
enough for any sane DNS delegation.

(cherry picked from commit 3a44097fd6)
2022-09-08 11:11:30 +02:00
Michał Kępień
7e27db0023 Merge branch '3459-rrl-wildcard-handling-v9_18' into 'v9_18'
[v9_18] Make RRL code treat all QNAMEs subject to wildcard processing within a given zone as the same name

See merge request isc-projects/bind9!6748
2022-09-08 08:14:29 +00:00
Aram Sargsyan
bcf0f951e0 Add CHANGES and release notes for [GL #3459]
(cherry picked from commit 0b0cf12741)
2022-09-08 09:36:50 +02:00
Aram Sargsyan
f2982a5d3f Document RRL processing for wildcard names
All valid wildcard domain names are interpreted as the zone's origin
name concatenated to the "*" name.

(cherry picked from commit 89c2032421)
2022-09-08 09:36:50 +02:00
Aram Sargsyan
35e37505f0 Fix RRL responses-per-second bypass using wildcard names
It is possible to bypass Response Rate Limiting (RRL)
`responses-per-second` limitation using specially crafted wildcard
names, because the current implementation, when encountering a found
DNS name generated from a wildcard record, just strips the leftmost
label of the name before making a key for the bucket.

While that technique helps with limiting random requests like
<random>.example.com (because all those requests will be accounted
as belonging to a bucket constructed from "example.com" name), it does
not help with random names like subdomain.<random>.example.com.

The best solution would have been to strip not just the leftmost
label, but as many labels as necessary until reaching the suffix part
of the wildcard record from which the found name is generated, however,
we do not have that information readily available in the context of RRL
processing code.

Fix the issue by interpreting all valid wildcard domain names as
the zone's origin name concatenated to the "*" name, so they all will
be put into the same bucket.

(cherry picked from commit baa9698c9d)
2022-09-08 09:36:50 +02:00
Matthijs Mekking
fe162c74c1 Merge branch 'matthijs-fix-intermittent-inline-system-test-failure-v9_18' into 'v9_18'
[v9_18]  Fix intermittent inline system test failure

See merge request isc-projects/bind9!6739
2022-09-07 15:12:22 +00:00
Matthijs Mekking
d1315d1bc4 Update inline system test, zone 'retransfer3.'
The zone 'retransfer3.' tests whether zones that 'rndc signing
-nsec3param' requests are queued even if the zone is not loaded.

The test assumes that if 'rndc signing -list' shows that the zone is
done signing with two keys, and there are no NSEC3 chains pending, the
zone is done handling the '-nsec3param' queued requests. However, it
is possible that the 'rndc signing -list' command is received before
the corresponding privatetype records are added to the zone (the records
that are used to retrieve the signing status with 'rndc signing').

This is what happens in test failure
https://gitlab.isc.org/isc-projects/bind9/-/jobs/2722752.

The 'rndc signing -list retransfer3' is thus an unreliable check.
It is simpler to just remove the check and wait for a certain amount
of time and check whether ns3 has re-signed the zone using NSEC3.

(cherry picked from commit 8b71cbd09c)
2022-09-07 16:26:12 +02:00
Evan Hunt
d245253eb8 Merge branch 'each-interface-magic-v9_18' into 'v9_18'
when creating an interface, set magic before linking

See merge request isc-projects/bind9!6736
2022-09-07 06:14:56 +00:00
Evan Hunt
acfca3f4fa when creating an interface, set magic before linking
set the magic number in a newly-created interface object
before appending it to mgr->interfaces in order to prevent
a possible assertion.

(cherry picked from commit 8c01662048)
2022-09-06 21:48:28 -07:00
Arаm Sаrgsyаn
5c44aad640 Merge branch '3518-libxml2-deprecated-functions-v9_18' into 'v9_18'
[v9_18] Do not use libxml2 deprecated functions

See merge request isc-projects/bind9!6731
2022-09-06 10:03:31 +00:00
Aram Sargsyan
93c39696f4 Add CHANGES note for [GL #3518]
(cherry picked from commit 87920661b1)
2022-09-06 09:21:02 +00:00
Aram Sargsyan
97197ef78e Do not use libxml2 deprecated functions
The usage of xmlInitThreads() and xmlCleanupThreads() functions in
libxml2 is now marked as deprecated, and these functions will be made
private in the future.

Use xmlInitParser() and xmlCleanupParser() instead of them.

(cherry picked from commit a5d412d924)
2022-09-06 09:20:55 +00:00
Matthijs Mekking
7be0594be9 Merge branch '3381-dnssec-policy-explicit-inline-signing-v9_18' into 'v9_18'
[v9_18] dnssec-policy now requires inline-signing

See merge request isc-projects/bind9!6729
2022-09-06 08:48:46 +00:00
Matthijs Mekking
b232fabe89 Add change and release note for #3381
Because folks want to know.

(cherry picked from commit 2b95c11905a1a5faff9efa97a4f2498aadfa467b)
2022-09-06 09:55:06 +02:00
Matthijs Mekking
5c4c32114f Remove implicit inline-signing code
Remove the code that sets implicit inline-signing on zones using
dnssec-policy.

(cherry picked from commit a6b09c9c69186e81a9be54e8b7bb413b1ac4d650)
2022-09-06 09:55:06 +02:00
Matthijs Mekking
c6e2d7d54d Update system tests
Update checkconf and kasp related system tests after requiring
inline-signing.

(cherry picked from commit 8fd75e8a4e1035ce0e81bf47d954a3f5b8a4d571)
2022-09-06 09:55:06 +02:00
Matthijs Mekking
d7175c41a7 dnssec-policy now requires inline-signing
Having implicit inline-signing set for dnssec-policy when there is no
update policy is confusing, so lets make this explicit.

(cherry picked from commit 5ca02fe6e7e591d1fb85936ea4dda720c3d741ef)
2022-09-06 09:02:59 +02:00
Ondřej Surý
a6b6a1c9dd Merge branch '3485-dig-fallback-to-idna2003-v9_18' into 'v9_18'
Allow fallback to IDNA2003 processing

See merge request isc-projects/bind9!6725
2022-09-05 09:43:43 +00:00
Ondřej Surý
05499232a7
Add CHANGES and release note for [GL #3485]
(cherry picked from commit 0fe7acb4e6)
2022-09-05 10:21:28 +02:00
Ondřej Surý
a22b0bebc2
Enable the IDNA2003 domain names in the idna system test
Allow the IDNA2003 tests to succeed after the fallback to IDNA2003 was
implemented.

(cherry picked from commit 87de726f5c)
2022-09-05 10:21:28 +02:00
Ondřej Surý
abc0382738
Allow fallback to IDNA2003 processing
In several cases where IDNA2008 mappings do not exist whereas IDNA2003
mappings do, dig was failing to process the suplied domain name.  Take a
backwards compatible approach, and convert the domain to IDNA2008 form,
and if that fails try the IDNA2003 conversion.

(cherry picked from commit 10923f9d87)
2022-09-05 10:21:28 +02:00
Arаm Sаrgsyаn
bf70a66ed8 Merge branch '3515-mctx-attach-detach-for-isc_mempool_t-v9_18' into 'v9_18'
[v9_18] Add mctx attach/detach when creating/destroying a memory pool

See merge request isc-projects/bind9!6720
2022-09-02 09:03:31 +00:00
Aram Sargsyan
1017083de7 Add CHANGES note for [GL #3515]
(cherry picked from commit 362ead8d85)
2022-09-02 08:17:54 +00:00
Aram Sargsyan
982b491d7c Add mctx attach/detach when creating/destroying a memory pool
This should make sure that the memory context is not destroyed
before the memory pool, which is using the context.

(cherry picked from commit e97c3eea95)
2022-09-02 08:17:47 +00:00
Evan Hunt
19b98dc74f Merge branch '3511-quote-yaml-addresses-v9_18' into 'v9_18'
quote addresses in YAML output

See merge request isc-projects/bind9!6717
2022-08-31 23:39:50 +00:00
Evan Hunt
3ea267f29d CHANGES for [GL #3511]
(cherry picked from commit f72bf1375a)
2022-08-31 16:17:56 -07:00
Evan Hunt
3304c694c8 quote addresses in YAML output
YAML strings should be quoted if they contain colon characters.
Since IPv6 addresses do, we now quote the query_address and
response_address strings in all YAML output.

(cherry picked from commit 66eaf6bb73)
2022-08-31 16:17:56 -07:00
Evan Hunt
d84cff6d4b Merge branch '3501-dnstap-response-v9_18' into 'v9_18'
dnstap query_message field was erroneously set with responses

See merge request isc-projects/bind9!6715
2022-08-31 22:44:41 +00:00
Evan Hunt
07b3cbbba1 CHANGES for [GL #3501]
(cherry picked from commit fea9751f13)
2022-08-31 15:24:23 -07:00
Evan Hunt
7bb503ca75 dnstap query_message field was erroneously set with responses
The dnstap query_message field was in some cases being filled in
with response messages, along with the response_message field.
The query_message field should only be used when logging requests,
and the response_message field only when logging responses.

(cherry picked from commit 3ccfff8ab6)
2022-08-31 15:24:00 -07:00
Arаm Sаrgsyаn
cdf1871066 Merge branch 'aram/rpz-doc-update-v9_18' into 'v9_18'
[v9_18] Update RPZ documentation in ARM

See merge request isc-projects/bind9!6709
2022-08-31 08:54:04 +00:00
Aram Sargsyan
5e868be3cc Update RPZ documentation
The RPZ documentation section with response policy rules and actions
is incomplete.

Add information about the 'RPZ-CLIENT-IP' rule, and 'TCP-Only' and
'DROP' actions.

(cherry picked from commit 0fbd07ac22)
2022-08-30 10:36:14 +00:00
Mark Andrews
eb5492beeb Merge branch '3505-missing-isc_mutex_destroy-v9_18' into 'v9_18'
Call isc_mutex_destroy(&lasttime_mx); [v9_18]

See merge request isc-projects/bind9!6697
2022-08-24 07:38:01 +00:00
Mark Andrews
41cfd1c783 Call isc_mutex_destroy(&lasttime_mx);
(cherry picked from commit 8109f495c8b5d7c7f88d581f7905650add0c184e)
2022-08-24 17:03:57 +10:00
Matthijs Mekking
b88762debb Merge branch '3500-nsec3-missing-detach-node-9_18' into 'v9_18'
nsec3.c: Add a missing dns_db_detachnode() call

See merge request isc-projects/bind9!6693
2022-08-23 11:24:56 +00:00
Matthijs Mekking
d386ef9a0e Add CHANGES entry for #3500
There is no need for a release because this case was nearly impossible
to trigger (except for when 'sig-signing-type' was set to 0).

(cherry picked from commit 545ecb64b043617ea609f4f115d280bb5990e221)
2022-08-23 12:04:14 +02:00
Matthijs Mekking
e54ab3f586 nsec3.c: Add a missing dns_db_detachnode() call
There is one case in 'dns_nsec3_activex()' where it returns but forgets
to detach the db node. Add the missing 'dns_db_detachnode()' call.

This case only triggers if 'sig-signing-type' (privatetype) is set to 0
(which by default is not), or if the function is called with 'complete'
is set to 'true' (which at this moment do not exist).

(cherry picked from commit 0cf6c18ccb2205a1fc81431f908c8310f6136bbb)
2022-08-23 12:04:08 +02:00
Matthijs Mekking
9d6de16c57 Merge branch '3486-checkconf-dnssec-policy-nsec3-incompatible-algorithm-v9_18' into 'v9_18'
[v9_18]  Graceful dnssec-policy transition from NSEC only to NSEC3

See merge request isc-projects/bind9!6691
2022-08-22 17:42:11 +00:00
Matthijs Mekking
ba71f93e44 Fix nsec3 system test issues
The wait_for_zone_is_signed function was never called, which could lead
to test failures due to timing issues (where a zone was not fully signed
yet, but the test was trying to verify the zone).

Also add two missing set_nsec3param calls to ensure the ITERATIONS
value is set for these test cases.

(cherry picked from commit 08505651d1d9278314f61076ac7cd119a7790428)
2022-08-22 19:21:39 +02:00
Matthijs Mekking
ffc0c321ca Add change entry and release note for #3486
News worthy.

(cherry picked from commit 2669eb2a34ef65935f8045a6c9d271af486f38d5)
2022-08-22 19:21:39 +02:00
Matthijs Mekking
73431eef8f Add test case for #3486
Add two scenarios where we change the dnssec-policy from using RSASHA1
to something with NSEC3.

The first case should work, as the DS is still in hidden state and we
can basically do anything with DNSSEC.

The second case should fail, because the DS of the predecessor is
published and we can't immediately remove the predecessor DNSKEY. So
in this case we should keep the NSEC chain for a bit longer.

Add two more scenarios where we change the dnssec-policy from using
NSEC3 to something NSEC only. Both should work because there are no
restrictions on using NSEC when it comes to algorithms, but in the
cases where the DS is published we can't bluntly remove the predecessor.

Extend the nsec3 system test by also checking the DNSKEY RRset for the
expected DNSKEY records. This requires some "kasp system"-style setup
for each test (setting key properties and key states). Also move the
dnssec-verify check inside the check_nsec/check_nsec3 functions because
we will have to do that every time.

(cherry picked from commit 21729dd94efc9fc7b7317688dd9ff0ec45181bfd)
2022-08-22 19:21:39 +02:00
Matthijs Mekking
39c0c5022d Wait with NSEC3 during a DNSSEC policy change
When doing a dnssec-policy reconfiguration from a zone with NSEC only
keys to a zone that uses NSEC3, figure out to wait with building the
NSEC3 chain.

Previously, BIND 9 would attempt to sign such a zone, but failed to
do so because the NSEC3 chain conflicted with existing DNSKEY records
in the zone that were not compatible with NSEC3.

There exists logic for detecting such a case in the functions
dnskey_sane() (in lib/dns/zone.c) and check_dnssec() (in
lib/ns/update.c). Both functions look very similar so refactor them
to use the same code and call the new function (called
dns_zone_check_dnskey_nsec3()).

Also update the dns_nsec_nseconly() function to take an additional
parameter 'diff' that, if provided, will be checked whether an
offending NSEC only DNSKEY will be deleted from the zone. If so,
this key will not be considered when checking the zone for NSEC only
DNSKEYs. This is needed to allow a transition from an NSEC zone with
NSEC only DNSKEYs to an NSEC3 zone.

(cherry picked from commit 09a81dc84ce0fee37442f03cdbd63c2398215376)
2022-08-22 19:21:39 +02:00
Matthijs Mekking
b0ae2e4da7 Test checkconf NSEC3 and incompatible algorithm
The check code for this already exists, but was untested.

(cherry picked from commit 1996eaee547e046c8314cdb4a50a02eb9e59ce3f)
2022-08-22 16:37:38 +02:00
Arаm Sаrgsyаn
92fda68e22 Merge branch '3463-httpd.c-non-empty-post-requests-bugfix-v9_18' into 'v9_18'
[v9_18] Fix statistics channel multiple request processing with non-empty HTTP bodies

See merge request isc-projects/bind9!6689
2022-08-19 09:01:19 +00:00