]> git.ipfire.org Git - thirdparty/knot-resolver.git/log
thirdparty/knot-resolver.git
4 years agoWIP selection_wip
Štěpán Balážik [Fri, 6 Nov 2020 14:40:59 +0000 (15:40 +0100)] 
WIP

4 years agoselection: further NSNXAttack mitigation and fix tests
Štěpán Balážik [Fri, 6 Nov 2020 11:23:11 +0000 (12:23 +0100)] 
selection: further NSNXAttack mitigation and fix tests

4 years agofixup! fixup! selection: support serve_stale module
Štěpán Balážik [Fri, 6 Nov 2020 11:20:15 +0000 (12:20 +0100)] 
fixup! fixup! selection: support serve_stale module

4 years agofixup! tests: replace cache_overflow test, fix its config file
Štěpán Balážik [Mon, 26 Oct 2020 17:33:24 +0000 (18:33 +0100)] 
fixup! tests: replace cache_overflow test, fix its config file

4 years agomitigate NXNSAttack protocol vulnerability for wildcards in victim zone
Vladimír Čunát [Tue, 5 May 2020 09:32:02 +0000 (11:32 +0200)] 
mitigate NXNSAttack protocol vulnerability for wildcards in victim zone

Attacker might generate fake NS records pointing to victim's DNS zone.
If the zone contains wildcard the attacker might force us into packet
exchange with a (lame) DNS server on that IP address.

We now limit number of consecuctive failures and kill whole request if
limit is exceeded.

4 years agotests: replace cache_overflow test, fix its config file
Štěpán Balážik [Mon, 26 Oct 2020 16:52:29 +0000 (17:52 +0100)] 
tests: replace cache_overflow test, fix its config file

4 years agofixup! selection: support serve_stale module
Štěpán Balážik [Mon, 26 Oct 2020 10:56:57 +0000 (11:56 +0100)] 
fixup! selection: support serve_stale module

4 years agoWIP: broken Deckard tests turned off
Štěpán Balážik [Mon, 26 Oct 2020 10:43:52 +0000 (11:43 +0100)] 
WIP: broken Deckard tests turned off

4 years agotests: turn off IPv6 where neccesary
Štěpán Balážik [Mon, 26 Oct 2020 10:41:43 +0000 (11:41 +0100)] 
tests: turn off IPv6 where neccesary

4 years agodeckard: update to WIP branch
Štěpán Balážik [Mon, 19 Oct 2020 16:01:43 +0000 (18:01 +0200)] 
deckard: update to WIP branch

4 years agoselection: turn on SAFEMODE on FORMERROR
Štěpán Balážik [Mon, 19 Oct 2020 15:14:22 +0000 (17:14 +0200)] 
selection: turn on SAFEMODE on FORMERROR

4 years agoselection: retry after DNSSEC fail
Štěpán Balážik [Mon, 19 Oct 2020 14:23:40 +0000 (16:23 +0200)] 
selection: retry after DNSSEC fail

Some other server might not have bogus signatures.

4 years agoselection: properly check for cyclic NS dependencies
Štěpán Balážik [Fri, 16 Oct 2020 14:24:15 +0000 (16:24 +0200)] 
selection: properly check for cyclic NS dependencies

This is kind of done in ns_resolve_addr as well, but we need this
information *before* making the choice.

4 years agoresolve.c: reintroduce reset of flags.AWAIT_IPV{4,6} after resolution
Štěpán Balážik [Fri, 16 Oct 2020 12:39:47 +0000 (14:39 +0200)] 
resolve.c: reintroduce reset of flags.AWAIT_IPV{4,6} after resolution

I deleted it by accident as it was hidden in some older nsrep function.

4 years agoselection: avoid chicken and egg problem when resolving . DS
Štěpán Balážik [Fri, 16 Oct 2020 10:39:12 +0000 (12:39 +0200)] 
selection: avoid chicken and egg problem when resolving . DS

4 years agoiterate.c: be parent-centric in NS name resolution
Štěpán Balážik [Thu, 15 Oct 2020 16:47:55 +0000 (18:47 +0200)] 
iterate.c: be parent-centric in NS name resolution

When qry->flags.NONAUTH is true (we are resolving a NS name) end the
resolution once a answer is found even in glue.

Previous state lead to a weird behaviour where some IPv4 only tests in
Deckard (namely `iter_pcdiff.rpl`) were failing with IPv6 turned off.

This was due to the resolvers' internal preference towards AAAA records
for NS names. With IPv6 networking on, NS name resolution was first done
for AAAA record and the glue (containing A record for the NS name in
question) from parent zone was in to cache.

As the AAAA resolution failed (there is no AAAA for this NS name), A was
quried next and was satisfied from cache.

With IPv6 off, there is no query for the AAAA record, so no A record
from glue gets put in to the cache. A record is resolved first,
resolution ignores the glue in parent zone and continue to the child
zone which might be (and in the case of `iter_pcdiff.rpl` intentionally
is) broken.

4 years agoWIP: always explore
Štěpán Balážik [Thu, 15 Oct 2020 12:11:42 +0000 (14:11 +0200)] 
WIP: always explore

Make Deckard go BOOM 🤯

4 years agofixup! selection_iter: treat resolving A and AAAA records for NS names equally
Štěpán Balážik [Mon, 12 Oct 2020 15:56:22 +0000 (17:56 +0200)] 
fixup! selection_iter: treat resolving A and AAAA records for NS names equally

4 years agofixup! selection: readd CNAME error handling
Štěpán Balážik [Mon, 12 Oct 2020 15:13:53 +0000 (17:13 +0200)] 
fixup! selection: readd CNAME error handling

4 years agofixup! selection_iter: treat resolving A and AAAA records for NS names equally
Štěpán Balážik [Mon, 12 Oct 2020 09:23:18 +0000 (11:23 +0200)] 
fixup! selection_iter: treat resolving A and AAAA records for NS names equally

4 years agoselection: readd CNAME error handling
Štěpán Balážik [Mon, 12 Oct 2020 08:45:38 +0000 (10:45 +0200)] 
selection: readd CNAME error handling

4 years agofixup! selection_iter: treat resolving A and AAAA records for NS names equally
Štěpán Balážik [Mon, 12 Oct 2020 08:31:15 +0000 (10:31 +0200)] 
fixup! selection_iter: treat resolving A and AAAA records for NS names equally

4 years agoselection_iter: treat resolving A and AAAA records for NS names equally
Štěpán Balážik [Fri, 9 Oct 2020 15:59:35 +0000 (17:59 +0200)] 
selection_iter: treat resolving A and AAAA records for NS names equally

Before, there was some bias towards resolving AAAA records first and
resolving A records only when IPv6 is broken or not available.

4 years agoselection: support serve_stale module
Štěpán Balážik [Fri, 9 Oct 2020 14:54:01 +0000 (16:54 +0200)] 
selection: support serve_stale module

4 years agoselection: set default timeout to 800 ms
Štěpán Balážik [Fri, 9 Oct 2020 09:15:03 +0000 (11:15 +0200)] 
selection: set default timeout to 800 ms

This is pretty much equivalent to the state before rewrite.

4 years agofixup! selection: try to resolve NS addr instead of choosing the same server
Štěpán Balážik [Thu, 10 Sep 2020 11:50:26 +0000 (13:50 +0200)] 
fixup! selection: try to resolve NS addr instead of choosing the same server

4 years agofixup! attempt at removing cycles and leaks in the async resolution
Štěpán Balážik [Thu, 10 Sep 2020 11:44:03 +0000 (13:44 +0200)] 
fixup! attempt at removing cycles and leaks in the async resolution

4 years agoselection: try to resolve NS addr instead of choosing the same server
Štěpán Balážik [Thu, 10 Sep 2020 11:39:24 +0000 (13:39 +0200)] 
selection: try to resolve NS addr instead of choosing the same server

4 years agofixup! attempt at removing cycles and leaks in the async resolution
Štěpán Balážik [Thu, 10 Sep 2020 11:39:00 +0000 (13:39 +0200)] 
fixup! attempt at removing cycles and leaks in the async resolution

4 years agoselection: don't query asynchronously, as it creates problems
Štěpán Balážik [Thu, 10 Sep 2020 11:33:53 +0000 (13:33 +0200)] 
selection: don't query asynchronously, as it creates problems

I can't see a simple way to prevent cycles.
Also, there were some weird memory leaks caused by it.

4 years agoattempt at removing cycles and leaks in the async resolution
Štěpán Balážik [Thu, 10 Sep 2020 11:36:41 +0000 (13:36 +0200)] 
attempt at removing cycles and leaks in the async resolution

4 years agoselection: asynchronously resolve NS name with each selection
Štěpán Balážik [Wed, 9 Sep 2020 14:47:03 +0000 (16:47 +0200)] 
selection: asynchronously resolve NS name with each selection

4 years agoselection: remove per server error limit
Štěpán Balážik [Wed, 9 Sep 2020 12:21:17 +0000 (14:21 +0200)] 
selection: remove per server error limit

It was causing too much trouble as we are counting timeouts as errors.
Servers that timeouted twice were removed from the choice forever
causing the resolution to get stuck.

4 years agoselection: limit backing of the timeout
Štěpán Balážik [Tue, 8 Sep 2020 09:51:25 +0000 (11:51 +0200)] 
selection: limit backing of the timeout

4 years agofixup! format: convert to using tabs in new files
Štěpán Balážik [Tue, 8 Sep 2020 09:45:12 +0000 (11:45 +0200)] 
fixup! format: convert to using tabs in new files

4 years agologging: report NS resolution more clearly
Štěpán Balážik [Tue, 8 Sep 2020 09:43:32 +0000 (11:43 +0200)] 
logging: report NS resolution more clearly

4 years agowip: more docs
Štěpán Balážik [Tue, 8 Sep 2020 09:43:10 +0000 (11:43 +0200)] 
wip: more docs

4 years agofixup! format: convert to using tabs in new files
Štěpán Balážik [Tue, 8 Sep 2020 09:42:44 +0000 (11:42 +0200)] 
fixup! format: convert to using tabs in new files

4 years agofixup! selection: don't include servers over error limit in selection
Štěpán Balážik [Fri, 4 Sep 2020 15:36:40 +0000 (17:36 +0200)] 
fixup! selection: don't include servers over error limit in selection

4 years agoselection: switch to TCP on truncated
Štěpán Balážik [Fri, 4 Sep 2020 15:05:42 +0000 (17:05 +0200)] 
selection: switch to TCP on truncated

4 years agoselection: don't include servers over error limit in selection
Štěpán Balážik [Fri, 4 Sep 2020 14:50:26 +0000 (16:50 +0200)] 
selection: don't include servers over error limit in selection

4 years agoWIP: timeout tweaks
Štěpán Balážik [Thu, 3 Sep 2020 14:36:56 +0000 (16:36 +0200)] 
WIP: timeout tweaks

Set retries to 10 and static forwarding timeout to 2000 ms.

4 years agowip: doc
Štěpán Balážik [Thu, 3 Sep 2020 14:18:36 +0000 (16:18 +0200)] 
wip: doc

4 years agofixup! format: convert to using tabs in new files
Štěpán Balážik [Thu, 3 Sep 2020 12:01:11 +0000 (14:01 +0200)] 
fixup! format: convert to using tabs in new files

4 years agofixup! first buildable version of server selection rewrite
Štěpán Balážik [Thu, 3 Sep 2020 11:53:54 +0000 (13:53 +0200)] 
fixup! first buildable version of server selection rewrite

4 years agoselection: limit timeout from above and edit the test accordingly
Štěpán Balážik [Thu, 3 Sep 2020 10:39:03 +0000 (12:39 +0200)] 
selection: limit timeout from above and edit the test accordingly

4 years agoselection: set default timeout to 400 ms
Štěpán Balážik [Thu, 3 Sep 2020 10:09:47 +0000 (12:09 +0200)] 
selection: set default timeout to 400 ms

This lowers number of timeouts on unknown zones.

4 years agoselection: support custom port when forwarding
Štěpán Balážik [Thu, 3 Sep 2020 08:49:34 +0000 (10:49 +0200)] 
selection: support custom port when forwarding

4 years agoformat: convert to using tabs in new files
Štěpán Balážik [Tue, 1 Sep 2020 08:04:29 +0000 (10:04 +0200)] 
format: convert to using tabs in new files

4 years agoselection_iter: only update state for ;valid addresses
Štěpán Balážik [Tue, 1 Sep 2020 08:02:12 +0000 (10:02 +0200)] 
selection_iter: only update state for ;valid addresses

4 years agoselection: no need to track current zonecut in iter_local_state
Štěpán Balážik [Tue, 1 Sep 2020 08:00:20 +0000 (10:00 +0200)] 
selection: no need to track current zonecut in iter_local_state

4 years agoselection: rename *_state_init to *_state_alloc
Štěpán Balážik [Tue, 1 Sep 2020 07:58:43 +0000 (09:58 +0200)] 
selection: rename *_state_init to *_state_alloc

4 years agoselection: fix reporting of deduplicated packet
Štěpán Balážik [Tue, 1 Sep 2020 07:55:06 +0000 (09:55 +0200)] 
selection: fix reporting of deduplicated packet

4 years agoselection: fix TLS forwarding
Štěpán Balážik [Sat, 29 Aug 2020 16:32:01 +0000 (18:32 +0200)] 
selection: fix TLS forwarding

4 years agoRevert "WIP: change scan-build error number due to error in stats"
Štěpán Balážik [Sat, 29 Aug 2020 16:10:00 +0000 (18:10 +0200)] 
Revert "WIP: change scan-build error number due to error in stats"

This reverts commit e9ba1cd4826942f2ef4b2f326c0a8d7bc5032f24.

4 years agofixup! fix various mistakes found by static analysis
Štěpán Balážik [Sat, 29 Aug 2020 16:08:16 +0000 (18:08 +0200)] 
fixup! fix various mistakes found by static analysis

4 years agodoc: rename nsrep to selection
Štěpán Balážik [Sat, 29 Aug 2020 15:59:50 +0000 (17:59 +0200)] 
doc: rename nsrep to selection

4 years agoWIP: change scan-build error number due to error in stats
Štěpán Balážik [Sat, 29 Aug 2020 15:57:40 +0000 (17:57 +0200)] 
WIP: change scan-build error number due to error in stats

4 years agofix various mistakes found by static analysis
Štěpán Balážik [Sat, 29 Aug 2020 15:31:41 +0000 (17:31 +0200)] 
fix various mistakes found by static analysis

4 years agoselection: also cache timeouts as part of the global cache
Štěpán Balážik [Sat, 29 Aug 2020 14:04:30 +0000 (16:04 +0200)] 
selection: also cache timeouts as part of the global cache

4 years agoselection: shuffle before choosing
Štěpán Balážik [Sat, 29 Aug 2020 13:09:35 +0000 (15:09 +0200)] 
selection: shuffle before choosing

this ensures fair distribution of queries after resolver start
e.g. in priming

4 years agoselection: fix race condition when updating rtt cache
Štěpán Balážik [Sat, 29 Aug 2020 12:32:57 +0000 (14:32 +0200)] 
selection: fix race condition when updating rtt cache

4 years agoselection: exponential back off after timeout
Štěpán Balážik [Sat, 29 Aug 2020 12:30:06 +0000 (14:30 +0200)] 
selection: exponential back off after timeout

4 years agonsrep: count timeouts per query
Štěpán Balážik [Sat, 29 Aug 2020 12:13:38 +0000 (14:13 +0200)] 
nsrep: count timeouts per query

4 years agofirst buildable version of server selection rewrite
Štěpán Balážik [Fri, 20 Mar 2020 18:43:11 +0000 (19:43 +0100)] 
first buildable version of server selection rewrite

4 years agoMerge branch '251-warn-if-static-unmanaged-key-is-used' into 'master' obs-knot-dns-deve-jq0xxt/deployments/1175 obs-knot-resolver-es11k1/deployments/1174
Tomas Krizek [Thu, 15 Oct 2020 11:17:08 +0000 (13:17 +0200)] 
Merge branch '251-warn-if-static-unmanaged-key-is-used' into 'master'

Resolve "warn if static (unmanaged) key is used"

Closes #251

See merge request knot/knot-resolver!1051

4 years agomodules/ta_update: improve warning message
Lukáš Ježek [Tue, 13 Oct 2020 09:13:00 +0000 (11:13 +0200)] 
modules/ta_update: improve warning message

4 years agomodules/ta_update nitpick: don't call os.time() again
Vladimír Čunát [Thu, 13 Aug 2020 11:42:40 +0000 (13:42 +0200)] 
modules/ta_update nitpick: don't call os.time() again

4 years agotests: replace the deprecated -f parameter
Vladimír Čunát [Mon, 5 Oct 2020 17:44:16 +0000 (19:44 +0200)] 
tests: replace the deprecated -f parameter

4 years agomodules/ta_update: warn if there are differences between statically configured keys...
Lukáš Ježek [Tue, 25 Aug 2020 10:03:10 +0000 (12:03 +0200)] 
modules/ta_update: warn if there are differences between statically configured keys and upstream

4 years agota_update: rfc5011 test: fix knotd startup
Lukáš Ježek [Fri, 14 Aug 2020 09:50:05 +0000 (11:50 +0200)] 
ta_update: rfc5011 test: fix knotd startup

4 years agota_update: rfc5011 test: removing the missing -r parameter for dnssec-tools
Lukáš Ježek [Fri, 14 Aug 2020 09:28:40 +0000 (11:28 +0200)] 
ta_update: rfc5011 test: removing the missing -r parameter for dnssec-tools

4 years agoMerge branch 'doh-module-c' into 'master' obs-knot-dns-deve-jq0xxt/deployments/1164 obs-knot-dns-deve-jq0xxt/deployments/1168 obs-knot-resolver-es11k1/deployments/1165 obs-knot-resolver-es11k1/deployments/1169
Lukas Jezek [Tue, 13 Oct 2020 12:23:06 +0000 (14:23 +0200)] 
Merge branch 'doh-module-c' into 'master'

doh2: C implementation of DoH using nghttp2

Closes #600

See merge request knot/knot-resolver!997

4 years agodaemon/http: fix double-free on some pkt send failures
Tomas Krizek [Wed, 7 Oct 2020 13:14:09 +0000 (15:14 +0200)] 
daemon/http: fix double-free on some pkt send failures

When http_write() returns non-zero, worker_submit() performs the task
cleanup and calling on_write() callback only causes double free.

4 years agodoc: update doh/doh2 documentation
Tomas Krizek [Thu, 27 Aug 2020 13:01:00 +0000 (15:01 +0200)] 
doc: update doh/doh2 documentation

4 years agodistro/*: update module-http packaging description
Tomas Krizek [Mon, 5 Oct 2020 14:15:21 +0000 (16:15 +0200)] 
distro/*: update module-http packaging description

4 years agodaemon: add deprecation warning for old DoH implementation
Tomas Krizek [Fri, 2 Oct 2020 11:31:25 +0000 (13:31 +0200)] 
daemon: add deprecation warning for old DoH implementation

4 years agodaemon/http: document unsupported interleaving DATA
Tomas Krizek [Fri, 2 Oct 2020 10:31:32 +0000 (12:31 +0200)] 
daemon/http: document unsupported interleaving DATA

4 years agodaemon/http: replace strchrnul for mac os compatibility
Tomas Krizek [Fri, 2 Oct 2020 08:43:15 +0000 (10:43 +0200)] 
daemon/http: replace strchrnul for mac os compatibility

strchrnul() is a GNU extension that is not available on Mac OS.

4 years agodaemon/http: log connection errors to verbose
Tomas Krizek [Fri, 2 Oct 2020 08:16:30 +0000 (10:16 +0200)] 
daemon/http: log connection errors to verbose

4 years agoluacheck: comment out unused code and variables
Tomas Krizek [Fri, 2 Oct 2020 08:07:07 +0000 (10:07 +0200)] 
luacheck: comment out unused code and variables

4 years agotests/config: doh2 - use tabs for indentation
Tomas Krizek [Fri, 2 Oct 2020 08:02:17 +0000 (10:02 +0200)] 
tests/config: doh2 - use tabs for indentation

4 years agotests/config: modify doh tests for doh2
Tomas Krizek [Thu, 1 Oct 2020 15:07:23 +0000 (17:07 +0200)] 
tests/config: modify doh tests for doh2

Test only supported test-cases. Extend list of lua dependencies
for config tests.

4 years agotests/config: import tests from lua-http doh
Tomas Krizek [Thu, 1 Oct 2020 12:32:59 +0000 (14:32 +0200)] 
tests/config: import tests from lua-http doh

4 years agodaemon/http: make sure uv_handle is always initialized
Tomas Krizek [Thu, 1 Oct 2020 12:09:47 +0000 (14:09 +0200)] 
daemon/http: make sure uv_handle is always initialized

It is later closed in endpoint_close(), which would fail with assert if
not initialized (e.g. when compiled without nghttp2 support and
attempting to use doh2 kind).

4 years agodaemon: make nghttp2 optional
Tomas Krizek [Wed, 30 Sep 2020 12:10:23 +0000 (14:10 +0200)] 
daemon: make nghttp2 optional

4 years agodaemon/http: remove plain HTTP implementation artifacts
Tomas Krizek [Wed, 30 Sep 2020 12:09:32 +0000 (14:09 +0200)] 
daemon/http: remove plain HTTP implementation artifacts

4 years agocontrib/base64: sync with Knot DNS
Tomas Krizek [Fri, 25 Sep 2020 13:35:20 +0000 (15:35 +0200)] 
contrib/base64: sync with Knot DNS

4 years agodistro/tests: test_doh2 run curl test only when needed
Tomas Krizek [Fri, 25 Sep 2020 11:05:34 +0000 (13:05 +0200)] 
distro/tests: test_doh2 run curl test only when needed

4 years agodistro/tests: add tests for new DoH implementation
Jakub Ružička [Fri, 11 Sep 2020 17:33:20 +0000 (19:33 +0200)] 
distro/tests: add tests for new DoH implementation

* one test unsing curl and sha256sum (get_url can't do HTTP/2)
* one test using kdig when correct version is present

4 years agodistro: add new dependency: libnghttp2
Jakub Ružička [Wed, 9 Sep 2020 15:03:00 +0000 (17:03 +0200)] 
distro: add new dependency: libnghttp2

This is needed by new DoH implementation.

4 years agodaemon/io: use MANDATORY_APLN only with new gnutls
Tomas Krizek [Fri, 25 Sep 2020 08:58:08 +0000 (10:58 +0200)] 
daemon/io: use MANDATORY_APLN only with new gnutls

This is only needed to fail early during the handshake, if protocol
negotiation doesn't succeed. With older GnuTLS, if there's a protocol
mismatch, the data won't be understood and the connection will close
later on.

Mandatory ALPN doesn't affect clients that don't use the ALPN extension.

4 years agodaemon/bindings: assign doh2 kind in net.list()
Tomas Krizek [Fri, 11 Sep 2020 10:15:32 +0000 (12:15 +0200)] 
daemon/bindings: assign doh2 kind in net.list()

4 years agoDockerfile: add nghttp2 dependency
Tomas Krizek [Wed, 9 Sep 2020 09:56:14 +0000 (11:56 +0200)] 
Dockerfile: add nghttp2 dependency

4 years agodaemon/http: make lint happy
Tomas Krizek [Wed, 9 Sep 2020 09:34:13 +0000 (11:34 +0200)] 
daemon/http: make lint happy

4 years agodaemon/worker: simplify condition
Tomas Krizek [Tue, 8 Sep 2020 08:53:57 +0000 (10:53 +0200)] 
daemon/worker: simplify condition

4 years agodaemon: decrease write errors severity in log
Tomas Krizek [Wed, 2 Sep 2020 12:32:21 +0000 (14:32 +0200)] 
daemon: decrease write errors severity in log

4 years agodaemon/worker: expose number of write errors
Tomas Krizek [Wed, 2 Sep 2020 12:31:22 +0000 (14:31 +0200)] 
daemon/worker: expose number of write errors

4 years agodaemon/http: improve handling of incomplete streams
Tomas Krizek [Wed, 26 Aug 2020 10:14:48 +0000 (12:14 +0200)] 
daemon/http: improve handling of incomplete streams

4 years agodaemon/worker: ensure ignored queries pop from http stream id queue
Tomas Krizek [Tue, 25 Aug 2020 14:44:14 +0000 (16:44 +0200)] 
daemon/worker: ensure ignored queries pop from http stream id queue