[SRU] r8168-dkms fails to build module on kernel 6.5.0-14-generic

Bug #2048923 reported by Jakub Šén
62
This bug affects 11 people
Affects Status Importance Assigned to Milestone
r8168 (Ubuntu)
Fix Released
Undecided
Unassigned
Jammy
Fix Released
Undecided
Unassigned

Bug Description

[ Impact ]

r8168-dkms fails to install if the user is using the hwe kernel which is v6.5 as the dkms module will fail to build during installation.
The error being:

/usr/src/r8168-8.049.02/r8168_n.c: In function ‘r8168_csum_workaround’:
/usr/src/r8168-8.049.02/r8168_n.c:27733:24: error: implicit declaration of function ‘skb_gso_segment’; did you mean ‘skb_gso_reset’? [-Werror=implicit-function-declaration]
27733 | segs = skb_gso_segment(skb, features);
      | ^~~~~~~~~~~~~~~

[ Test Plan ]

This needs to be done on both the hwe kernel (v6.5) and the generic kernel (v5.15) to ensure it works on both.

* install r8168-dkms
* successfull installation will mean the build failure has been fixed.
* As a very basic test, try to load the module "sudo modprobe r8168"

Ideally someone with the hardware should test and confirm.

[ Where problems could occur ]

This change is only affecting the users of hwe kernel (v6.5) and the only change is adding a header file which declare the function its trying to use. Similar changes has been done to other upstream network drivers as can be seen at the upstream kernel patch link and has little chance of regression due to this.

[ Other Info ]

 * The change in the upstream linux kernel has been done via: https://<email address hidden>/

[ Original Bug Description ]

After recent upgrade to kernel 6.5.0-14-generic my ethernet connection no longer works, because dkms is unable to compile module for this kernel. I'm on kubuntu lts 22.04.3. On all the previous kernels this worked fine.

$ lsb_release -rd
Description: Ubuntu 22.04.3 LTS
Release: 22.04

$ apt-cache policy r8168-dkms
r8168-dkms:
  Instalovaná verze: 8.049.02-1ubuntu1.2
  Kandidát: 8.049.02-1ubuntu1.2
  Tabulka verzí:
 *** 8.049.02-1ubuntu1.2 500
        500 https://mirror.dkm.cz/ubuntu jammy-updates/universe amd64 Packages
        500 https://mirror.dkm.cz/ubuntu jammy-updates/universe i386 Packages
        100 /var/lib/dpkg/status
     8.049.02-1ubuntu1 500
        500 https://mirror.dkm.cz/ubuntu jammy/universe amd64 Packages
        500 https://mirror.dkm.cz/ubuntu jammy/universe i386 Packages

Expected behavior: dkms successfully builds the r8168 module when new kernel is installed and the ethernet connection works.

What happened instead: dkms failed to build the r8168 module for the new 6.5.0-14-generic kernel and the ethernet connection no longer works.

Please see attached crash log from dkms.

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: r8168-dkms 8.049.02-1ubuntu1.2
ProcVersionSignature: Ubuntu 6.2.0-39.40~22.04.1-generic 6.2.16
Uname: Linux 6.2.0-39-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: KDE
Date: Wed Jan 10 18:56:53 2024
InstallationDate: Installed on 2021-05-13 (972 days ago)
InstallationMedia: Kubuntu 20.04.2.0 LTS "Focal Fossa" - Release amd64 (20210209.1)
PackageArchitecture: all
SourcePackage: r8168
UpgradeStatus: Upgraded to jammy on 2022-08-15 (513 days ago)

Revision history for this message
Jakub Šén (kotyz85) wrote :
GuKKDevel (gukkdevel)
Changed in r8168 (Ubuntu):
status: New → Confirmed
Revision history for this message
GuKKDevel (gukkdevel) wrote :

for me it helped to deinstall R8168-dkms and delete /etc/modprobe.d/blacklist-R8169.conf

Revision history for this message
Isaac (bquode7v) wrote :

Same problem, now my wired connection don't work, only wifi, any solution ?

Revision history for this message
Isaac (igallart) wrote :

I have encountered the same issue when updating, goodbye to the internet except for Wi-Fi.

Removing old r8168-8.049.02 DKMS files...
Module r8168-8.049.02 for kernel 6.2.0-39-generic (x86_64).
Before uninstall, this module version was ACTIVE on this kernel.

r8168.ko:
 - Uninstallation
   - Deleting from: /lib/modules/6.2.0-39-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod...

update-initramfs......
Deleting module r8168-8.049.02 completely from the DKMS tree.
Loading new r8168-8.049.02 DKMS files...
Building for 6.5.0-14-generic
Building initial module for 6.5.0-14-generic
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/r8168-dkms.0.crash'
Error! Bad return status for module build on kernel: 6.5.0-14-generic (x86_64)
Consult /var/lib/dkms/r8168/8.049.02/build/make.log for more information....................................]
dpkg: error al procesar el paquete r8168-dkms (--configure):
 el subproceso instalado paquete r8168-dkms script post-installation devolvió el código de salida de error 10
Procesando disparadores para initramfs-tools (0.140ubuntu13.4) ...
update-initramfs: Generating /boot/initrd.img-6.5.0-14-generic
I: The initramfs will attempt to resume from /dev/nvme0n1p4
I: (UUID=273431e9-813a-4863-8c22-927e873f66e8)
I: Set the RESUME variable to override this.
Se encontraron errores al procesar:
 r8168-dkms
E: Sub-process /usr/bin/dpkg returned an error code (1)

Revision history for this message
Aleksej Chinaev (alechin) wrote :

I had a similar problem (only WiFi operated well) and the advise of GuKKDevel worked for me too. However, in my case the file to deleted was named r8168-dkms.conf.

After restarting the computer, the 'UNCLAIMED' remark disappeared for 'Ethernet interface' (as response to 'sudo lshw -C network') and my wired connection works again.

Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

debdiff for Jammy attached.

Changed in r8168 (Ubuntu Jammy):
status: New → Confirmed
Changed in r8168 (Ubuntu):
status: Confirmed → Fix Released
Changed in r8168 (Ubuntu Jammy):
assignee: nobody → Sudip Mukherjee (sudipmuk)
summary: - r8168-dkms fails to build module on kernel 6.5.0-14-generic
+ [SRU] r8168-dkms fails to build module on kernel 6.5.0-14-generic
description: updated
Changed in r8168 (Ubuntu Jammy):
assignee: Sudip Mukherjee (sudipmuk) → nobody
Revision history for this message
Julian Andres Klode (juliank) wrote :

Sponsored, thank you.

Changed in r8168 (Ubuntu Jammy):
status: Confirmed → In Progress
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Jakub, or anyone else affected,

Accepted r8168 into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/r8168/8.049.02-1ubuntu1.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in r8168 (Ubuntu Jammy):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
Jakub Šén (kotyz85) wrote :
Download full text (4.5 KiB)

That updated package seems to work fine, kernel module successfully builds and network connects.

$ uname -a
Linux athlon-desktop 6.5.0-21-generic #21~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Feb 9 13:32:52 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.4 LTS
Release: 22.04
Codename: jammy

$ apt show r8168-dkms
Package: r8168-dkms
Version: 8.049.02-1ubuntu1.3
Priority: extra
Section: universe/kernel
Source: r8168
Origin: Ubuntu
Maintainer: Ubuntu Developers <email address hidden>
Original-Maintainer: Andreas Beckmann <email address hidden>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 1 377 kB
Depends: dkms (>= 2.1.0.0)
Homepage: https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-pci-express-software
Download-Size: 106 kB
APT-Manual-Installed: yes
APT-Sources: https://mirror.dkm.cz/ubuntu jammy-proposed/universe amd64 Packages
Description: dkms source for the r8168 network driver
 r8168 is the Linux device driver released by RealTek for their network
 controllers with PCI-Express interface:
  * 10/100/1000M Gigabit Ethernet: RTL8111B, RTL8111C, RTL8111D, RTL8111E,
    RTL8111F, RTL8111G(S), RTL8111H(S), RTL8118(A)(S), RTL8119i, RTL8111L,
    RTL8168B, RTL8168E, RTL8168H, RTL8111DP, RTL8111EP, RTL8111FP, RTL8411,
    RTL8411B
 .
 This driver should only be used for devices not yet supported by the
 in-kernel driver r8169. Please see the README.Debian for instructions how
 to report bugs against r8169 that made it necessary to use r8168-dkms.
 .
 Installation of the r8168-dkms package will disable the in-kernel r8169
 module. To re-enable r8169, the r8168-dkms package must be purged.
 .
 This package provides the dkms source code for the r8168 kernel modules.
 Kernel source or headers are required to compile these modules.

$ lsmod | grep r8168
r8168 630784 0

$ lspci -vvv
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0c)
        Subsystem: Micro-Star International Co., Ltd. [MSI] RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0, Cache Line Size: 64 bytes
        Interrupt: pin A routed to IRQ 28
        IOMMU group: 1
        Region 0: I/O ports at d000 [size=256]
        Region 2: Memory at fe100000 (64-bit, non-prefetchable) [size=4K]
        Region 4: Memory at d2100000 (64-bit, prefetchable) [size=16K]
        Capabilities: <access denied>
        Kernel driver in use: r8168
        Kernel modules: r8168

$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft foreve...

Read more...

Jakub Šén (kotyz85)
tags: added: verification-done-jammy
removed: verification-needed-jammy
tags: added: verification-done
removed: verification-needed
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

@kotyz85 thanks for your verification

I see you have done it on the 6.5.0-21-generic kernel. The test plan asks for a verification on the non-hwe kernel as well (5.15), which is still missing.

I went ahead and created a jammy VM with kernel 5.15.0-97-generic and installed r8168-dkms:

$ uname -a
Linux j 5.15.0-97-generic #107-Ubuntu SMP Wed Feb 7 13:26:48 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

$ sudo apt install r8168-dkms -y
(...)
Setting up r8168-dkms (8.049.02-1ubuntu1.2) ...
Loading new r8168-8.049.02 DKMS files...
Building for 5.15.0-97-generic
Building initial module for 5.15.0-97-generic
Can't load /var/lib/shim-signed/mok/.rnd into RNG
404723991C7F0000:error:12000079:random number generator:RAND_load_file:Cannot open file:../crypto/rand/randfile.c:106:Filename=/var/lib/shim-signed/mok/.rnd
.....+..+...+.+.........+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*........+......+.+..+..........+........+...+.+......+...+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*........+...+......+......+....+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
........+.+......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*.....+..+.+..............+....+.....+......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*.+.....+.+.............................+....+...........+...+.......+........+.+......+........+.......+.........+.....+.+...+..+......+....+...+......+..+...+..........+...........+...+.+.........+...+..+.+......+.....+...+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-----
EFI variables are not supported on this system
/sys/firmware/efi/efivars not found, aborting.
Done.

r8168.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.15.0-97-generic/updates/dkms/

depmod...

Backing up initrd.img-5.15.0-97-generic to /boot/initrd.img-5.15.0-97-generic.old-dkms
Making new initrd.img-5.15.0-97-generic
(If next boot fails, revert to initrd.img-5.15.0-97-generic.old-dkms image)
update-initramfs...

The build seems to have worked:
$ find /lib/modules -name '*r8168*ko'
/lib/modules/5.15.0-97-generic/updates/dkms/r8168.ko

And it loads:
$ sudo modprobe r8168
$

dmesg:
[Thu Mar 7 17:36:05 2024] r8168: loading out-of-tree module taints kernel.
[Thu Mar 7 17:36:05 2024] r8168: module verification failed: signature and/or required key missing - tainting kernel

And it loads:
$ lsmod|grep r8168
r8168 552960 0

$ apt-cache policy r8168-dkms
r8168-dkms:
  Installed: 8.049.02-1ubuntu1.2
  Candidate: 8.049.02-1ubuntu1.2
  Version table:
 *** 8.049.02-1ubuntu1.2 500
        500 http://br.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages
        100 /var/lib/dpkg/status

I'm therefore confirming the verification succeeded status for jammy with these results.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package r8168 - 8.049.02-1ubuntu1.3

---------------
r8168 (8.049.02-1ubuntu1.3) jammy; urgency=medium

  * Support linux kernel v6.5 (LP: #2048923):
    - debian/patches/linux-6.5.patch: add header file.

 -- Sudip Mukherjee <email address hidden> Mon, 05 Feb 2024 22:11:52 +0000

Changed in r8168 (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Andreas Hasenack (ahasenack) wrote : Update Released

The verification of the Stable Release Update for r8168 has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.