]>
git.ipfire.org Git - thirdparty/knot-resolver.git/log
Petr Špaček [Wed, 17 Jan 2018 13:58:57 +0000 (14:58 +0100)]
policy TLS_FORWARD: unify logging format
Petr Špaček [Wed, 17 Jan 2018 13:37:16 +0000 (14:37 +0100)]
policy TLS_FORWARD: fix error reporting from net.tls_client()
Petr Špaček [Fri, 12 Jan 2018 15:57:03 +0000 (16:57 +0100)]
policy TLS_FORWARD: check parameters from user
Policy handling was split into smaller functions to allow easier
checking. The code needs further refactoring, it seems that
net_tls_client is just a thin wrapper around tls_client_params_set in C,
which is unnecessary and error prone.
Petr Špaček [Fri, 12 Jan 2018 13:59:59 +0000 (14:59 +0100)]
policy TLS_FORWARD: improve error reporting for invalid parameters
Petr Špaček [Fri, 12 Jan 2018 13:37:51 +0000 (14:37 +0100)]
tests: add config tests for TLS_FORWARD
Apparently some corner cases are not handled properly.
We need to fix these in follow-up patches.
Vladimír Čunát [Thu, 18 Jan 2018 11:50:33 +0000 (12:50 +0100)]
cache pkt: relax an assertion
I _think_ (pkt->parsed != pkt->size) didn't catch all KNOT_EMALF cases.
Petr Špaček [Thu, 18 Jan 2018 11:28:27 +0000 (12:28 +0100)]
Merge branch 'cleanup-errors' into 'master'
fix some errors found by static analyzer
See merge request knot/knot-resolver!446
Petr Špaček [Thu, 18 Jan 2018 09:43:54 +0000 (10:43 +0100)]
CI: tweak scan-build configuration
Clang right now does not support cleanup attribute which is causing
false positives, so the check is now disabled.
https://bugs.llvm.org/show_bug.cgi?id=3888
At the same time I've enabled all other checkers to see what happens. We
need to go though them and disable them one-by-one if necessary.
Vladimír Čunát [Thu, 18 Jan 2018 09:49:56 +0000 (10:49 +0100)]
treewide: safer structure literals and initialization
Based on C99 this was OK, see 6.7.8.19, 6.5.2.5.6 and 6.7.8.10.
Still, e.g. gcc 5.4 and 6.2 were mis-compiling some cases of this under
certain conditions (-O0), causing hard-to-track bugs. I've been unable
to find a problem in 5.5, 6.4 and 7.2 or older clang, but let's be on
the safer side nevertheless.
Marek Vavruša [Thu, 18 Jan 2018 00:55:52 +0000 (16:55 -0800)]
daemon/main: refactored keyfile initialization from main()
this helps avoid false positive leaks caused by combination of
cleanup functions and goto
refs #291
Marek Vavruša [Thu, 18 Jan 2018 00:57:49 +0000 (16:57 -0800)]
lib/dnssec: variable declaration close to intended to avoid dead stores
Marek Vavruša [Thu, 18 Jan 2018 00:57:00 +0000 (16:57 -0800)]
daemon/worker: fixed missing return value check
Marek Vavruša [Thu, 18 Jan 2018 00:54:55 +0000 (16:54 -0800)]
daemon/engine: fixed missing ret
Marek Vavruša [Thu, 18 Jan 2018 00:39:37 +0000 (16:39 -0800)]
daemon: fixed potential leak - cleanup not being called on longjmp
attribute cleanup (auto_free) gets called when variable goes out of
scope, not on longjmp (in lua_error), so the variable never gets freed
Petr Špaček [Wed, 17 Jan 2018 16:08:49 +0000 (17:08 +0100)]
Merge branch 'dockerfile-add-static-analysis-tools' into 'master'
Dockerfile: add static analysis tools
See merge request knot/knot-resolver!444
Vladimír Čunát [Wed, 17 Jan 2018 15:08:14 +0000 (16:08 +0100)]
cache entry_rr: fix two simple lint warnings
The first might have lead to a segfault
(not sure ATM, depends on callers).
Vladimír Čunát [Wed, 17 Jan 2018 14:51:16 +0000 (15:51 +0100)]
fix two trivial lint warnings
Vladimír Čunát [Wed, 17 Jan 2018 14:47:23 +0000 (15:47 +0100)]
utils knot_dname_lf2wire: fix a lint warning
Vladimír Čunát [Wed, 17 Jan 2018 13:55:45 +0000 (14:55 +0100)]
cache: another debugging check
Tomas Krizek [Tue, 16 Jan 2018 16:25:51 +0000 (17:25 +0100)]
Dockerfile: add static analysis tools
Vladimír Čunát [Tue, 16 Jan 2018 18:38:28 +0000 (19:38 +0100)]
WIP: fixing counterparts of the validator problems
TODO: re-check, do tests, etc.
Vladimír Čunát [Tue, 16 Jan 2018 14:13:13 +0000 (15:13 +0100)]
TMP Merge branch 'valid-nxdomain' into cache-aggr-wip
Vladimír Čunát [Mon, 15 Jan 2018 17:08:47 +0000 (18:08 +0100)]
validator nitpick: remove a useless dead store
Discovered by clang scan.
Vladimír Čunát [Fri, 5 Jan 2018 09:15:43 +0000 (10:15 +0100)]
validator: fix NSEC* + delegation -> NXDOMAIN
Vladimír Čunát [Fri, 12 Jan 2018 15:15:08 +0000 (16:15 +0100)]
validator: fix NSEC* -> NODATA
Vladimír Čunát [Mon, 15 Jan 2018 15:54:16 +0000 (16:54 +0100)]
cache: basic preparation for stale-serving
Petr Špaček [Fri, 12 Jan 2018 13:36:04 +0000 (14:36 +0100)]
Merge branch 'tls-hs-timeout' into 'master'
daemon: TLS-handshake timeout timer was not properly activated; fix
See merge request knot/knot-resolver!441
Grigorii Demidov [Fri, 12 Jan 2018 12:54:37 +0000 (13:54 +0100)]
daemon: TLS-handshake timeout timer was not properly activated; fix
Petr Špaček [Fri, 12 Jan 2018 10:24:22 +0000 (11:24 +0100)]
Merge branch 'stricter-ci-build' into 'master'
ci: add -Werror to CFLAGS, added clang build target
See merge request knot/knot-resolver!432
Marek Vavruša [Fri, 12 Jan 2018 07:11:08 +0000 (23:11 -0800)]
lint: enabled several readability linters and fixed issues
this checks things such as inconsistent declarations and definitions
Marek Vavruša [Fri, 12 Jan 2018 06:37:20 +0000 (22:37 -0800)]
daemon: fixed garbage read when getsockname fails
Marek Vavruša [Fri, 12 Jan 2018 06:29:24 +0000 (22:29 -0800)]
lib: fixed possible null pointers passed to nonnull arguments
Marek Vavruša [Fri, 12 Jan 2018 06:15:16 +0000 (22:15 -0800)]
daemon: fixed minor linter problems
Marek Vavruša [Fri, 12 Jan 2018 06:16:01 +0000 (22:16 -0800)]
client: fixed minor linter problems
Marek Vavruša [Fri, 12 Jan 2018 06:07:30 +0000 (22:07 -0800)]
lib: fixed minor linter issues in lib
Marek Vavruša [Fri, 12 Jan 2018 06:01:34 +0000 (22:01 -0800)]
lib/defines: analyzable implementation for kr_error()
Marek Vavruša [Thu, 11 Jan 2018 01:09:04 +0000 (17:09 -0800)]
build: support `make lint-c` with clang-tidy
This supports linting of C code using clang-tidy to fix common
security and code quality issues early in the development workflow.
The benefit is that less time has to be spent in code reviews to
point out obvious problems, and ideally when the outstanding issues
are fixed, clang-tidy (and clang-format) can also be used to to
automatically fix basic problems and enforce common code style,
similarly to `go vet && go fmt` workflow.
Marek Vavruša [Tue, 9 Jan 2018 17:38:10 +0000 (09:38 -0800)]
ci: add -Werror to CFLAGS, added clang build target
Petr Špaček [Thu, 11 Jan 2018 18:39:48 +0000 (19:39 +0100)]
Merge branch 'clang' into 'master'
fixup! CI: add Clang scan-build to the pipeline
See merge request knot/knot-resolver!438
Petr Špaček [Thu, 11 Jan 2018 18:31:34 +0000 (19:31 +0100)]
fixup! CI: add Clang scan-build to the pipeline
Forgot to `git add` Dockerfile with Clang tools.
Petr Špaček [Thu, 11 Jan 2018 18:26:58 +0000 (19:26 +0100)]
Merge branch 'systemd-modifications' into 'master'
Systemd modifications
See merge request knot/knot-resolver!436
Tomas Krizek [Thu, 11 Jan 2018 15:13:01 +0000 (16:13 +0100)]
systemd: add knot-resolver alias
The `knot-resolver` name is used for paths and user name. Creating a
systemd alias with the same name is user-friendly to end users who won't
have to remember another name (`kresd`).
Note: Systemd Alias is only created after service is enabled. Packagers
are thus advised to create symlinks for unit files during package installation
so users can use `knot-resolver` name right from the start.
Tomas Krizek [Thu, 11 Jan 2018 12:50:52 +0000 (13:50 +0100)]
systemd: use persistent cache by default
The /run directory is non-persistent. Use /var/cache/knot-resolver
as a persistent cache.
Tomas Krizek [Thu, 11 Jan 2018 12:55:08 +0000 (13:55 +0100)]
README: remove trailing whitespace
Petr Špaček [Thu, 11 Jan 2018 17:48:53 +0000 (18:48 +0100)]
Merge branch 'clan-scan-build' into 'master'
CI: add Clan scan build to pipeline
See merge request knot/knot-resolver!437
Petr Špaček [Thu, 11 Jan 2018 17:12:30 +0000 (18:12 +0100)]
CI: add Clang scan-build to the pipeline
For now error produced by scan-build are not fatal.
We need to fix these first.
Petr Špaček [Thu, 11 Jan 2018 17:12:06 +0000 (18:12 +0100)]
CI: use images from local registry
Petr Špaček [Thu, 11 Jan 2018 07:07:21 +0000 (08:07 +0100)]
Merge branch 'fix-systemd-service' into 'master'
systemd: drop WantedBy directive from kresd.service
See merge request knot/knot-resolver!433
Daniel Kahn Gillmor [Tue, 9 Jan 2018 21:06:45 +0000 (16:06 -0500)]
systemd: drop WantedBy directive from kresd.service
This directive is unnecessary in the .service file, and it also causes
a dependency cycle that systemd is obliged to break.
Since kresd is socket-activated, there is no need for the WantedBy
directive in the .service file itself. As long as the .socket files
are installed, the service will run when it is used.
Vladimír Čunát [Wed, 10 Jan 2018 15:09:16 +0000 (16:09 +0100)]
cache: nitpicks and comments
Petr Špaček [Wed, 10 Jan 2018 14:46:26 +0000 (15:46 +0100)]
Merge branch 'systemd-enable-manual-activation' into 'master'
systemd: enable manual activation of kresd.service as non-root user
See merge request knot/knot-resolver!434
Tomas Krizek [Wed, 10 Jan 2018 13:05:53 +0000 (14:05 +0100)]
systemd: enable manual activation of kresd.service as non-root user
To be able to bind to a well known port as a non-root user, the CAP_NET_BIND_SERVICE
capability is required.
Marek Vavruša [Tue, 9 Jan 2018 17:36:40 +0000 (09:36 -0800)]
removed lua-http installed through luarocks as it's installed in packages
Marek Vavruša [Tue, 9 Jan 2018 17:25:09 +0000 (09:25 -0800)]
Revert "add -Werror to daemon/lib to prevent builds with dead code"
This reverts commit
9ca537e809a68984f1f4966e09ae3808a28b2f20 .
Vladimír Čunát [Tue, 9 Jan 2018 09:54:20 +0000 (10:54 +0100)]
Merge !431: daemon: fix clang warnings
Grigorii Demidov [Tue, 9 Jan 2018 09:35:26 +0000 (10:35 +0100)]
daemon: fix clang warnings
Marek Vavruša [Mon, 8 Jan 2018 21:32:21 +0000 (13:32 -0800)]
Merge remote-tracking branch 'origin/master' into query-trace
Marek Vavruša [Mon, 8 Jan 2018 19:53:08 +0000 (11:53 -0800)]
add -Werror to daemon/lib to prevent builds with dead code
Marek Vavruša [Fri, 29 Dec 2017 03:23:22 +0000 (19:23 -0800)]
lib: added kr_rplan_last() function to get last processed query
The last processed query is not always resolved (if resolution fails),
so previous code returned wrong query in some messages after failure.
Marek Vavruša [Fri, 29 Dec 2017 03:30:47 +0000 (19:30 -0800)]
tests/config: all tests can now be asynchronous with worker.coroutine
Marek Vavruša [Fri, 29 Dec 2017 03:25:57 +0000 (19:25 -0800)]
daemon: unified query completion callback with trace callback in resolve
This is a followup on addition of trace callbacks in the resolver library,
to get rid of the Lua/C interfacing in daemon and unify it with the log tracing.
All modules can now install completion callback on the kr_request object that
will be called after the resolution is done.
Marek Vavruša [Thu, 21 Dec 2017 06:22:36 +0000 (22:22 -0800)]
daemon/worker: allow large responses for outbound over TCP
By default the reassembly packet buffer is set to EDNS buffer size,
which is correct for UDP, but not for TCP which may accept any
allowed response size. This should be only used for responses to
outbound queries over TCP, not for inbound TCP queries.
Marek Vavruša [Wed, 6 Dec 2017 00:52:40 +0000 (16:52 -0800)]
Implement worker coroutines for asynchronous background processing
This implements worker coroutines in Lua to perform non-blocking I/O and do many things concurrently.
For example a file watcher can be now implemented as:
```
local watcher = notify.opendir('/etc')
watcher:add('hosts')
-- Watch changes to /etc/hosts
worker.coroutine(function ()
for flags, name in watcher:changes() do
for flag in notify.flags(flags) do
print(name, notify[flag])
end
end
end)
```
In order to make this work, the runtime uses the cqueues library which
can run coroutines concurrently, and return a file descriptor to poll on
if it's blocked. The worker takes that file descriptor and calls
`event.socket(pollfd, resume_callback)` so that libuv can wake up
the worker when its ready again.
The cqueues library is still optional, but if it's not present following stuff
won't work:
* worker.coroutine()
* worker.sleep()
Vladimír Čunát [Mon, 8 Jan 2018 14:34:19 +0000 (15:34 +0100)]
cache get_lowest_rank: cleaner code
Petr Špaček [Mon, 8 Jan 2018 11:40:07 +0000 (12:40 +0100)]
Merge branch 'sim_qry' into 'master'
outbound TCP connections sharing; TLS over outbound TCP connections
Closes #104
See merge request knot/knot-resolver!379
Grigorii Demidov [Mon, 8 Jan 2018 09:12:17 +0000 (10:12 +0100)]
daemon: avoid memory leaks under heavy load when using tls over outgoing tcp connection
Grigorii Demidov [Fri, 5 Jan 2018 09:03:23 +0000 (10:03 +0100)]
daemon: kresd fall into endless loop in some circumstances when tls is used; fix
Grigorii Demidov [Fri, 5 Jan 2018 07:15:39 +0000 (08:15 +0100)]
daemon/tls_ephemeral_credentials: avoid some memory leaks
grid [Wed, 3 Jan 2018 10:39:03 +0000 (11:39 +0100)]
daemon: explicit processing of UV_EOF within stream read callback function
Vladimír Čunát [Thu, 14 Dec 2017 12:24:35 +0000 (13:24 +0100)]
TLS: only print [tls] messages if --verbose
Petr Špaček [Wed, 13 Dec 2017 16:05:33 +0000 (17:05 +0100)]
modules/policy: TLS defaults to port 853
grid [Wed, 13 Dec 2017 13:50:54 +0000 (14:50 +0100)]
modules/policy: local variable declarations were fixed; cleanup
grid [Wed, 13 Dec 2017 13:46:43 +0000 (14:46 +0100)]
modules/policy: local variable declarations were fixed
grid [Wed, 13 Dec 2017 13:25:39 +0000 (14:25 +0100)]
daemon/tls: tls client bugfix; correct processing of tcp connection closure
grid [Wed, 13 Dec 2017 09:20:53 +0000 (10:20 +0100)]
daemon/tls: tls_push() can fall into endless loop in some circumstances; prevent it
grid [Wed, 6 Dec 2017 10:45:43 +0000 (11:45 +0100)]
daemon: outbound TLS: penalise NS if authentication fails
grid [Wed, 6 Dec 2017 09:46:15 +0000 (10:46 +0100)]
daemon: cleanup - free the memory allocated for hostnames
Vladimír Čunát [Tue, 5 Dec 2017 17:34:56 +0000 (18:34 +0100)]
policy.TLS_FORWARD: reduce net.tls_client() calls
It should be enough to update the table once per TLS_FORWARD rule,
without re-doing that every time the policy is triggered.
Vladimír Čunát [Tue, 5 Dec 2017 17:02:57 +0000 (18:02 +0100)]
print_tls_client_params: print all address#port pairs
nitpick: pre-allocate table sizes
grid [Tue, 5 Dec 2017 14:15:44 +0000 (15:15 +0100)]
daemon: TLS over outbound TCP connection - use hostname authentication
grid [Mon, 27 Nov 2017 23:04:32 +0000 (00:04 +0100)]
daemon: bugfixes
Grigorii Demidov [Fri, 24 Nov 2017 10:59:50 +0000 (11:59 +0100)]
daemon: bugfix; resolver fails on assertion if TLS over outbound connection is used and upstream closes connection after each query
Grigorii Demidov [Mon, 20 Nov 2017 19:26:23 +0000 (20:26 +0100)]
daemon: retry waiting tasks when outbound TCP connection has problems
Grigorii Demidov [Thu, 16 Nov 2017 13:28:16 +0000 (14:28 +0100)]
daemon/worker: clear query TCP flags when retrying
Grigorii Demidov [Thu, 16 Nov 2017 12:10:31 +0000 (13:10 +0100)]
daemon/worker: bugfix, avoid access to deallocated task
Grigorii Demidov [Thu, 16 Nov 2017 11:27:46 +0000 (12:27 +0100)]
daemon/worker: retry all waiting tasks if upstream drops TCP connection
Grigorii Demidov [Thu, 16 Nov 2017 09:52:46 +0000 (10:52 +0100)]
daemon/worker: don't SERVFAIL immediately when TCP connection to upstream fails
Vladimír Čunát [Wed, 15 Nov 2017 10:30:03 +0000 (11:30 +0100)]
CI: try increasing the number of allowed filedescriptors
(cherry picked from commit
a4a6169c3cdf2293ea0637b9af4526fb2cbbb94d )
Testing what happens on our CI.
Grigorii Demidov [Wed, 15 Nov 2017 09:56:09 +0000 (10:56 +0100)]
daemon: TCP - for now session source address is queried at tcp_accept(). AF_UNSPEC is treated as error for both of udp&tcp.
Grigorii Demidov [Tue, 14 Nov 2017 12:03:06 +0000 (13:03 +0100)]
daemon: improved reliability under heavy load; bugfixing & minor refactoring
Grigorii Demidov [Tue, 12 Sep 2017 11:52:10 +0000 (13:52 +0200)]
daemon: reuse outbound TCP connections if possible; TLS over outbound TCP connection
Vladimír Čunát [Thu, 4 Jan 2018 15:06:02 +0000 (16:06 +0100)]
Merge branch 'master' into cache-aggr-wip
Vladimír Čunát [Thu, 4 Jan 2018 14:57:27 +0000 (15:57 +0100)]
unit tests: disable cache tests, at least for now
The cache API has changed, and it's in the process of being removed,
with cache getting more contained in a layer-module.
Vladimír Čunát [Thu, 4 Jan 2018 13:59:19 +0000 (14:59 +0100)]
NSEC3 packet cache (non-aggressive): fix the rank + optout
Vladimír Čunát [Thu, 4 Jan 2018 13:39:53 +0000 (14:39 +0100)]
Merge !430: Travis fixes and dependency updates
Vladimír Čunát [Thu, 4 Jan 2018 13:26:32 +0000 (14:26 +0100)]
travis: skip Deckard tests
Vladimír Čunát [Thu, 4 Jan 2018 10:45:38 +0000 (11:45 +0100)]
travis: try to fix python modules
Vladimír Čunát [Thu, 4 Jan 2018 10:35:34 +0000 (11:35 +0100)]
bootstrap-depends: update dependencies
Petr Špaček [Thu, 4 Jan 2018 13:16:30 +0000 (14:16 +0100)]
Merge branch 'travis_fixes' into 'master'
Do not point to Travis from README
See merge request knot/knot-resolver!429
Petr Špaček [Thu, 4 Jan 2018 13:09:28 +0000 (14:09 +0100)]
README: use badges from Gitlab instead of Travis/Coveralls