Bug 2103865

Summary: kernel-4.18.0-394.el8.x86_64 breaks the compatibility with wireguard-compat
Product: Red Hat Enterprise Linux 8 Reporter: Red Shen <darkranger_red>
Component: kernelAssignee: core-kernel-bot <core-kernel-mgr>
kernel sub component: Kernel-Core QA Contact: Red Hat Kernel QE team <kernel-qe>
Status: CLOSED NOTABUG Docs Contact:
Severity: unspecified    
Priority: unspecified CC: alexisgandroid, bstinson, ivecera, jwboyer, phil, williams
Version: CentOS Stream   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-07-20 16:03:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Red Shen 2022-07-05 06:48:08 UTC
Please see the make.log below:
-------------------------------
DKMS make.log for wireguard-1.0.20211208 for kernel 4.18.0-394.el8.x86_64 (x86_64)
Mon Jul  4 10:11:54 CST 2022
make: Entering directory '/usr/src/kernels/4.18.0-394.el8.x86_64'
  CC [M]  /var/lib/dkms/wireguard/1.0.20211208/build/main.o
  CC [M]  /var/lib/dkms/wireguard/1.0.20211208/build/noise.o
In file included from <command-line>:
/var/lib/dkms/wireguard/1.0.20211208/build/compat/compat.h:417:19: error: redefinition of ‘ktime_get_coarse_boottime_ns’
 static inline u64 ktime_get_coarse_boottime_ns(void)
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from <command-line>:
/var/lib/dkms/wireguard/1.0.20211208/build/compat/compat.h:417:19: error: redefinition of ‘ktime_get_coarse_boottime_ns’
 static inline u64 ktime_get_coarse_boottime_ns(void)
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/ktime.h:266,
                 from /var/lib/dkms/wireguard/1.0.20211208/build/compat/compat.h:396,
                 from <command-line>:
./include/linux/timekeeping.h:119:19: note: previous definition of ‘ktime_get_coarse_boottime_ns’ was here
 static inline u64 ktime_get_coarse_boottime_ns(void)
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/ktime.h:266,
                 from /var/lib/dkms/wireguard/1.0.20211208/build/compat/compat.h:396,
                 from <command-line>:
./include/linux/timekeeping.h:119:19: note: previous definition of ‘ktime_get_coarse_boottime_ns’ was here
 static inline u64 ktime_get_coarse_boottime_ns(void)
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[1]: *** [scripts/Makefile.build:315: /var/lib/dkms/wireguard/1.0.20211208/build/main.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [scripts/Makefile.build:315: /var/lib/dkms/wireguard/1.0.20211208/build/noise.o] Error 1
make: *** [Makefile:1577: _module_/var/lib/dkms/wireguard/1.0.20211208/build] Error 2
make: Leaving directory '/usr/src/kernels/4.18.0-394.el8.x86_64'
-------------------------------

Since the kernel-4.18.0-383.el8.x86_64 is fine to compile with, so a quick workaround is explicitly build the module for the older kernel:
dkms install wireguard/1.0.20211208 -k 4.18.0-383.el8.x86_64

The reason why I have submitted a bug here, is to raise the discussion about the potentially critical situation in RHEL8. If the recent kernel changes in CentOS Stream 8 eventually made into RHEL8, it will break the compatibility with the WireGuard. So WireGuard will no longer work in RHEL8 anymore, only in EL7 and EL9.

Comment 2 Alexis G 2022-07-06 08:53:44 UTC
Not related to a redhat package but wireguard-dkms is also broken.



Name         : wireguard-dkms
Epoch        : 1
Version      : 1.0.20220627
Release      : 1.el8
Architecture : noarch
Size         : 1.6 M
Source       : wireguard-dkms-1.0.20220627-1.el8.src.rpm
Repository   : @System
From repo    : copr:copr.fedorainfracloud.org:jdoss:wireguard



DKMS make.log for wireguard-1.0.20220627 for kernel 4.18.0-394.el8.x86_64 (x86_64)
Wed Jul  6 10:41:17 CEST 2022
make: Entering directory '/usr/src/kernels/4.18.0-394.el8.x86_64'
  CC [M]  /var/lib/dkms/wireguard/1.0.20220627/build/main.o
  CC [M]  /var/lib/dkms/wireguard/1.0.20220627/build/noise.o
  CC [M]  /var/lib/dkms/wireguard/1.0.20220627/build/device.o
  CC [M]  /var/lib/dkms/wireguard/1.0.20220627/build/peer.o
In file included from <command-line>:
/var/lib/dkms/wireguard/1.0.20220627/build/compat/compat.h:415:19: error: redefinition of ‘ktime_get_coarse_boottime_ns’
 static inline u64 ktime_get_coarse_boottime_ns(void)
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from <command-line>:
/var/lib/dkms/wireguard/1.0.20220627/build/compat/compat.h:415:19: error: redefinition of ‘ktime_get_coarse_boottime_ns’
 static inline u64 ktime_get_coarse_boottime_ns(void)
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from <command-line>:
/var/lib/dkms/wireguard/1.0.20220627/build/compat/compat.h:415:19: error: redefinition of ‘ktime_get_coarse_boottime_ns’
 static inline u64 ktime_get_coarse_boottime_ns(void)
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from <command-line>:
/var/lib/dkms/wireguard/1.0.20220627/build/compat/compat.h:415:19: error: redefinition of ‘ktime_get_coarse_boottime_ns’
 static inline u64 ktime_get_coarse_boottime_ns(void)
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/ktime.h:266,
                 from /var/lib/dkms/wireguard/1.0.20220627/build/compat/compat.h:394,
                 from <command-line>:
./include/linux/timekeeping.h:119:19: note: previous definition of ‘ktime_get_coarse_boottime_ns’ was here
 static inline u64 ktime_get_coarse_boottime_ns(void)
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/ktime.h:266,
                 from /var/lib/dkms/wireguard/1.0.20220627/build/compat/compat.h:394,
                 from <command-line>:
./include/linux/timekeeping.h:119:19: note: previous definition of ‘ktime_get_coarse_boottime_ns’ was here
 static inline u64 ktime_get_coarse_boottime_ns(void)
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/ktime.h:266,
                 from /var/lib/dkms/wireguard/1.0.20220627/build/compat/compat.h:394,
                 from <command-line>:
./include/linux/timekeeping.h:119:19: note: previous definition of ‘ktime_get_coarse_boottime_ns’ was here
 static inline u64 ktime_get_coarse_boottime_ns(void)
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/ktime.h:266,
                 from /var/lib/dkms/wireguard/1.0.20220627/build/compat/compat.h:394,
                 from <command-line>:
./include/linux/timekeeping.h:119:19: note: previous definition of ‘ktime_get_coarse_boottime_ns’ was here
 static inline u64 ktime_get_coarse_boottime_ns(void)
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[1]: *** [scripts/Makefile.build:315: /var/lib/dkms/wireguard/1.0.20220627/build/main.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [scripts/Makefile.build:315: /var/lib/dkms/wireguard/1.0.20220627/build/peer.o] Error 1
make[1]: *** [scripts/Makefile.build:315: /var/lib/dkms/wireguard/1.0.20220627/build/noise.o] Error 1
make[1]: *** [scripts/Makefile.build:315: /var/lib/dkms/wireguard/1.0.20220627/build/device.o] Error 1
make: *** [Makefile:1577: _module_/var/lib/dkms/wireguard/1.0.20220627/build] Error 2
make: Leaving directory '/usr/src/kernels/4.18.0-394.el8.x86_64'

Comment 3 Red Shen 2022-07-06 13:54:54 UTC
(In reply to Alexis G from comment #2)
> Not related to a redhat package but wireguard-dkms is also broken.
Please note that the breakage is caused by the kernel/kernel-devel package 4.18.0-394, not by the wireguard-dkms package. You can still build the wireguard-dkms-1.0.20220627-1 successfully for kernel-4.18.0-383:
sudo dkms install wireguard/1.0.20220627 -k 4.18.0-383.el8.x86_64

Comment 5 Clark Williams 2022-07-20 16:03:26 UTC
General consensus from kernel developers is that wireguard should stop defining ktime_get_coarse_boottime_ns() for kernel >= 4.18.0-394

closing as NOTABUG