Skip to contentSkip to conversation

Debian 4.9.0.9-amd64 :: DMKS failed

DISCUSSION Markus Grundmann 2 participants 2 messages Aug 19, 2019

lore
Share & tools
lore
#0 lore raw

This is a new debian VM running on BHYVE. After the installation and upgrading operating system the following DKMS fails.

Installation procedure:
1) Modifying the files described on wireguard.com
2) apt update
3) apt install wireguard

[FAIL]

// Linux raspivm 4.9.0-9-amd64 #1 SMP Debian 4.9.168-1+deb9u5 (2019-08-11) x86_64 GNU/Linux

### Manual removing of 'wireguard-dkms'

root@raspivm:/# apt remove wireguard-dkms
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer
required:
  dkms fakeroot gcc libfakeroot linux-headers-amd64 sudo wireguard-tools
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  wireguard-dkms
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 1,780 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 64696 files and directories currently installed.)
Removing wireguard-dkms (0.0.20190702-1) ...

------------------------------
Deleting module version: 0.0.20190702
completely from the DKMS tree.
------------------------------
Done.

### Try to reinstall 'wireguard-dkms'

root@raspivm:/# apt install wireguard-dkms
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  wireguard-dkms
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 263 kB of archives.
After this operation, 1,780 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian unstable/main amd64 wireguard-dkms
all 0.0.20190702-1 [263 kB]
Fetched 263 kB in 0s (3,246 kB/s)
Selecting previously unselected package wireguard-dkms.
(Reading database ... 64553 files and directories currently installed.)
Preparing to unpack .../wireguard-dkms_0.0.20190702-1_all.deb ...
Unpacking wireguard-dkms (0.0.20190702-1) ...
Setting up wireguard-dkms (0.0.20190702-1) ...
Loading new wireguard-0.0.20190702 DKMS files...
Building for 4.9.0-9-amd64
Building initial module for 4.9.0-9-amd64
//
// ERROR
//
Error! Bad return status for module build on kernel: 4.9.0-9-amd64 (x86_64)
Consult /var/lib/dkms/wireguard/0.0.20190702/build/make.log for more
information.
//
//

### I try to build manual but make fails. Error: "hsiphash_key_t unknown".

# /var/lib/dkms/wireguard/0.0.20190702/build# make

ver="#define WIREGUARD_VERSION \"\"" && \
[ "$(cat version.h 2>/dev/null)" != "$ver" ] && \
echo "$ver" > version.h || true
CC [M] /var/lib/dkms/wireguard/0.0.20190702/build/ratelimiter.o
/var/lib/dkms/wireguard/0.0.20190702/build/ratelimiter.c:25:8: error:
unknown type name ‘hsiphash_key_t’

 static hsiphash_key_t key;
        ^~~~~~~~~~~~~~

/var/lib/dkms/wireguard/0.0.20190702/build/ratelimiter.c: In function ‘wg_ratelimiter_allow’:
/var/lib/dkms/wireguard/0.0.20190702/build/ratelimiter.c:109:22: error:
implicit declaration of function ‘hsiphash_2u32’ [-Werror=implicit-function-declaration]
bucket = &table_v4[hsiphash_2u32(net_word, ip, &key) &

                      ^~~~~~~~~~~~~

/var/lib/dkms/wireguard/0.0.20190702/build/ratelimiter.c:116:22: error:
implicit declaration of function ‘hsiphash_3u32’ [-Werror=implicit-function-declaration]
bucket = &table_v6[hsiphash_3u32(net_word, ip >> 32, ip, &key) &

                      ^~~~~~~~~~~~~

cc1: some warnings being treated as errors /usr/src/linux-headers-4.9.0-9-common/scripts/Makefile.build:309: recipe for target '/var/lib/dkms/wireguard/0.0.20190702/build/ratelimiter.o' failed make[4]: *** [/var/lib/dkms/wireguard/0.0.20190702/build/ratelimiter.o] Error 1
/usr/src/linux-headers-4.9.0-9-common/Makefile:1544: recipe for target '_module_/var/lib/dkms/wireguard/0.0.20190702/build' failed make[3]: *** [_module_/var/lib/dkms/wireguard/0.0.20190702/build] Error 2 Makefile:152: recipe for target 'sub-make' failed
make[2]: *** [sub-make] Error 2
Makefile:8: recipe for target 'all' failed
make[1]: *** [all] Error 2
Makefile:32: recipe for target 'module' failed
make: *** [module] Error 2

Signature · 13 lines
Best regards,
Markus

Better Privacy with PGP encrypted Mail: http://activezone.de/pgp/
Fingerprint: 58C5 8BAF 6FCE B24F 1881 B5B8 F2A8 E1D0 484B 0054
Threema ID: 7ZRET2JY

„Wer die Freiheit aufgibt um Sicherheit zu gewinnen,
 der wird am Ende beides verlieren.“ -- Benjamin Franklin
_______________________________________________
WireGuard mailing list
[email protected]
https://lists.zx2c4.com/mailman/listinfo/wireguard
#1 lore raw
Quoted 2 lines · Markus Grundmann

This is a new debian VM running on BHYVE. After the installation and upgrading operating system the following DKMS fails.

This is https://bugs.debian.org/934763, which i'll work around shortly with the attached patch to the wireguard packaging in 0.0.20190702-2. Thanks to Jason for supplying the attached patch to update the compatibility checks.

Note that if you apply the attached patch to wireguard and build against 4.9.168-1+deb9u5, but then try to load the module on a system running 4.9.168-1+deb9u4, the module will fail to load with unrecognized symbols, due to the weird state of the backported siphash (but no hsiphash).

          --dkg

From: "Jason A. Donenfeld" <[email protected]>
Date: Thu, 15 Aug 2019 06:37:10 +0000
Subject: compat: fix on debian 4.9.168 in sloppy manner

Ben backported siphash but forgot to backport hsiphash, which goes into the same .h and .o files, making a proper compat layer for it kind of cumbersome and annoying. Since he plans to backport hsiphash for 4.9.169, this commit is a stop-gap solution for the Debian package.

---
 src/compat/compat.h | 6 ++++++
 1 file changed, 6 insertions(+)
src/compat/compat.h +6 -0
index 239fa58..7fc3145 100644
@@ -844,6 +844,12 @@ static inline void skb_mark_not_on_list(struct sk_buff *skb)
 #define cpu_have_named_feature(name) (elf_hwcap & (HWCAP_ ## name))
 #endif
 
+#if LINUX_VERSION_CODE == KERNEL_VERSION(4, 9, 168)
+#define hsiphash_2u32 siphash_2u32
+#define hsiphash_3u32 siphash_3u32
+#define hsiphash_key_t siphash_key_t
+#endif
+
 /* https://github.com/ClangBuiltLinux/linux/issues/7 */
 #if defined( __clang__) && (!defined(CONFIG_CLANG_VERSION) || CONFIG_CLANG_VERSION < 80000)
 #include <linux/bug.h>

_______________________________________________
WireGuard mailing list
[email protected]
https://lists.zx2c4.com/mailman/listinfo/wireguard