]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
4 years agoCheck that primary key names are syntactically valid
Mark Andrews [Wed, 4 Aug 2021 07:23:07 +0000 (17:23 +1000)] 
Check that primary key names are syntactically valid

4 years agoMerge branch '2842-clean-up-catalog-journal' into 'main'
Mark Andrews [Wed, 25 Aug 2021 05:16:34 +0000 (05:16 +0000)] 
Merge branch '2842-clean-up-catalog-journal' into 'main'

Resolve "Clean up catalog journal"

Closes #2842

See merge request isc-projects/bind9!5313

4 years agoAdd CHANGES for [GL #2842]
Mark Andrews [Wed, 4 Aug 2021 05:08:22 +0000 (15:08 +1000)] 
Add CHANGES for [GL #2842]

4 years agoAlso delete journal file
Mark Andrews [Wed, 4 Aug 2021 05:06:42 +0000 (15:06 +1000)] 
Also delete journal file

4 years agocheck that journal files are also removed
Mark Andrews [Wed, 4 Aug 2021 05:04:58 +0000 (15:04 +1000)] 
check that journal files are also removed

4 years agoMerge branch '2877-v9-17-cannot-be-compiled-on-a-system-without-libnghttp2-library...
Mark Andrews [Wed, 25 Aug 2021 03:36:50 +0000 (03:36 +0000)] 
Merge branch '2877-v9-17-cannot-be-compiled-on-a-system-without-libnghttp2-library' into 'main'

Resolve "v9.17 cannot be compiled on a system without libnghttp2 library"

Closes #2877

See merge request isc-projects/bind9!5353

4 years agohandle not configured with trailing flags
Mark Andrews [Tue, 24 Aug 2021 04:08:10 +0000 (14:08 +1000)] 
handle not configured with trailing flags

4 years agoSkip good-dot-*.conf when libnghttp2 is not available
Mark Andrews [Tue, 24 Aug 2021 04:06:48 +0000 (14:06 +1000)] 
Skip good-dot-*.conf when libnghttp2 is not available

4 years agoMore config element are not valid without DOH / DOT
Mark Andrews [Tue, 24 Aug 2021 04:01:46 +0000 (14:01 +1000)] 
More config element are not valid without DOH / DOT

4 years agoMake doth system test conditional
Mark Andrews [Tue, 24 Aug 2021 04:00:06 +0000 (14:00 +1000)] 
Make doth system test conditional

4 years agoProtect #include <nghttp2/nghttp2.h> with #ifdef HAVE_LIBNGHTTP2
Mark Andrews [Tue, 24 Aug 2021 03:24:56 +0000 (13:24 +1000)] 
Protect #include <nghttp2/nghttp2.h> with #ifdef HAVE_LIBNGHTTP2

4 years agoMerge branch '1721-grow-shrink-dnssec-sign-stats' into 'main'
Matthijs Mekking [Tue, 24 Aug 2021 07:27:26 +0000 (07:27 +0000)] 
Merge branch '1721-grow-shrink-dnssec-sign-stats' into 'main'

Grow and shrink dnssec-sign statistics on key rollover events

Closes #1721

See merge request isc-projects/bind9!5349

4 years agoAdd CHANGES for [GL #1721]
Matthijs Mekking [Fri, 20 Aug 2021 13:10:42 +0000 (15:10 +0200)] 
Add CHANGES for [GL #1721]

4 years agoAdd statschannel test case for key removal
Matthijs Mekking [Fri, 20 Aug 2021 13:08:29 +0000 (15:08 +0200)] 
Add statschannel test case for key removal

Add a statschannel test case to confirm that when keys are removed
(in this case because of a dnssec-policy change), the corresponding
dnssec-sign stats are cleared and are no longer shown in the
statistics.

4 years agoClear dnssec-sign stats for removed keys
Matthijs Mekking [Fri, 20 Aug 2021 13:06:13 +0000 (15:06 +0200)] 
Clear dnssec-sign stats for removed keys

Clear the key slots for dnssec-sign statistics for keys that are
removed. This way, the number of slots will stabilize to the maximum
key usage in a zone and will not grow every time a key rollover is
triggered.

4 years agoAdd back the statschannel manykeys test case
Matthijs Mekking [Fri, 20 Aug 2021 09:19:28 +0000 (11:19 +0200)] 
Add back the statschannel manykeys test case

Add a test case that has more than four keys (the initial number of
key slots that are created for dnssec-sign statistics). We shouldn't
be expecting weird values.

This fixes some errors in the manykeys zone configuration (keys
were created for algorithm RSASHA256, but the policy expected RSASHA1,
and the zone was not allowing dynamic updates).

This also fixes an error in the calls to 'zones-json.pl': The perl
script excepts an index number where the zone can be found, rather
than the zone name.

4 years agoGrow dnssec-sign statistics instead of rotating
Matthijs Mekking [Fri, 20 Aug 2021 09:14:49 +0000 (11:14 +0200)] 
Grow dnssec-sign statistics instead of rotating

We have introduced dnssec-sign statistics to the zone statistics. This
introduced an operational issue because when using zone-statistics
full, the memory usage was going through the roof. We fixed this by
by allocating just four key slots per zone. If a zone exceeds the
number of keys for example through a key rollover, the keys will be
rotated out on a FIFO basis.

This works for most cases, and fixes the immediate problem of high
memory usage, but if you sign your zone with many, many keys, or are
sign with a ZSK/KSK double algorithm strategy you may experience weird
statistics. A better strategy is to grow the number of key slots per
zone on key rollover events.

That is what this commit is doing: instead of rotating the four slots
to track sign statistics, named now grows the number of key slots
during a key rollover (or via some other method that introduces new
keys).

4 years agoAdd a function isc_stats_resize
Matthijs Mekking [Thu, 19 Aug 2021 11:38:51 +0000 (13:38 +0200)] 
Add a function isc_stats_resize

Add a new function to resize the number of counters in a statistics
counter structure. This will be needed when we keep track of DNSSEC
sign statistics and new keys are introduced due to a rollover.

4 years agoAdd stats unit test
Matthijs Mekking [Thu, 19 Aug 2021 10:14:21 +0000 (12:14 +0200)] 
Add stats unit test

Add a simple stats unit test that tests the existing library functions
isc_stats_ncounters, isc_stats_increment, isc_stats_decrement,
isc_stats_set, and isc_stats_update_if_greater.

4 years agoMerge branch '256-inline-signing-receive-secure-serial-unchanged' into 'main'
Matthijs Mekking [Mon, 23 Aug 2021 09:25:38 +0000 (09:25 +0000)] 
Merge branch '256-inline-signing-receive-secure-serial-unchanged' into 'main'

Change "receive_secure_serial: unchanged" log level

Closes #256

See merge request isc-projects/bind9!5333

4 years agoChange "receive_secure_serial: unchanged" log lvl
Matthijs Mekking [Wed, 18 Aug 2021 13:57:03 +0000 (15:57 +0200)] 
Change "receive_secure_serial: unchanged" log lvl

After a reload, if the zone hasn't changed, this will log a
DNS_R_UNCHANGED error. This should not be at error level because it
happens on every reload.

4 years agoMerge branch '2857-migrate-csk-to-dnssec-policy' into 'main'
Matthijs Mekking [Mon, 23 Aug 2021 08:21:55 +0000 (08:21 +0000)] 
Merge branch '2857-migrate-csk-to-dnssec-policy' into 'main'

Test migrating CSK to dnssec-policy

Closes #2857

See merge request isc-projects/bind9!5328

4 years agoAdd a test case for non-SEP CSK migration
Matthijs Mekking [Tue, 17 Aug 2021 14:50:18 +0000 (16:50 +0200)] 
Add a test case for non-SEP CSK migration

A zone with a single key without the SEP bit set must also be assumed
to be a CSK.

4 years agoChanges to kasp script to deal with non-SEP CSK
Matthijs Mekking [Tue, 17 Aug 2021 14:48:26 +0000 (16:48 +0200)] 
Changes to kasp script to deal with non-SEP CSK

In order to test cases with non-SEP CSK keys, the Flags Field needs to
be determined differently to deal with such exceptional scenarios.

4 years agoAdd change and release note for [#2857]
Matthijs Mekking [Mon, 16 Aug 2021 09:27:11 +0000 (11:27 +0200)] 
Add change and release note for [#2857]

4 years agoMigrate a single key to CSK with dnssec-policy
Matthijs Mekking [Mon, 16 Aug 2021 09:12:36 +0000 (11:12 +0200)] 
Migrate a single key to CSK with dnssec-policy

When migrating keys to dnssec-policy, if a zone has only one key,
assume it is going to be a CSK.

4 years agoTest migrating CSK to dnssec-policy
Matthijs Mekking [Mon, 16 Aug 2021 09:09:25 +0000 (11:09 +0200)] 
Test migrating CSK to dnssec-policy

Add a test case for migrating CSK to dnssec-policy. The keymgr has no
way of telling that the key is used as a CSK, but if there is only one
key to migrate it is going to assume it must be a CSK.

4 years agoMerge branch '2868-svbc-fromwire-should-reject-zero-length-alpn-elements' into 'main'
Mark Andrews [Thu, 19 Aug 2021 08:36:57 +0000 (08:36 +0000)] 
Merge branch '2868-svbc-fromwire-should-reject-zero-length-alpn-elements' into 'main'

Resolve "SVBC fromwire should reject zero length ALPN elements"

Closes #2868

See merge request isc-projects/bind9!5336

4 years agoReject zero length ALPN elements in fromwire
Mark Andrews [Thu, 19 Aug 2021 01:09:45 +0000 (11:09 +1000)] 
Reject zero length ALPN elements in fromwire

4 years agoMerge branch '2870-address-test-timing-false-positive-in-rndc-system-test' into ...
Mark Andrews [Thu, 19 Aug 2021 07:51:10 +0000 (07:51 +0000)] 
Merge branch '2870-address-test-timing-false-positive-in-rndc-system-test' into 'main'

Resolve "Address test timing false positive in rndc system test."

Closes #2870

See merge request isc-projects/bind9!5341

4 years agowait for each staged to complete
Mark Andrews [Thu, 19 Aug 2021 06:43:56 +0000 (16:43 +1000)] 
wait for each staged to complete

4 years agoMerge branch '2867-svbc-from-wire-needs-to-check-that-alpn-in-present-when-no-default...
Mark Andrews [Thu, 19 Aug 2021 07:29:42 +0000 (07:29 +0000)] 
Merge branch '2867-svbc-from-wire-needs-to-check-that-alpn-in-present-when-no-default-alpn-is-present' into 'main'

Resolve "SVBC fromwire needs to check that alpn in present when no-default-alpn is present"

Closes #2867

See merge request isc-projects/bind9!5334

4 years agoCheck that ALPN is present when NO-DEFAULT-ALPN is present in fromwire
Mark Andrews [Thu, 19 Aug 2021 00:08:18 +0000 (10:08 +1000)] 
Check that ALPN is present when NO-DEFAULT-ALPN is present in fromwire

4 years agoMerge branch 'each-fanf-dnssec-cds-no-sha1' into 'main'
Evan Hunt [Thu, 19 Aug 2021 05:42:48 +0000 (05:42 +0000)] 
Merge branch 'each-fanf-dnssec-cds-no-sha1' into 'main'

Suppress SHA-1 DS records in dnssec-cds

See merge request isc-projects/bind9!5331

4 years agoAdd CHANGES and release note for [GL !2946]
Tony Finch [Wed, 22 Jan 2020 19:11:56 +0000 (19:11 +0000)] 
Add CHANGES and release note for [GL !2946]

4 years agoSuppress SHA-1 DS records in dnssec-cds
Tony Finch [Thu, 16 Jan 2020 18:50:59 +0000 (18:50 +0000)] 
Suppress SHA-1 DS records in dnssec-cds

Previously, when dnssec-cds copied CDS records to make DS records,
its -a algorithm option did not have any effect. This means that if
the child zone is signed with older software that generates SHA-1 CDS
records, dnssec-cds would (by default) create SHA-1 DS records in
violation of RFC 8624.

This change makes the dnssec-cds -a option apply to CDS records as
well as CDNSKEY records. In the CDS case, the -a algorithms are the
acceptable subset of possible CDS algorithms. If none of the CDS
records are acceptable, dnssec-cds tries to generate DS records from
CDNSKEY records.

4 years agoMerge branch 'v9_17_17-release' into 'main'
Michał Kępień [Thu, 19 Aug 2021 05:13:43 +0000 (05:13 +0000)] 
Merge branch 'v9_17_17-release' into 'main'

Merge 9.17.17 release branch

See merge request isc-projects/bind9!5338

4 years agoSet up release notes for BIND 9.17.18
Michał Kępień [Thu, 19 Aug 2021 05:12:33 +0000 (07:12 +0200)] 
Set up release notes for BIND 9.17.18

4 years agoUpdate BIND version to 9.17.17
Michał Kępień [Tue, 10 Aug 2021 11:41:42 +0000 (13:41 +0200)] 
Update BIND version to 9.17.17

4 years agoAdd a CHANGES marker
Michał Kępień [Tue, 10 Aug 2021 11:41:42 +0000 (13:41 +0200)] 
Add a CHANGES marker

4 years agoMerge branch 'michal/prepare-documentation-for-bind-9.17.17' into 'security-main'
Michał Kępień [Tue, 10 Aug 2021 11:32:59 +0000 (11:32 +0000)] 
Merge branch 'michal/prepare-documentation-for-bind-9.17.17' into 'security-main'

Prepare documentation for BIND 9.17.17

See merge request isc-private/bind9!312

4 years agoMerge branch '2839-confidential-rrl-msgsize' into 'security-main'
Michal Nowak [Fri, 6 Aug 2021 13:00:46 +0000 (13:00 +0000)] 
Merge branch '2839-confidential-rrl-msgsize' into 'security-main'

[CVE-2021-25218]: assertion failure in RRL after EMSGSIZE error

See merge request isc-private/bind9!313

4 years agoPrepare release notes for BIND 9.17.17
Michał Kępień [Tue, 10 Aug 2021 10:20:52 +0000 (12:20 +0200)] 
Prepare release notes for BIND 9.17.17

4 years agoAdd CHANGES and release notes for [GL #2839]
Evan Hunt [Wed, 28 Jul 2021 01:02:03 +0000 (18:02 -0700)] 
Add CHANGES and release notes for [GL #2839]

4 years agoAdd release note for GL #2756
Michał Kępień [Tue, 10 Aug 2021 10:20:52 +0000 (12:20 +0200)] 
Add release note for GL #2756

4 years agoDisable the Path MTU Discover on UDP Sockets
Ondřej Surý [Wed, 28 Jul 2021 13:55:46 +0000 (15:55 +0200)] 
Disable the Path MTU Discover on UDP Sockets

Instead of disabling the fragmentation on the UDP sockets, we now
disable the Path MTU Discovery by setting IP(V6)_MTU_DISCOVER socket
option to IP_PMTUDISC_OMIT on Linux and disabling IP(V6)_DONTFRAG socket
option on FreeBSD.  This option sets DF=0 in the IP header and also
ignores the Path MTU Discovery.

As additional mitigation on Linux, we recommend setting
net.ipv4.ip_no_pmtu_disc to Mode 3:

    Mode 3 is a hardend pmtu discover mode. The kernel will only accept
    fragmentation-needed errors if the underlying protocol can verify
    them besides a plain socket lookup. Current protocols for which pmtu
    events will be honored are TCP, SCTP and DCCP as they verify
    e.g. the sequence number or the association. This mode should not be
    enabled globally but is only intended to secure e.g. name servers in
    namespaces where TCP path mtu must still work but path MTU
    information of other protocols should be discarded. If enabled
    globally this mode could break other protocols.

4 years agoReorder release notes
Michał Kępień [Tue, 10 Aug 2021 10:20:52 +0000 (12:20 +0200)] 
Reorder release notes

4 years agons_client_error() could assert if rcode was overridden to NOERROR
Evan Hunt [Tue, 27 Jul 2021 21:08:07 +0000 (14:08 -0700)] 
ns_client_error() could assert if rcode was overridden to NOERROR

The client->rcode_override was originally created to force the server
to send SERVFAIL in some cases when it would normally have sent FORMERR.

More recently, it was used in a3ba95116ed04594ea59a8124bf781b30367a7a2
commit (part of GL #2790) to force the sending of a TC=1 NOERROR
response, triggering a retry via TCP, when a UDP packet could not be
sent due to ISC_R_MAXSIZE.

This ran afoul of a pre-existing INSIST in ns_client_error() when
RRL was in use. the INSIST was based on the assumption that
ns_client_error() could never result in a non-error rcode. as
that assumption is no longer valid, the INSIST has been removed.

4 years agoTweak and reword release notes
Michał Kępień [Tue, 10 Aug 2021 10:20:52 +0000 (12:20 +0200)] 
Tweak and reword release notes

4 years agoTweak and reword recent CHANGES entries
Michał Kępień [Tue, 10 Aug 2021 10:20:52 +0000 (12:20 +0200)] 
Tweak and reword recent CHANGES entries

4 years agoTweak library requirements in PLATFORMS.md
Michał Kępień [Tue, 10 Aug 2021 10:20:52 +0000 (12:20 +0200)] 
Tweak library requirements in PLATFORMS.md

4 years agoTweak jemalloc warning text in configure.ac
Michał Kępień [Tue, 10 Aug 2021 10:20:52 +0000 (12:20 +0200)] 
Tweak jemalloc warning text in configure.ac

4 years agoFix typos in lib/isc/trampoline_p.h
Michal Nowak [Tue, 10 Aug 2021 10:20:52 +0000 (12:20 +0200)] 
Fix typos in lib/isc/trampoline_p.h

4 years agoMerge branch 'marka-fix-format' into 'main'
Mark Andrews [Thu, 19 Aug 2021 05:09:58 +0000 (05:09 +0000)] 
Merge branch 'marka-fix-format' into 'main'

Use %d for enum values

See merge request isc-projects/bind9!5335

4 years agoUse %d for enum values
Mark Andrews [Thu, 19 Aug 2021 00:19:32 +0000 (10:19 +1000)] 
Use %d for enum values

4 years agoMerge branch '1132-wip-httpssvc-record' into 'main' 5337/head
Mark Andrews [Wed, 18 Aug 2021 04:35:11 +0000 (04:35 +0000)] 
Merge branch '1132-wip-httpssvc-record' into 'main'

Resolve "HTTPS and SVCB records"

Closes #1132

See merge request isc-projects/bind9!2135

4 years agoAdd CHANGES and release notes
Mark Andrews [Fri, 17 Jul 2020 02:42:07 +0000 (12:42 +1000)] 
Add CHANGES and release notes

4 years agoAdd check-names for svbc (https) server name examples
Mark Andrews [Mon, 26 Jul 2021 05:43:52 +0000 (15:43 +1000)] 
Add check-names for svbc (https) server name examples

4 years agoCheck that the hostname of the server is legal
Mark Andrews [Fri, 23 Jul 2021 06:25:43 +0000 (16:25 +1000)] 
Check that the hostname of the server is legal

4 years agoadd tests for string and qstring
Mark Andrews [Mon, 3 Aug 2020 14:16:50 +0000 (00:16 +1000)] 
add tests for string and qstring

4 years agoAdd unit test for keypair
Mark Andrews [Fri, 31 Jul 2020 15:25:37 +0000 (01:25 +1000)] 
Add unit test for keypair

4 years agoAdd additional processing to HTTPS and SVBC records
Mark Andrews [Fri, 5 Jul 2019 06:20:20 +0000 (16:20 +1000)] 
Add additional processing to HTTPS and SVBC records

The additional processing method has been expanded to take the
owner name of the record, as HTTPS and SVBC need it to process "."
in service form.

The additional section callback can now return the RRset that was
added.  We use this when adding CNAMEs.  Previously, the recursion
would stop if it detected that a record you added already exists.  With
CNAMEs this rule doesn't work, as you ultimately care about the RRset
at the target of the CNAME and not the presence of the CNAME itself.
Returning the record allows the caller to restart with the target
name.  As CNAMEs can form loops, loop protection was added.

As HTTPS and SVBC can produce infinite chains, we prevent this by
tracking recursion depth and stopping if we go too deep.

4 years agoadd svcb fuzzing seed
Mark Andrews [Mon, 3 Aug 2020 03:27:51 +0000 (13:27 +1000)] 
add svcb fuzzing seed

4 years agoAdd invalid test vectors
Mark Andrews [Thu, 22 Apr 2021 06:18:46 +0000 (16:18 +1000)] 
Add invalid test vectors

4 years agoadd text vs unknown test vectors
Mark Andrews [Thu, 25 Mar 2021 05:41:33 +0000 (16:41 +1100)] 
add text vs unknown test vectors

4 years agoParse and print HTTPS and SVCB records
Mark Andrews [Thu, 5 Nov 2020 06:22:52 +0000 (17:22 +1100)] 
Parse and print HTTPS and SVCB records

4 years agoAdd support for parsing <tag>[=<value>]
Mark Andrews [Wed, 25 Sep 2019 08:02:38 +0000 (18:02 +1000)] 
Add support for parsing <tag>[=<value>]

where <value> may be a quoted string.  Previously quoted string
only supported opening quotes at the start of the string.

4 years agoMake whether to follow additional data records generic
Mark Andrews [Tue, 23 Mar 2021 23:58:09 +0000 (10:58 +1100)] 
Make whether to follow additional data records generic

Adds dns_rdatatype_followadditional() and
DNS_RDATATYPEATTR_FOLLOWADDITIONAL

4 years agoMerge branch '2319-add-the-ability-to-display-the-badcookie-message-to-dig-when-badco...
Mark Andrews [Wed, 18 Aug 2021 02:51:02 +0000 (02:51 +0000)] 
Merge branch '2319-add-the-ability-to-display-the-badcookie-message-to-dig-when-badcookie-is-active' into 'main'

Resolve "Add the ability to display the BADCOOKIE message to dig when +badcookie is active"

Closes #2319

See merge request isc-projects/bind9!4443

4 years agoAdd CHANGES for [GL #2319]
Mark Andrews [Tue, 17 Aug 2021 04:42:17 +0000 (14:42 +1000)] 
Add CHANGES for [GL #2319]

4 years agoTest dig +showbadcookie
Mark Andrews [Tue, 17 Aug 2021 04:42:44 +0000 (14:42 +1000)] 
Test dig +showbadcookie

4 years agoAdd the ability to display the BADCOOKIE message in dig when
Mark Andrews [Tue, 1 Dec 2020 04:10:32 +0000 (15:10 +1100)] 
Add the ability to display the BADCOOKIE message in dig when

+badcookie is in effect.

4 years agoMerge branch '2845-rndc-freeze-edit-include-file-thaw' into 'main'
Matthijs Mekking [Mon, 16 Aug 2021 15:06:09 +0000 (15:06 +0000)] 
Merge branch '2845-rndc-freeze-edit-include-file-thaw' into 'main'

Add test for in-view zone edits

Closes #2845

See merge request isc-projects/bind9!5316

4 years agoAdd test for in-view zone edits
Matthijs Mekking [Fri, 6 Aug 2021 12:28:01 +0000 (14:28 +0200)] 
Add test for in-view zone edits

Add a test case for GL #2845 where a zone is in two views, one base
view and one "in-view" and that zone is using an $INCLUDE. Make sure
that there is a jnl file (have ixfr-from-differences enabled and do a
dynamic update). Then freeze and make updates in the included file
(this requires the test.db file also to be updated because 'rndc freeze'
causes the zone file to be overwritten). Finally reload and ensure that
the edit in the included file has been loaded.

4 years agoMerge branch '2665-qname-minimization-disabled-after-first-resolution' into 'main'
Matthijs Mekking [Mon, 16 Aug 2021 14:41:40 +0000 (14:41 +0000)] 
Merge branch '2665-qname-minimization-disabled-after-first-resolution' into 'main'

QNAME minimization is bypassed with stale zonecut in cache

Closes #2665

See merge request isc-projects/bind9!5327

4 years agoMore correctly implement ends with label sequence check
Mark Andrews [Mon, 16 Aug 2021 04:15:17 +0000 (14:15 +1000)] 
More correctly implement ends with label sequence check

string.endswith("label.sequence") doesn't check for the implict
period before "label.sequence" when matching longer strings.

"foo.label.sequence" should match but "foolabel.sequence shouldn't".

4 years agoAdd change entry and release note for GL #2665
Matthijs Mekking [Fri, 13 Aug 2021 07:52:50 +0000 (09:52 +0200)] 
Add change entry and release note for GL #2665

4 years agoDon't use stale nodes when looking up a zonecut
Matthijs Mekking [Wed, 11 Aug 2021 08:31:56 +0000 (10:31 +0200)] 
Don't use stale nodes when looking up a zonecut

When looking up a zonecut in cache, we use 'dns_rbt_findnode' to find
the closest matching node. This function however does not take into
account stale nodes. When we do find a stale node and use it, this
has implications for subsequent lookups. For example, this may break
QNAME minimization because we are using a deeper zonecut than we should
have.

Check the header for staleness and if so, and stale entries are not
accepted, look for the deepest zonecut from this node up.

4 years agoAdd extra checks for !ANCIENT(header)
Matthijs Mekking [Tue, 10 Aug 2021 10:18:12 +0000 (12:18 +0200)] 
Add extra checks for !ANCIENT(header)

There are some occurrences where we check if a header exists in the
rbtdb. These cases require that the header is also not marked as
ancient (aka ready for cleanup). These cases involve finding certain
data in cache.

4 years agoAdd qmin test cases when RRset has expired
Matthijs Mekking [Fri, 13 Aug 2021 07:24:11 +0000 (09:24 +0200)] 
Add qmin test cases when RRset has expired

Add test cases for GL #2665: The QNAME minimization (if enabled) should
also occur on the second query, after the RRsets have expired from
cache. BIND will still have the entries in cache, but marked stale.
These stale entries should not prevent the resolver from minimizing
the QNAME. We query for the test domain a.b.stale. in all cases (QNAME
minimization off, strict mode, and relaxed mode) and expect it to
behave the same the second time we have a stale delegation structure in
cache.

4 years agoMerge branch 'feature/master/dig-return-codes' into 'main'
Evan Hunt [Thu, 12 Aug 2021 17:33:16 +0000 (17:33 +0000)] 
Merge branch 'feature/master/dig-return-codes' into 'main'

Document return codes of dig

See merge request isc-projects/bind9!2688

4 years agoDocument return codes of dig
Petr Menšík [Mon, 18 Nov 2019 21:19:21 +0000 (22:19 +0100)] 
Document return codes of dig

The dig tool reports some states as exit status. Document them briefly
in the manual page.

4 years agoMerge branch '2785-resconf-timeout-retry.conf' into 'main'
Evan Hunt [Thu, 12 Aug 2021 17:19:15 +0000 (17:19 +0000)] 
Merge branch '2785-resconf-timeout-retry.conf' into 'main'

Parse timeout and attempts from resolv.conf

Closes #2785

See merge request isc-projects/bind9!5273

4 years agoCHANGES [GL #2785]
Petr Menšík [Tue, 20 Jul 2021 17:45:16 +0000 (19:45 +0200)] 
CHANGES [GL #2785]

4 years agoCheck parsed resconf values
Petr Menšík [Tue, 20 Jul 2021 17:34:42 +0000 (19:34 +0200)] 
Check parsed resconf values

Add 'attempts' check, fix 'ndots' data. Create a bunch of verification
functions and check parsed values, not just return codes.

4 years agoParse 'timeout' and 'attempts' from resolv.conf
Petr Menšík [Tue, 22 Jun 2021 14:35:46 +0000 (16:35 +0200)] 
Parse 'timeout' and 'attempts' from resolv.conf

It was supported by lwres in BIND 9.11, and is still mentioned in
the manual page. Restore support for it by adding it to libirs.

4 years agoMerge branch 'artem/doh-mem-alloc-optimisations' into 'main'
Artem Boldariev [Thu, 12 Aug 2021 11:53:54 +0000 (11:53 +0000)] 
Merge branch 'artem/doh-mem-alloc-optimisations' into 'main'

Optimise memory usage in the DoH code and fix a hard-to-reproduce crash

See merge request isc-projects/bind9!5309

4 years agoAdd a CHANGES entry for the crash fix [GL #2851]
Artem Boldariev [Thu, 5 Aug 2021 13:01:04 +0000 (16:01 +0300)] 
Add a CHANGES entry for the crash fix [GL #2851]

This commit adds a CHANGES entry for the fixed crash, caused by
detaching from the session->handle too early when sending HTTP/2
session data.

4 years agoFix the doh_recv_send() logic in the doh_test
Artem Boldariev [Thu, 5 Aug 2021 09:42:40 +0000 (12:42 +0300)] 
Fix the doh_recv_send() logic in the doh_test

The commit fixes the doh_recv_send() because occasionally it would
fail because it did not wait for all responses to be sent, making the
check for ssends value to nit pass.

4 years agoOptimise TLS stream for small write size (>= 512 bytes)
Artem Boldariev [Mon, 2 Aug 2021 14:15:13 +0000 (17:15 +0300)] 
Optimise TLS stream for small write size (>= 512 bytes)

This commit changes TLS stream behaviour in such a way, that it is now
optimised for small writes. In the case there is a need to write less
or equal to 512 bytes, we could avoid calling the memory allocator at
the expense of possibly slight increase in memory usage. In case of
larger writes, the behviour remains unchanged.

4 years agoAvoid memory copying during send in TLS stream
Artem Boldariev [Mon, 2 Aug 2021 11:43:54 +0000 (14:43 +0300)] 
Avoid memory copying during send in TLS stream

At least at this point doing memory copying is not required. Probably
it was a workaround for some problem in the earlier days of DoH, at
this point it appears to be a waste of CPU cycles.

4 years agoSimplify buffering code logic in http_send_outgoing()
Artem Boldariev [Fri, 30 Jul 2021 10:02:41 +0000 (13:02 +0300)] 
Simplify buffering code logic in http_send_outgoing()

This commit significantly simplifies the code in http_send_outgoing()
as it was unnecessary complicated, because it was dealing with
multiple statically and dynamically allocated buffers, making it
extremely hard to follow, as well as making it to do unnecessary
memory copying in some situations. This commit fixes these issues,
while retaining the high level buffering logic.

4 years agoDoH: replace a custom buffer code for POST data with isc_buffer_t
Artem Boldariev [Thu, 29 Jul 2021 08:43:29 +0000 (11:43 +0300)] 
DoH: replace a custom buffer code for POST data with isc_buffer_t

This commit replaces the custom buffer code in client-side DoH code
intended to keep track of POST data, with isc_buffer_t.

4 years agoWhen terminating a client session, mark it as closing
Artem Boldariev [Thu, 29 Jul 2021 07:46:34 +0000 (10:46 +0300)] 
When terminating a client session, mark it as closing

When an HTTP/2 client terminates a session it means that it is about
to close the underlying connection. However, we were not doing that.
As a result, with the latest changes to the test suite, which made it
to limit amount of requests per a transport connection, the tests
using quota would hang for quite a while. This commit fixes that.

4 years agoLimit the number of requests sent per connection in DoH tests
Artem Boldariev [Wed, 28 Jul 2021 16:30:30 +0000 (19:30 +0300)] 
Limit the number of requests sent per connection in DoH tests

This commit ensures that only a limited number of requests is going to
be sent over a single HTTP/2 connection. Before that change was
introduced, it was possible to complete all of the planned sends via
only one transport connection, which undermines the purpose of the
tests using the quota facility.

4 years agoDo not call http_do_bio() in isc__nm_http_request()
Artem Boldariev [Wed, 28 Jul 2021 13:44:46 +0000 (16:44 +0300)] 
Do not call http_do_bio() in isc__nm_http_request()

The function should not be called here because it is, in general,
supposed to be called at the end of the transport level callbacks to
perform I/O, and thus, calling it here is clearly a mistake because it
breaks other code expectations. As a result of the call to
http_do_bio() from within isc__nm_http_request() the unit tests were
running slower than expected in some situations.

In this particular situation http_do_bio() is going to be called at
the end of the transport_connect_cb() (initially), or http_readcb(),
sending all of the scheduled requests at once.

This change affects only the test suite because it is the only place
in the codebase where isc__nm_http_request() is used in order to
ensure that the server is able to handle multiple HTTP/2 streams at
once.

4 years agoFix a crash by attach to the transport socket as early as possible
Artem Boldariev [Wed, 21 Jul 2021 21:04:02 +0000 (00:04 +0300)] 
Fix a crash by attach to the transport socket as early as possible

This commit fixes a crash in DoH caused by transport handle to be
detached too early when sending outgoing data.

We need to attach to the session->handle earlier because as an
indirect result of the nghttp2_session_mem_send() the session might
get closed and the handle detached. However, there is still might be
some outgoing data to handle. Besides, even when the underlying socket
was closed via the handle, we still should try to attempt to send
outgoing data via isc_nm_send() to let it call write callback, passed
to the http_send_outgoing().

4 years agoUse isc_buffer_t to keep track of outgoing response
Artem Boldariev [Wed, 21 Jul 2021 20:23:58 +0000 (23:23 +0300)] 
Use isc_buffer_t to keep track of outgoing response

This commit gets rid of custom code taking care of response buffering
by replacing the custom code with isc_buffer_t. Also, it gets rid of
an unnecessary memory copying when sending a response.

4 years agoUse isc_buffer_t to keep track of incoming POST data
Artem Boldariev [Wed, 21 Jul 2021 17:10:46 +0000 (20:10 +0300)] 
Use isc_buffer_t to keep track of incoming POST data

This commit replaces the ad-hoc 64K buffer for incoming POST data with
isc_buffer_t backed by dynamically allocated buffer sized accordingly
to the value in the "Content-Length" header.

4 years agoDoH: isc__buffer_usedregion->isc_buffer_usedregion in client_send()
Artem Boldariev [Wed, 21 Jul 2021 17:03:44 +0000 (20:03 +0300)] 
DoH: isc__buffer_usedregion->isc_buffer_usedregion in client_send()

This commit replaces wrong usage of  isc__buffer_usedregion() instead
of implied  isc_buffer_usedregion().