wireguard-tools/src
Matt Dunwoodie 84ac6add7e wg-quick: openbsd: set DNS with resolvd(8)
OpenBSD has introduced a new daemon named resolvd(8) to manage
resolv.conf. This creates problems with the old "horrible way" of
completely replacing resolv.conf. Resolvd will attempt to merge manual
changes with DNS servers discovered through dhcpleased(8) and slaacd(8).
Unfortunately, resolvd puts any manual modifications at the end of
resolv.conf, meaning that the wg-quick name servers will be queried
last.

The process for handling multiple name servers (at least with libc) is
to try a name server, and if the query times out, try the next, until
out of name servers, then repeat trying all name servers until a maximum
number of retries are performed. The name servers are queried in the
order listed in resolv.conf and the timeout is 5 seconds.

With this patch, we ensure the wg-quick name server is first in
resolv.conf (as route creates the name server with "static" priority),
but cannot ensure it is exclusive. Therfore, it may be possible that
queries are leaked to other name servers if the wg-quick name server
doesn't respond within 5 seconds.

We have another problem however, and that is if resolvd detects unwind
is running, it will set 127.0.0.1 as the only name server in
resolv.conf. unwind does not have deterministic name server selection in
the default configuration.  This means, all a user would need to do to
inadvertently cause persistent query leaks would be to run `rcctl enable
unwind`.

There are warnings added when these situations may occur.

The next step is to add an exclusive flag and search to route and
resolvd.

Reported-by: Matthieu Herrb <matthieu@herrb.eu>
Signed-off-by: Matt Dunwoodie <ncon@noconroy.net>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-09-14 00:40:51 +02:00
..
completion completion: add help and syncconf completions 2020-12-13 22:29:09 +01:00
fuzz netlink: remove libmnl requirement 2020-02-03 18:17:27 +01:00
man man: mention BSD debugging 2021-05-06 12:54:29 +02:00
systemd systemd: add reload target to systemd unit 2020-07-24 16:23:47 +02:00
uapi ipc: windows: use devpkey instead of nci for name 2021-07-31 01:01:53 +02:00
wg-quick wg-quick: openbsd: set DNS with resolvd(8) 2021-09-14 00:40:51 +02:00
wincompat ipc: windows: use devpkey instead of nci for name 2021-07-31 01:01:53 +02:00
config.c wireguard-tools: const correctness 2021-03-10 17:35:18 -07:00
config.h wireguard-tools: const correctness 2021-03-10 17:35:18 -07:00
containers.h ipc: cleanup openbsd support 2020-05-10 22:10:02 -06:00
ctype.h ctype: use non-locale-specific ctype.h 2020-08-06 17:47:14 +02:00
curve25519-fiat32.h global: bump copyright 2020-01-02 19:52:25 +01:00
curve25519-hacl64.h global: bump copyright 2020-01-02 19:52:25 +01:00
curve25519.c curve25519: squelch warnings on clang 2020-02-07 15:46:59 +01:00
curve25519.h global: bump copyright 2020-01-02 19:52:25 +01:00
encoding.c global: bump copyright 2020-01-02 19:52:25 +01:00
encoding.h global: bump copyright 2020-01-02 19:52:25 +01:00
genkey.c wireguard-tools: const correctness 2021-03-10 17:35:18 -07:00
ipc-freebsd.h ipc: uniformly ignore preshared keys that are zero 2021-03-11 15:35:15 -07:00
ipc-linux.h ipc: split into separate files per-platform 2020-05-25 17:21:18 -06:00
ipc-openbsd.h ipc: add wireguard-nt support 2021-07-20 13:24:18 +02:00
ipc-uapi-unix.h ipc: split into separate files per-platform 2020-05-25 17:21:18 -06:00
ipc-uapi-windows.h ipc: remove windows elevation 2021-07-20 13:24:18 +02:00
ipc-uapi.h ipc: read trailing responses after set operation 2021-01-27 15:22:20 +01:00
ipc-windows.h ipc: windows: use devpkey instead of nci for name 2021-07-31 01:01:53 +02:00
ipc.c ipc: add wireguard-nt support 2021-07-20 13:24:18 +02:00
ipc.h global: bump copyright 2020-01-02 19:52:25 +01:00
Makefile ipc: windows: use devpkey instead of nci for name 2021-07-31 01:01:53 +02:00
netlink.h netlink: initialize mostly unused field 2020-02-06 17:20:15 +01:00
pubkey.c wireguard-tools: const correctness 2021-03-10 17:35:18 -07:00
set.c wireguard-tools: const correctness 2021-03-10 17:35:18 -07:00
setconf.c wireguard-tools: const correctness 2021-03-10 17:35:18 -07:00
show.c wireguard-tools: const correctness 2021-03-10 17:35:18 -07:00
showconf.c wireguard-tools: const correctness 2021-03-10 17:35:18 -07:00
subcommands.h wireguard-tools: const correctness 2021-03-10 17:35:18 -07:00
terminal.c wireguard-tools: drag in headers for prototypes 2021-03-10 17:35:20 -07:00
terminal.h terminal: specialize color_mode to stdout only 2020-04-20 22:52:35 -06:00
version.h version: bump 2021-04-24 16:43:19 -04:00
wg.c wireguard-tools: const correctness 2021-03-10 17:35:18 -07:00