Skip to content

Problems with DKMS modules and kernel 5.19.x + GCC 12.2?

Hey r/archlinux,

I updated all the packages on my machine tonight for the first time in several days, and since then I've been unable to load any kernel modules that are built with DKMS. The modules don't load on boot, and attempting to modprobe them manually just shows the following error (xone_gip is just an example - the behaviour is the same for any DKMS module):

modprobe: ERROR: could not insert 'xone_gip': Operation not permitted

If I look in dmesg when I do this, I can see the following error:

[   47.372403] BPF: [112255] Invalid kind:19
[   47.372405] failed to validate module [xone_gip] BTF: -22

During the upgrade, I noticed that my kernel was upgraded to 5.19.3 and GCC was also updated to 12.2.0. After some digging, it seems like support for BTF/BPF is something that was added to GCC in the 12.x series. For fun I tried dumping the symbols from one of the compiled modules using objdump -x xone-gip.ko (after decompressing it) and noticed the following section:

30 .BTF          0000dc6e  0000000000000000  0000000000000000  00005e4c  2**0

So it seems to me that now GCC is adding that .BTF section into the compiled modules, and the kernel doesn't like it? On a lark I decided to try stripping the .BTF section out of every module compiled with DKMS with the following shell script:

cd /usr/lib/modules/$(uname -r)/updates/dkms
for file in *.zst
do
cp "$file" "$file.bak"
unzstd -f "$file"
base=$(basename "$file" .zst)
objcopy --remove-section .BTF "$base"
zstd -f "$base"
rm -f "$base"
done

Much to my surprise, all of the modules load now!

Has anyone else encountered this issue? Is this a known issue or something particular to my setup? And is there a less-janky workaround than what I'm doing here? :)

EDIT: Thanks to everyone that has chimed in here. I've raised this bug to track the issue. Based on this forum post I'm not alone.

EDIT #2: Current workaround/solution is to downgrade pahole to 1.23-1.

EDIT #3: It looks like pahole 1.24-1 has been replaced with 1:1.23-1 in some mirrors, so everyone should automatically get a working version in the near future and not run into this issue.

Edited 24 Aug 2022. We only hold this version.

84 points28 comments
Open on Reddit
About this post
Posted
Archived
Edited
Score
84 · 99% up
Kind
Text
ID
ww9fa2

Author

1
posts
10
comments
0
media
View profile

32 comments

I was having the exact same problem after updated my kernel (linux, linux-lts) and gcc (and gcc-libs, gcc-go) to version 12.2. while in the completion of the update i got error msgs saying module not found "nvidia" and "nvidia-uvm". Followed the instruction given by the dkms while still in the terminal to get to know more about the error, it turn out that my nvidia modules was compiled using gcc 12.1, and i already updated my gcc to 12.2.

So, downgrading the gcc, gcc-libs and gcc-go to 12.1.1-4 did save my systems. And at this point i am not really sure what is wrong with what haha i'm a total noob, been using the arch for regular daily use.

I'm using nvidia-340xx-dkms driver btw

14 points

Thanks to everyone commented! I've update the original post with a link to the Arch Forums where this issue has also been reported, and to a bug tracker issue that I've raised.

EDIT: Current workaround/solution is to downgrade pahole to 1.23-1.

EDIT #2: Working version of pahole is rolling out to mirrors now.

13 points

Can you inform/give us some update here in your post later if the bugs has been fixed ? I'd like to keep my system up to date, but at this point I'm too afraid to upgrade the gcc packages to newer version than 12.1.1-4. I fear it'll break my systems again. Thanks for reporting it as bugs btw.

3 points

The affected package, pahole, has been replaced with 1:1.23-1 which is a version that works and should avoid this issue. Once your mirror is updated you should be fine!

6 points

I just want to say thanks to all you arch folks finding the bugs in GCC 12 plus kernel 5.19 so everyone running GCC 10 and kernel 5.18 wont have to worry when the upgrade comes later.

You guys are legitimately a big help to the ecosystem

4 points

I've been seeing so many people here having problems with 5.19 that I was afraid to update, but fortunately I didn't have any problems in both of my arch machines, one is using the Nvidia privative driver.

Have you checked if anybody else reported this issue on the arch forums or anywhere else?

3 points

I've checked the forums and bug tracker but didn't find anything relevant yet. I'll submit a big tracker issue if it seems necessary!

1 points

Has anyone else encountered this issue? Is this a known issue or something particular to my setup?

I have the same issue with nvidia-dkms and virtualbox and your solution worked perfectly. No idea why it's happening.

2 points

Thank you. I was pulling my hair out trying to get my laptop to work. Even the non-DKMS drivers for my nVidia GPU were loading. Now it is up and running properly.

2 points
unknown author

Deleted before we saved it.

2 points

the pahole downgrade fixed my issues with nvidia, but virtualbox kernel modules still aren't loading --fixed

1 points

same problem :/

1 points

I fixed it, make sure to reinstall virtualbox-host-dkms, just reinstalling virtualbox doesn't reinstall that for some reason.

1 points

Has anyone else encountered this issue?

Yes, and your hack worked. Thanks!

I have the following modules:

  • nvidia-470xx-dkms 470.141.03-1
  • virtualbox-host-dkms 6.1.36-1
1 points
unknown author

Deleted before we saved it.

1 points
unknown author

Deleted before we saved it.

1 points

My PC (nvidia geforce rtx 2070): I was beating this dead horse last night for 2 hours. I saw the errors mentioned, reinstalled nvidia drivers , saw the pahole downgrade and verified it, and my fix was switching out "nvidia-dkms" for "nvidia" via Yay package manager. I need to verify gcc version before anyone draws any conclusion from my comment.

Old laptop: Unrelated, but I was using one broken machine to research how to fix the other. Went so long with no updates that mirrors and PGP keys are causing problems... imma try again tonight but then imma just do a fresh install cause I'm getting ready to swap out some hardware anyway.

1 points
unknown author

Deleted before we saved it.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.