Commit Graph

34447 Commits

Author SHA1 Message Date
Michał Kępień
fcd0e218ff Tweak and reword recent CHANGES entries 2021-08-19 07:12:33 +02:00
Michał Kępień
5b796b4bc2 Tweak library requirements in PLATFORMS.md 2021-08-19 07:12:33 +02:00
Michał Kępień
b541677c4e Tweak jemalloc warning text in configure.ac 2021-08-19 07:12:33 +02:00
Michal Nowak
d3d32683c0 Fix typos in lib/isc/trampoline_p.h 2021-08-19 07:12:33 +02:00
Michal Nowak
513e58d53a 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
2021-08-19 07:12:33 +02:00
Evan Hunt
265fae928a Add CHANGES and release notes for [GL #2839] 2021-08-19 07:12:33 +02:00
Ondřej Surý
87d5c8ab7c 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.
2021-08-19 07:12:33 +02:00
Evan Hunt
69243a0f56 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 a3ba95116e
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.
2021-08-19 07:12:33 +02:00
Mark Andrews
0a30e17b48 Merge branch 'marka-fix-format' into 'main'
Use %d for enum values

See merge request isc-projects/bind9!5335
2021-08-19 05:09:58 +00:00
Mark Andrews
89fe8e920c Use %d for enum values 2021-08-19 10:19:32 +10:00
Mark Andrews
4d435eb02b Merge branch '1132-wip-httpssvc-record' into 'main'
Resolve "HTTPS and SVCB records"

Closes #1132

See merge request isc-projects/bind9!2135
2021-08-18 04:35:11 +00:00
Mark Andrews
8ebb05b0b7 Add CHANGES and release notes 2021-08-18 13:51:38 +10:00
Mark Andrews
f6bfc685aa Add check-names for svbc (https) server name examples 2021-08-18 13:49:48 +10:00
Mark Andrews
f46a0c27df Check that the hostname of the server is legal 2021-08-18 13:49:48 +10:00
Mark Andrews
26b22a1445 add tests for string and qstring 2021-08-18 13:49:48 +10:00
Mark Andrews
a6357d8b5c Add unit test for keypair 2021-08-18 13:49:48 +10:00
Mark Andrews
cd985d96e3 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.
2021-08-18 13:49:48 +10:00
Mark Andrews
baaa5492ee add svcb fuzzing seed 2021-08-18 13:49:48 +10:00
Mark Andrews
bc21015438 Add invalid test vectors 2021-08-18 13:49:48 +10:00
Mark Andrews
3e459b4808 add text vs unknown test vectors 2021-08-18 13:49:48 +10:00
Mark Andrews
36f34a3e79 Parse and print HTTPS and SVCB records 2021-08-18 13:49:48 +10:00
Mark Andrews
42c22670b3 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.
2021-08-18 13:49:48 +10:00
Mark Andrews
f0265b8fa6 Make whether to follow additional data records generic
Adds dns_rdatatype_followadditional() and
DNS_RDATATYPEATTR_FOLLOWADDITIONAL
2021-08-18 13:49:48 +10:00
Mark Andrews
b5b6c1f6d8 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
2021-08-18 02:51:02 +00:00
Mark Andrews
e690b4dfad Add CHANGES for [GL #2319] 2021-08-18 09:44:50 +10:00
Mark Andrews
85a639f5fb Test dig +showbadcookie 2021-08-18 09:44:50 +10:00
Mark Andrews
4f9a1b03dc Add the ability to display the BADCOOKIE message in dig when
+badcookie is in effect.
2021-08-18 09:44:50 +10:00
Matthijs Mekking
f6999fb0ff 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
2021-08-16 15:06:09 +00:00
Matthijs Mekking
598bf1c29b 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.
2021-08-16 15:05:46 +00:00
Matthijs Mekking
b98594e048 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
2021-08-16 14:41:40 +00:00
Mark Andrews
f79876b2d5 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".
2021-08-16 14:15:17 +10:00
Matthijs Mekking
192329d3c6 Add change entry and release note for GL #2665 2021-08-13 11:37:52 +02:00
Matthijs Mekking
bc448fb3b1 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.
2021-08-13 11:37:52 +02:00
Matthijs Mekking
e2d4896864 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.
2021-08-13 09:42:34 +02:00
Matthijs Mekking
322626ab5b 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.
2021-08-13 09:42:34 +02:00
Evan Hunt
502f48aad0 Merge branch 'feature/master/dig-return-codes' into 'main'
Document return codes of dig

See merge request isc-projects/bind9!2688
2021-08-12 17:33:16 +00:00
Petr Menšík
f20cc30a6a Document return codes of dig
The dig tool reports some states as exit status. Document them briefly
in the manual page.
2021-08-12 10:27:24 -07:00
Evan Hunt
5f9d312868 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
2021-08-12 17:19:15 +00:00
Petr Menšík
abfbb575a5 CHANGES [GL #2785] 2021-08-12 09:53:35 -07:00
Petr Menšík
48d5b50313 Check parsed resconf values
Add 'attempts' check, fix 'ndots' data. Create a bunch of verification
functions and check parsed values, not just return codes.
2021-08-12 09:52:52 -07:00
Petr Menšík
dbf71b3f68 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.
2021-08-12 09:52:52 -07:00
Artem Boldariev
47cf5c1787 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
2021-08-12 11:53:54 +00:00
Artem Boldariev
f85d899f55 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.
2021-08-12 14:31:44 +03:00
Artem Boldariev
d72b1fa5cd 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.
2021-08-12 14:28:17 +03:00
Artem Boldariev
e639957b58 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.
2021-08-12 14:28:17 +03:00
Artem Boldariev
e301e1e3b8 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.
2021-08-12 14:28:17 +03:00
Artem Boldariev
bd69c7c57c 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.
2021-08-12 14:28:17 +03:00
Artem Boldariev
a32faa20b4 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.
2021-08-12 14:28:17 +03:00
Artem Boldariev
5b52a7e37e 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.
2021-08-12 14:28:17 +03:00
Artem Boldariev
dbca22877a 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.
2021-08-12 14:28:16 +03:00