Ubuntu kernel >= 5.3.0-52.46 breaks DKMS build for wireguard-linux-compat >= 1.0.20200429, patch included
Hi,
Ubuntu kernel 5.3.0-52.46 breaks the DKMS build for wireguard-linux-compat 1.0.20200429. Function skb_reset_redirect() got added to the kernel's include/linux/skbuff.h, but collides with the function defintion from wireguard-linux-compat's compat/compat.h:
Kernel 5.3.0-52.46 is not only used for Ubuntu 19.10, but serves also as HWE kernel in Ubuntu 18.04.
I've got the DKMS module to compile again on Ubuntu 18.04 using the attached patch, but I'm not sure it that's the correct solution to the problem since the colliding function definitions differ and I'm not really familiar with the kernel's network internals.
Regards
Pascal
var/lib/dkms/wireguard/1.0.20200429/source/compat/compat.h +2 -0
@@ -1021,12 +1021,14 @@ out:#if LINUX_VERSION_CODE <KERNEL_VERSION (5 ,4 ,29 ) || (LINUX_VERSION_CODE >=KERNEL_VERSION (5 ,5 ,0 ) &&LINUX_VERSION_CODE <KERNEL_VERSION (5 ,5 ,14 ))#include <linux/skbuff.h> #include <net/sch_generic.h> +#if !(defined(UTS_UBUNTU_RELEASE_ABI ) && (LINUX_VERSION_CODE >=KERNEL_VERSION (5 ,3 ,18 )) && (LINUX_VERSION_CODE <KERNEL_VERSION (5 ,4 ,0 )) && (UTS_UBUNTU_RELEASE_ABI >=52 ))// Ubuntu 18.04-HWE and 19.10 >= 5.3.0-52.46 static inline void skb_reset_redirect (struct sk_buff *skb) {#ifdef CONFIG_NET_SCHED skb_reset_tc (skb);#endif } +#endif #endif #if defined(ISUBUNTU1604 ) || defined(ISRHEL7 )
Hey Pascal,
Thanks a bunch for the report and patch.
Can you confirm to me whether or not this patch fixes the issue on both 19.10 and 18.04-hwe?
https://git.zx2c4.com/wireguard-linux-compat/commit/?id=1325bedf8ee3d69ed58460b7a8fee96d949f67da
Thanks,
Jason
Hi Jason,
[2020-05-05 03:37] Jason A. Donenfeld:
Quoted 4 lines
Can you confirm to me whether or not this patch fixes the issue on both 19.10 and 18.04-hwe?
https://git.zx2c4.com/wireguard-linux-compat/commit/?id=1325bedf8ee3d69ed58460b7a8fee96d949f67da
I don't have a 19.10 machine to test on, but at least on an 18.04 machine with the 5.3.0-52.46 kernel, it works as intended.
However, building the module for the previous 5.3.0-51.44 kernel fails now, and it doesn't fail when I use my original patch.
Note that as of now, 5.3.0-51.44 is still the latest "official" HWE kernel for 18.04, and 5.3.0-52.46 is only available from Ubuntu's "bionic-proposed" repo.
Regards
Pascal
Signature · 5 lines
Forschung und wissenschaftliche Informationsversorgung IT.SERVICES Ruhr-Universität Bochum | 44780 Bochum Fon: +49 234 32-29169 Fax: +49 234 32-07835
Hi Pascal,
Quoted 8 lines · Pascal Ernster
Hi Jason,
[2020-05-05 03:37] Jason A. Donenfeld:
Quoted 3 lines
Can you confirm to me whether or not this patch fixes the issue on both 19.10 and 18.04-hwe?
Quoted 7 lines
Quoted 1 line
https://git.zx2c4.com/wireguard-linux-compat/commit/?id=1325bedf8ee3d69ed58460b7a8fee96d949f67da
I don't have a 19.10 machine to test on, but at least on an 18.04 machine with the 5.3.0-52.46 kernel, it works as intended.
However, building the module for the previous 5.3.0-51.44 kernel fails now, and it doesn't fail when I use my original patch.
Right. The compat layer, in order to keep it maintainable in the long term, only supports the latest distro frankenkernel for each distro release. The latest 14.04, 16.04, ..., RHEL7, RHEL8, SLE 15, and so forth.
Quoted 4 lines
Note that as of now, 5.3.0-51.44 is still the latest "official" HWE kernel for 18.04, and 5.3.0-52.46 is only available from Ubuntu's "bionic-proposed" repo.
Ahh, you're running -proposed, gotcha. So I guess I should wait until this hits the main repo. Any idea when they usually do that?
Jason
Hi Jason,
[2020-05-05 06:03] Jason A. Donenfeld:
Quoted 2 lines
Ahh, you're running -proposed, gotcha. So I guess I should wait until this hits the main repo. Any idea when they usually do that?
I'm not a Ubuntu developer, but my educated guess would be "when their next HWE kernel security advisory hits the RSS feed". At least that's what happened when 5.3.0-51.44 got released:
https://usn.ubuntu.com/4342-1/
Regards
Pascal
Quoted 6 lines · On 2020-05-05 12:03 a.m., Jason at zx2c4.com (Jason A. Donenfeld) wrote:
Quoted 3 lines
Note that as of now, 5.3.0-51.44 is still the latest "official" HWE kernel for 18.04, and 5.3.0-52.46 is only available from Ubuntu's "bionic-proposed" repo.
Ahh, you're running -proposed, gotcha. So I guess I should wait until this hits the main repo. Any idea when they usually do that?
The next kernel batch should land in -updates on May 18th. The detailed schedule is at https://kernel.ubuntu.com/
Regards,
Simon
Quoted 11 lines · Simon Deziel
Quoted 6 lines · On 2020-05-05 12:03 a.m., Jason at zx2c4.com (Jason A. Donenfeld) wrote:
Quoted 3 lines
Note that as of now, 5.3.0-51.44 is still the latest "official" HWE kernel for 18.04, and 5.3.0-52.46 is only available from Ubuntu's "bionic-proposed" repo.
Ahh, you're running -proposed, gotcha. So I guess I should wait until this hits the main repo. Any idea when they usually do that?
The next kernel batch should land in -updates on May 18th. The detailed schedule is at https://kernel.ubuntu.com/
Ooof, thanks for that info. Looks like we're a tad early on the .52 changes.
Quoted 5 lines · Simon Deziel
Quoted 2 lines · On 2020-05-05 12:03 a.m., Jason at zx2c4.com (Jason A. Donenfeld) wrote:
Ahh, you're running -proposed, gotcha. So I guess I should wait until this hits the main repo. Any idea when they usually do that?
The next kernel batch should land in -updates on May 18th. The detailed schedule is at https://kernel.ubuntu.com/
The broken kernel 5.3.0-53.47~18.04.1 was still pushed to 18.04 very recently, today or may be yesterday