Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Benedikt Braunger <b.braunger@syseleven.de>
To: WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Wireguard DKMS build on OpenVZ 7
Date: Mon, 8 Feb 2021 21:05:30 +0100	[thread overview]
Message-ID: <cf30a113-8621-ccff-36e1-e34e09545d49@syseleven.de> (raw)

Hello Tunnelerz,

Again I'm having trouble to compile the newest Wireguard DKMS module for
the wonderfully frankensteined OpenVZ / Virtuozzo 7 kernel.

The problem occures when updating the wireguard-dkms package

[17:32:10] root@test ~ # uname -a
Linux test 3.10.0-1127.18.2.vz7.163.46 #1 SMP Fri Nov 20 21:47:55 MSK 2020 x86_64 x86_64 x86_64 GNU/Linux
[17:32:11] root@test ~ # yum update wireguard-dkms -y 

...

Updated:

  wireguard-dkms.noarch 1:1.0.20210124-1.el7                                                                                                                                    

Complete!

[17:34:02] root@test ~ # dkms status
wireguard, 1.0.20210124: added

[17:34:03] root@test ~ # dkms autoinstall 
Kernel preparation unnecessary for this kernel.  Skipping...

Building module:

cleaning build area...

make -j48 KERNELRELEASE=3.10.0-1127.18.2.vz7.163.46 -C /lib/modules/3.10.0-1127.18.2.vz7.163.46/build M=/var/lib/dkms/wireguard/1.0.20210124/build...(bad exit status: 2)
Error! Bad return status for module build on kernel: 3.10.0-1127.18.2.vz7.163.46 (x86_64)
Consult /var/lib/dkms/wireguard/1.0.20210124/build/make.log for more information.

[17:34:14] root@test ~ # tail /var/lib/dkms/wireguard/1.0.20210124/build/make.log
  AS [M]  /var/lib/dkms/wireguard/1.0.20210124/build/crypto/zinc/chacha20/chacha20-x86_64.o
/var/lib/dkms/wireguard/1.0.20210124/build/crypto/zinc/chacha20/chacha20-x86_64.o: warning: objtool: chacha20_avx512vl()+0x35: can't find jump dest instruction at .text+0x1f3f
/var/lib/dkms/wireguard/1.0.20210124/build/socket.c: In function ‘send6’:
/var/lib/dkms/wireguard/1.0.20210124/build/socket.c:139:18: error: ‘const struct ipv6_stub’ has no member named ‘ipv6_dst_lookup_flow’
   dst = ipv6_stub->ipv6_dst_lookup_flow(sock_net(sock), sock, &fl,
                  ^

make[1]: *** [/var/lib/dkms/wireguard/1.0.20210124/build/socket.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [_module_/var/lib/dkms/wireguard/1.0.20210124/build] Error 2
make: Leaving directory `/usr/src/kernels/3.10.0-1127.18.2.vz7.163.46'

As far as I understand this comes from the fact that
"ipv6_dst_lookup_flo" is not available in some kernels but is in others
and obviously it is used wrong here.

So I fixed this using the following workaround:

export VERSION='1.0.20210124';
yum install -y wireguard-dkms;
echo '#define ipv6_dst_lookup_flow(a, b, c, d) ipv6_dst_lookup(a, b, &dst, c) + (void *)0 ?: dst' >> /usr/src/wireguard-$VERSION/compat/compat.h;
dkms build wireguard/$VERSION && dkms install wireguard/$VERSION;
modprobe wireguard

[17:43:17] root@test~ # dkms status
wireguard, 1.0.20210124, 3.10.0-1127.18.2.vz7.163.46, x86_64: installed

I think the culprit is in
https://git.zx2c4.com/wireguard-linux-compat/tree/src/compat/compat.h#n92
and following

These conditions do not match for the OpenVZ systems as they have a
3.10.0 kernel and are RHEL based. I suggest an additional check like

 (LINUX_VERSION_CODE = KERNEL_VERSION(3, 10, 0) && defined(ISRHEL7))

but I am not sure if this could interfere with older RHEL versions.

Feedback or good ideas very welcome :-)

Regards,
Beni


                 reply	other threads:[~2021-02-10 15:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cf30a113-8621-ccff-36e1-e34e09545d49@syseleven.de \
    --to=b.braunger@syseleven.de \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).