All of lore.kernel.org
 help / color / mirror / Atom feed
* Debian 4.9.0.9-amd64 :: DMKS failed
@ 2019-08-19 12:06 Markus Grundmann
  2019-08-19 22:23 ` Daniel Kahn Gillmor
  0 siblings, 1 reply; 4+ messages in thread
From: Markus Grundmann @ 2019-08-19 12:06 UTC (permalink / raw)
  To: wireguard

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


-- 
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
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Debian 4.9.0.9-amd64 :: DMKS failed
  2019-08-19 12:06 Debian 4.9.0.9-amd64 :: DMKS failed Markus Grundmann
@ 2019-08-19 22:23 ` Daniel Kahn Gillmor
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Kahn Gillmor @ 2019-08-19 22:23 UTC (permalink / raw)
  To: Markus Grundmann, wireguard, 934763


[-- Attachment #1.1.1: Type: text/plain, Size: 715 bytes --]

On Mon 2019-08-19 14:06:37 +0200, Markus Grundmann wrote:
> 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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.2: 0003-compat-fix-on-debian-4.9.168-in-sloppy-manner.patch --]
[-- Type: text/x-diff, Size: 1160 bytes --]

From: "Jason A. Donenfeld" <Jason@zx2c4.com>
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(+)

diff --git a/src/compat/compat.h b/src/compat/compat.h
index 239fa58..7fc3145 100644
--- a/src/compat/compat.h
+++ b/src/compat/compat.h
@@ -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>

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

[-- Attachment #2: Type: text/plain, Size: 148 bytes --]

_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: Debian 4.9.0.9-amd64 :: DMKS failed
  2019-08-19 12:04 Markus Grundmann
@ 2019-08-25 15:59 ` Jason A. Donenfeld
  0 siblings, 0 replies; 4+ messages in thread
From: Jason A. Donenfeld @ 2019-08-25 15:59 UTC (permalink / raw)
  To: Markus Grundmann; +Cc: WireGuard mailing list

Addressed with:

https://salsa.debian.org/debian/wireguard/commit/dca2647fa39e037448b450cb82d5d62b13685b25
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=934763
_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Debian 4.9.0.9-amd64 :: DMKS failed
@ 2019-08-19 12:04 Markus Grundmann
  2019-08-25 15:59 ` Jason A. Donenfeld
  0 siblings, 1 reply; 4+ messages in thread
From: Markus Grundmann @ 2019-08-19 12:04 UTC (permalink / raw)
  To: wireguard

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

_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-08-25 16:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-19 12:06 Debian 4.9.0.9-amd64 :: DMKS failed Markus Grundmann
2019-08-19 22:23 ` Daniel Kahn Gillmor
  -- strict thread matches above, loose matches on Subject: below --
2019-08-19 12:04 Markus Grundmann
2019-08-25 15:59 ` Jason A. Donenfeld

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.