amnezia-vpn / amneziawg-linux-kernel-module

AmneziaWG Linux kernel module
https://www.wireguard.com
GNU General Public License v2.0
80 stars 17 forks source link

Makefile: Use simple assignment for KERNELRELEASE #40

Open vanyasem opened 1 month ago

vanyasem commented 1 month ago

GNU Make 4.4.1 on Arch Linux segfaults when encountering You're running a modern Linux Kernel (version $(KERNELRELEASE)).: segmentation fault (core dumped)

It's fixed by using a simple assignment := for KERNELRELEASE instead of a conditional assignment ?=

Behavior without the fix: Stock

Behavior with the fix: Changed assignment

Verifying segfault source by removing the reference to the variable: Removed reference

leninalive commented 1 month ago

This will not work with DKMS for which this module is primarily designated.

Couldn't you run DKMS with your Arch Linux installation instead of proposing this patch?

vanyasem commented 1 month ago

@leninalive

Couldn't you run DKMS with your Arch Linux installation instead of proposing this patch?

Without this patch, I cannot execute any make commands, including the one that makes the DKMS module in the first place - any invocation of make results in a segfault. I attached screenshots to better illustrate the problem.

Locally I just decided to get rid of the 41st line which prints the error message on missing kernel sources, which is the line that's causing the issue, as you can see on the third screenshot.

This issue will affect other distributions at some point, as sooner or later other distros will also update their packages to affected versions. Arch Linux can essentially be seen as a preview of problems to come due to its rolling release update model.

leninalive commented 1 month ago

No, you can by simply running sudo make -C src dkms-install KERNELRELEASE=$(uname -r).

I believe that it is something wrong with your own Arch installation and/or you should at least report this issue to Arch/Make contributors, not us (see the screenshot).

image
krab4t commented 1 month ago

https://savannah.gnu.org/bugs/index.php?65172 You need that patch. Or shorter variable name MODERN_KERNEL_SOURCES_NOT_FOUND_ERROR in src/Makefile.