wireguard package doesn't work on ubuntu eon

Bug #1856539 reported by Benjamin
28
This bug affects 4 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Incomplete
Undecided
Unassigned

Bug Description

After upgrading to ubuntu eon, i've tried to install wireguard.
Install went well but wireguard module can't be loaded and so wireguard can't be used.

Ubuntu version: 19.10
Wireguard version: 0.0.20190913-1ubuntu1

When trying to use wireguard:
> sudo systemctl start <email address hidden>
Job for <email address hidden> failed because the control process exited with error code.
See "systemctl status <email address hidden>" and "journalctl -xe" for details.
10:19:32 ~/ (feat/start-vm-choose-power-state u=)
> systemctl status <email address hidden>
● <email address hidden> - WireGuard via wg-quick(8) for wg0
   Loaded: loaded (/lib/systemd/system/wg-quick@.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2019-12-16 10:19:32 CET; 5s ago
     Docs: man:wg-quick(8)
           man:wg(8)
           https://www.wireguard.com/
           https://www.wireguard.com/quickstart/
           https://git.zx2c4.com/WireGuard/about/src/tools/man/wg-quick.8
           https://git.zx2c4.com/WireGuard/about/src/tools/man/wg.8
  Process: 31063 ExecStart=/usr/bin/wg-quick up wg0 (code=exited, status=1/FAILURE)
 Main PID: 31063 (code=exited, status=1/FAILURE)

déc. 16 10:19:32 benjamin-XPS-13-9370 systemd[1]: Starting WireGuard via wg-quick(8) for wg0...
déc. 16 10:19:32 benjamin-XPS-13-9370 wg-quick[31063]: Warning: `/etc/wireguard/wg0.conf' is world accessible
déc. 16 10:19:32 benjamin-XPS-13-9370 wg-quick[31063]: [#] ip link add wg0 type wireguard
déc. 16 10:19:32 benjamin-XPS-13-9370 wg-quick[31063]: RTNETLINK answers: Operation not supported
déc. 16 10:19:32 benjamin-XPS-13-9370 wg-quick[31063]: Unable to access interface: Protocol not supported
déc. 16 10:19:32 benjamin-XPS-13-9370 wg-quick[31063]: [#] ip link delete dev wg0
déc. 16 10:19:32 benjamin-XPS-13-9370 wg-quick[31063]: Cannot find device "wg0"
déc. 16 10:19:32 benjamin-XPS-13-9370 systemd[1]: <email address hidden>: Main process exited, code=exited, status=1/FAILURE
déc. 16 10:19:32 benjamin-XPS-13-9370 systemd[1]: <email address hidden>: Failed with result 'exit-code'.
déc. 16 10:19:32 benjamin-XPS-13-9370 systemd[1]: Failed to start WireGuard via wg-quick(8) for wg0.

When trying to load wireguard module:
> sudo modprobe wireguard
modprobe: ERROR: could not insert 'wireguard': Exec format error

I'm happy to provide more info if needed.
Any help would be greatly appreciated!

Revision history for this message
Jason A. Donenfeld (zx2c4) wrote :

Run `sudo modprobe wireguard`, and then after run `dmesg`, and paste the output of your dmesg.

Most likely you need to do some sort of dkms rebuilding.

Revision history for this message
Benjamin (benjireis) wrote :
Download full text (121.3 KiB)

Thanks for your quick reply.

Here's the return of `dmesg`:
11:53:01 ~
> sudo modprobe wireguard
modprobe: ERROR: could not insert 'wireguard': Exec format error
11:53:08 ~
> dmesg
[ 0.000000] microcode: microcode updated early to revision 0xca, date = 2019-10-03
[ 0.000000] Linux version 4.15.0-1065-oem (buildd@lgw01-amd64-012) (gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)) #75-Ubuntu SMP Wed Nov 20 10:51:26 UTC 2019 (Ubuntu 4.15.0-1065.75-oem 4.15.18)
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.15.0-1065-oem root=UUID=a9f928aa-dcf4-40a8-8518-6a10e2c2341e ro mem_sleep_default=deep quiet splash vt.handoff=7
[ 0.000000] KERNEL supported cpus:
[ 0.000000] Intel GenuineIntel
[ 0.000000] AMD AuthenticAMD
[ 0.000000] Centaur CentaurHauls
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x008: 'MPX bounds registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x010: 'MPX CSR'
[ 0.000000] x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256
[ 0.000000] x86/fpu: xstate_offset[3]: 832, xstate_sizes[3]: 64
[ 0.000000] x86/fpu: xstate_offset[4]: 896, xstate_sizes[4]: 64
[ 0.000000] x86/fpu: Enabled xstate features 0x1f, context size is 960 bytes, using 'compacted' format.
[ 0.000000] e820: BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x0000000000057fff] usable
[ 0.000000] BIOS-e820: [mem 0x0000000000058000-0x0000000000058fff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000000059000-0x000000000009efff] usable
[ 0.000000] BIOS-e820: [mem 0x000000000009f000-0x00000000000fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000002dc7dfff] usable
[ 0.000000] BIOS-e820: [mem 0x000000002dc7e000-0x000000002dc7efff] ACPI NVS
[ 0.000000] BIOS-e820: [mem 0x000000002dc7f000-0x000000002dc7ffff] reserved
[ 0.000000] BIOS-e820: [mem 0x000000002dc80000-0x000000003ecf2fff] usable
[ 0.000000] BIOS-e820: [mem 0x000000003ecf3000-0x000000003f0b2fff] reserved
[ 0.000000] BIOS-e820: [mem 0x000000003f0b3000-0x000000003f0fffff] ACPI data
[ 0.000000] BIOS-e820: [mem 0x000000003f100000-0x000000003f7b7fff] ACPI NVS
[ 0.000000] BIOS-e820: [mem 0x000000003f7b8000-0x000000003ff26fff] reserved
[ 0.000000] BIOS-e820: [mem 0x000000003ff27000-0x000000003fffefff] type 20
[ 0.000000] BIOS-e820: [mem 0x000000003ffff000-0x000000003fffffff] usable
[ 0.000000] BIOS-e820: [mem 0x0000000040000000-0x0000000047ffffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000048000000-0x0000000048dfffff] usable
[ 0.000000] BIOS-e820: [mem 0x0000000048e00000-0x000000004f7fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000e0000000-0x00000000efffffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000fe000000-0x00000000fe010fff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000fec00000-0x00000000fec00fff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000fee00000-0x00000000fee00fff] reserved
[ 0.000000] BIOS-e82...

Revision history for this message
Benjamin (benjireis) wrote :

I've tried to dkms rebuild wireguard module, style same result:
wireguard.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.15.0-1059-oem/updates/dkms/

depmod...

Weirdly it builds for kernel `4.15.0-1059-oem` instead of `4.15.0-1065-oem`.

Revision history for this message
Jason A. Donenfeld (zx2c4) wrote :

[ 15.589541] module: x86/modules: Skipping invalid relocation target, existing value is nonzero for type 1, loc 00000000f4677a21, val ffffffffc1171b82

Looks like a dkms issue? Thankfully we won't need that for 20.04 and also earlier kernels once things are backported. I'll reassign this to the canonical kernel people.

affects: wireguard (Ubuntu) → linux (Ubuntu)
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1856539

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

What's the output of `dkms status`?

Revision history for this message
Avamander (avamander) wrote :

Mine says `wireguard, 0.0.20190913: added`, but updating failed and I suspect it's going to stop working after a reboot.

I'd upload logs with apport but it doesn't let me.

Revision history for this message
Avamander (avamander) wrote :

This is what I see in `/var/crash/wireguard-dkms.0.crash`:

```
ProblemType: Package
DKMSBuildLog:
 DKMS make.log for wireguard-0.0.20190913 for kernel 5.3.0-1018-raspi2 (aarch64)
 Tue Feb 18 20:52:38 UTC 2020
 make: Entering directory '/usr/src/linux-headers-5.3.0-1018-raspi2'
   CC [M] /var/lib/dkms/wireguard/0.0.20190913/build/main.o
   CC [M] /var/lib/dkms/wireguard/0.0.20190913/build/noise.o
   CC [M] /var/lib/dkms/wireguard/0.0.20190913/build/device.o
   CC [M] /var/lib/dkms/wireguard/0.0.20190913/build/peer.o
   CC [M] /var/lib/dkms/wireguard/0.0.20190913/build/timers.o
   CC [M] /var/lib/dkms/wireguard/0.0.20190913/build/queueing.o
   CC [M] /var/lib/dkms/wireguard/0.0.20190913/build/send.o
   CC [M] /var/lib/dkms/wireguard/0.0.20190913/build/receive.o
   CC [M] /var/lib/dkms/wireguard/0.0.20190913/build/socket.o
   CC [M] /var/lib/dkms/wireguard/0.0.20190913/build/peerlookup.o
   CC [M] /var/lib/dkms/wireguard/0.0.20190913/build/allowedips.o
   CC [M] /var/lib/dkms/wireguard/0.0.20190913/build/ratelimiter.o
 /var/lib/dkms/wireguard/0.0.20190913/build/socket.c: In function ‘send6’:
 /var/lib/dkms/wireguard/0.0.20190913/build/socket.c:145:20: error: ‘const struct ipv6_stub’ has no member named ‘ipv6_dst_lookup’; did you mean ‘ipv6_dst_lookup_flow’?
   145 | ret = ipv6_stub->ipv6_dst_lookup(sock_net(sock), sock, &dst,
       | ^~~~~~~~~~~~~~~
       | ipv6_dst_lookup_flow
 make[1]: *** [scripts/Makefile.build:290: /var/lib/dkms/wireguard/0.0.20190913/build/socket.o] Error 1
 make[1]: *** Waiting for unfinished jobs....
 make: *** [Makefile:1658: _module_/var/lib/dkms/wireguard/0.0.20190913/build] Error 2
 make: Leaving directory '/usr/src/linux-headers-5.3.0-1018-raspi2'
DKMSKernelVersion: 5.3.0-1018-raspi2
Date: Tue Feb 18 20:52:52 2020
DuplicateSignature: dkms:wireguard-dkms:0.0.20190913-1ubuntu1:/var/lib/dkms/wireguard/0.0.20190913/build/socket.c:145:20: error: ‘const struct ipv6_stub’ has no member named ‘ipv6_dst_lookup’; did you mean ‘ipv6_dst_lookup_flow’?
Package: wireguard-dkms 0.0.20190913-1ubuntu1
PackageVersion: 0.0.20190913-1ubuntu1
SourcePackage: wireguard
Title: wireguard-dkms 0.0.20190913-1ubuntu1: wireguard kernel module failed to build
```

Revision history for this message
Avamander (avamander) wrote :

This issue is marked as a duplicate of https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1858807 so I'm commenting here. Unlink and move comments if they're not actually duplicates.

Revision history for this message
MrVantage (mrvantage) wrote :
Download full text (3.3 KiB)

Looks like I have the same issue. It seems that the wireguard dkms module breaks with a recent kernel patch. I booted into the last working kernel to get the module working again.

----

Wireguard module missing for 5.3.0-40-generic:
sudo dkms status
virtualbox, 6.0.14, 5.3.0-26-generic, x86_64: installed
virtualbox, 6.0.14, 5.3.0-29-generic, x86_64: installed
virtualbox, 6.0.14, 5.3.0-40-generic, x86_64: installed
wireguard, 0.0.20190913, 5.3.0-26-generic, x86_64: installed
wireguard, 0.0.20190913, 5.3.0-29-generic, x86_64: installed

----

Building fails:
sudo dkms build wireguard/0.0.20190913 -k 5.3.0-40-generic

Kernel preparation unnecessary for this kernel. Skipping...

Building module:
cleaning build area...
make -j4 KERNELRELEASE=5.3.0-40-generic -C /lib/modules/5.3.0-40-generic/build M=/var/lib/dkms/wireguard/0.0.20190913/build...(bad exit status: 2)
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/wireguard-dkms.0.crash'
Error! Bad return status for module build on kernel: 5.3.0-40-generic (x86_64)
Consult /var/lib/dkms/wireguard/0.0.20190913/build/make.log for more information.

----

Build log:
cat /var/lib/dkms/wireguard/0.0.20190913/build/make.log
DKMS make.log for wireguard-0.0.20190913 for kernel 5.3.0-40-generic (x86_64)
wo 19 feb 2020 20:43:32 CET
make: Entering directory '/usr/src/linux-headers-5.3.0-40-generic'
  CC [M] /var/lib/dkms/wireguard/0.0.20190913/build/main.o
  CC [M] /var/lib/dkms/wireguard/0.0.20190913/build/noise.o
  CC [M] /var/lib/dkms/wireguard/0.0.20190913/build/device.o
  CC [M] /var/lib/dkms/wireguard/0.0.20190913/build/peer.o
  CC [M] /var/lib/dkms/wireguard/0.0.20190913/build/timers.o
  CC [M] /var/lib/dkms/wireguard/0.0.20190913/build/queueing.o
  CC [M] /var/lib/dkms/wireguard/0.0.20190913/build/send.o
  CC [M] /var/lib/dkms/wireguard/0.0.20190913/build/receive.o
  CC [M] /var/lib/dkms/wireguard/0.0.20190913/build/socket.o
  CC [M] /var/lib/dkms/wireguard/0.0.20190913/build/peerlookup.o
  CC [M] /var/lib/dkms/wireguard/0.0.20190913/build/allowedips.o
  CC [M] /var/lib/dkms/wireguard/0.0.20190913/build/ratelimiter.o
/var/lib/dkms/wireguard/0.0.20190913/build/socket.c: In function ‘send6’:
/var/lib/dkms/wireguard/0.0.20190913/build/socket.c:145:20: error: ‘const struct ipv6_stub’ has no member named ‘ipv6_dst_lookup’; did you mean ‘ipv6_dst_lookup_flow’?
  145 | ret = ipv6_stub->ipv6_dst_lookup(sock_net(sock), sock, &dst,
      | ^~~~~~~~~~~~~~~
      | ipv6_dst_lookup_flow
make[1]: *** [scripts/Makefile.build:290: /var/lib/dkms/wireguard/0.0.20190913/build/socket.o] Error 1
...

Read more...

Revision history for this message
Jason A. Donenfeld (zx2c4) wrote :

The Ubuntu kernel team seems to be behind in deploying a fix for this. In the interim you can solve this by using the WireGuard project's PPA, which now has backports for 19.10. Run this command to fix your issue:

sudo add-apt-repository ppa:wireguard/wireguard && sudo apt-get update && sudo apt-get upgrade

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.