- Explicitly install iproute2 in slim containers
- Explicitly install libclang-rt-dev to get working sanitizers
- Use the distro's Python cryptography package
- Install git before running actions/checkout if we need the repository
- Use --no-install-recommends for Debian derivatives
- Use the right systemd-dev package on Debian
- Remove texinfo from other distributions as it pulls in a lot of TeX
packages
- Remove some unnecessary packages on Fedora and related distros
Unfortunately, the multiprocessing library conflicts with something in
tinc's test library. Reordering imports fixes this, but pylint doesn't
like it. For now just disable pylint in favor of a working test suite.
fix: resolve -Wdiscarded-qualifiers warnings in ifconfig_route and complete_config
In ifconfig_route, remove const from the value parameter as it is
written through via sep (*sep++ = 0) and is only called from finalize_join()
with a mutable buffer.
In complete_config, change dot to const char* as it is only used for
pointer arithmetic and reading, never written through.
- Use apt instead of apt-get
- Use libgcrypt20-dev on Debian
- Fix CFLAGS on macOS
- Skip ATTR_DEALLOCATOR when using Clang to avoid warnings
- Use tempfile.mkstemp() in test scripts
- Don't explicitly specify MPC_FAMILY
- Re-add forward-declarations of wrapped functions to avoid warnings
The header <lzo1x.h> includes <lzo/lzoconf.h>, which should have been
<lzoconf.h>, or the pkg-config file is wrong. This is mainly an issue on
macOS when installing LZO2 via Homebrew.
- Don't try to manually compile OpenSSL 3.0 for Fedora and related distros
- Use meson provided by Debian instead of using pip
- Make sure to install binfmt-support and pkgconf
Remove explicit versions, and instead use :latest and other aliases. Try
to get a latest stable release and a development release for several
well-known distributions. Drop CentOS as it is no longer supported.
If multicast is supported in principle, but multicast packets are blocked
by the firewall, then the multicast test will time out and reports an
error. Detect this case and don't fail.
On Linux, some iproute2 commands to set addresses and add routes don't work
or have no effect if the link is not up, so make sure we set the link up
first.
Marek Küthe [Tue, 12 Dec 2023 15:06:17 +0000 (15:06 +0000)]
Correct a type mismatch
In one place in the source code, the debug level of type `int` was used and in other places of type `debug_t`. This commit introduces a change so that the type `debug_t` is used in both places.
This also resolves a compiler warning.
Kirill Isakov [Sun, 5 Jun 2022 11:06:05 +0000 (17:06 +0600)]
Add timeouts to 'tinc join'
Since server tarpits suspicious connections, `tinc join` doesn't have
the best UX (if anything is broken on server's side, `tinc join` just
hangs indefinitely).
Since we don't want to leak information to the client, add timeouts on
the client side and notify the user that something is amiss if timeout
is reached.
Kirill Isakov [Mon, 30 May 2022 17:06:39 +0000 (23:06 +0600)]
Fix listen_sockets overflow in close_network_connections()
==32610==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000f4f6a8 at pc 0x000000533bd6 bp 0x7ffeafc6f390 sp 0x7ffeafc6f388
READ of size 8 at 0x000000f4f6a8 thread T0
#0 0x533bd5 in io_del /home/runner/work/tinc/tinc/openssl3/../src/linux/event.c:104:9
#1 0x4f4808 in close_network_connections /home/runner/work/tinc/tinc/openssl3/../src/net_setup.c:1283:3
#2 0x4cea70 in main /home/runner/work/tinc/tinc/openssl3/../src/tincd.c:717:2
#3 0x7f493a1d3d8f (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)
#4 0x7f493a1d3e3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f)
#5 0x421ac4 in _start (/home/runner/work/tinc/tinc/openssl3/src/tincd+0x421ac4)
0x000000f4f6a8 is located 8 bytes to the right of global variable 'listen_socket' defined in '../src/net_socket.c:48:17' (0xf4f0e0) of size 1472
SUMMARY: AddressSanitizer: global-buffer-overflow /home/runner/work/tinc/tinc/openssl3/../src/linux/event.c:104:9 in io_del
Kirill Isakov [Tue, 31 May 2022 19:30:58 +0000 (01:30 +0600)]
Shorter paths to PID files in integration tests
Tests were running into the 108-char limit on UNIX socket path length.
Since we don't care about saving PID files and sockets for further
analysis if anything does wrong with the test, just shove them into a
temporary directory (which is likely to have a very short name).
Guus Sliepen [Sat, 28 May 2022 21:12:52 +0000 (23:12 +0200)]
Reflow all Markdown files.
Use MarkFlow to reflow the Markdown files so they can be read as a text
file in a 80-column terminal. Also convert all code blocks into fenced
code blocks with a language header, and remove the prompt character;
this allows viewers to do syntax highlighting, and allows a human
reading the files using a text viewer to simply copy&paste the commands.
Kirill Isakov [Wed, 25 May 2022 16:52:06 +0000 (22:52 +0600)]
Fix UB pointer comparison in event.c
==36472==ERROR: AddressSanitizer: invalid-pointer-pair: 0x000000e9de00 0x608000000db0
#0 0x4d0658 in timeout_compare /home/runner/work/tinc/tinc/openssl3/../src/event.c:97:7
#1 0x55a3af in splay_top_down /home/runner/work/tinc/tinc/openssl3/../src/splay_tree.c:41:13
#2 0x559868 in splay_search_closest_node /home/runner/work/tinc/tinc/openssl3/../src/splay_tree.c:378:9
#3 0x55cd54 in splay_insert_node /home/runner/work/tinc/tinc/openssl3/../src/splay_tree.c:446:13
#4 0x4cecfc in timeout_set /home/runner/work/tinc/tinc/openssl3/../src/event.c:267:6
#5 0x4d3c49 in retry /home/runner/work/tinc/tinc/openssl3/../src/net.c:477:2
#6 0x53f274 in control_h /home/runner/work/tinc/tinc/openssl3/../src/control.c:96:3
#7 0x500a44 in receive_request /home/runner/work/tinc/tinc/openssl3/../src/protocol.c:180:7
#8 0x5485b2 in receive_meta /home/runner/work/tinc/tinc/openssl3/../src/meta.c:308:19
#9 0x4d1c18 in handle_meta_connection_data /home/runner/work/tinc/tinc/openssl3/../src/net.c:305:6
#10 0x4fa3cc in handle_meta_io /home/runner/work/tinc/tinc/openssl3/../src/net_socket.c:560:3
#11 0x4cfbe3 in event_loop /home/runner/work/tinc/tinc/openssl3/../src/event.c:453:5
#12 0x4d4127 in main_loop /home/runner/work/tinc/tinc/openssl3/../src/net.c:508:6
#13 0x4cbe24 in main /home/runner/work/tinc/tinc/openssl3/../src/tincd.c:702:11
#14 0x7f1900c1e082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082)
#15 0x41eafd in _start (/home/runner/work/tinc/tinc/openssl3/src/tincd+0x41eafd)
0x000000e9de00 is located 0 bytes inside of global variable 'pingtimer' defined in '../src/net.c:44:18' (0xe9de00) of size 80
0x608000000db0 is located 16 bytes inside of 96-byte region [0x608000000da0,0x608000000e00)
allocated by thread T0 here:
#0 0x499ed2 in calloc (/home/runner/work/tinc/tinc/openssl3/src/tincd+0x499ed2)
#1 0x4fc6a9 in xzalloc /home/runner/work/tinc/tinc/openssl3/../src/xalloc.h:41:12
#2 0x4fbfb0 in try_outgoing_connections /home/runner/work/tinc/tinc/openssl3/../src/net_socket.c:855:27
#3 0x4d31ac in reload_configuration /home/runner/work/tinc/tinc/openssl3/../src/net.c:435:2
#4 0x53f2bd in control_h /home/runner/work/tinc/tinc/openssl3/../src/control.c:101:16
#5 0x500a44 in receive_request /home/runner/work/tinc/tinc/openssl3/../src/protocol.c:180:7
#6 0x5485b2 in receive_meta /home/runner/work/tinc/tinc/openssl3/../src/meta.c:308:19
#7 0x4d1c18 in handle_meta_connection_data /home/runner/work/tinc/tinc/openssl3/../src/net.c:305:6
#8 0x4fa3cc in handle_meta_io /home/runner/work/tinc/tinc/openssl3/../src/net_socket.c:560:3
#9 0x4cfbe3 in event_loop /home/runner/work/tinc/tinc/openssl3/../src/event.c:453:5
#10 0x4d4127 in main_loop /home/runner/work/tinc/tinc/openssl3/../src/net.c:508:6
#11 0x4cbe24 in main /home/runner/work/tinc/tinc/openssl3/../src/tincd.c:702:11
#12 0x7f1900c1e082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082)
Kirill Isakov [Wed, 25 May 2022 15:52:42 +0000 (21:52 +0600)]
Fix UBSAN failure in b64decode_tinc()
../src/utils.c:141:14: runtime error: implicit conversion from type 'int' of value -1 (32-bit, signed) to type 'unsigned int' changed the value to 4294967295 (32-bit, unsigned)
#0 0x478d06 in b64decode_tinc /home/runner/work/tinc/tinc/openssl3/../src/utils.c:141:14
#1 0x437f6c in dump_invitations /home/runner/work/tinc/tinc/openssl3/../src/tincctl.c:1116:6
#2 0x42ebf6 in cmd_dump /home/runner/work/tinc/tinc/openssl3/../src/tincctl.c:1190:10
#3 0x42b4c5 in run_command /home/runner/work/tinc/tinc/openssl3/../src/tincctl.c:3315:11
#4 0x42aa24 in main /home/runner/work/tinc/tinc/openssl3/../src/tincctl.c:3366:15
#5 0x7f6fb7a4c082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082)
#6 0x406e2d in _start (/home/runner/work/tinc/tinc/openssl3/src/tinc+0x406e2d)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/utils.c:141:14 in