Bug 1962841 - kmod should not ship /usr/sbin/weak-modules because it is useless and dangerous for DKMS modules
Summary: kmod should not ship /usr/sbin/weak-modules because it is useless and dangero...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: kmod
Version: 33
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: kmod development team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-05-20 16:39 UTC by Chris Siebenmann
Modified: 2021-06-10 01:05 UTC (History)
8 users (show)

Fixed In Version: kmod-29-2.fc34 kmod-29-2.fc33
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-28 00:59:52 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Chris Siebenmann 2021-05-20 16:39:14 UTC
Description of problem:

Fedora specifically adds the /usr/sbin/weak-modules script to the kmod RPM; it's not part of the upstream version. However, weak-modules does not work properly on Fedora, as it believes that a module built for one kernel version can be compatible with another kernel version, and will create /lib/modules/*/weak-updates symlinks reflecting this under at least some circumstances. After these symlinks exist, modprobe of the relevant module(s) will fail with eg:

  version magic '5.11.15-200.fc33.x86_64 SMP mod_unload ' should be '5.10.23-200.fc33.x86_64 SMP mod_unload '

Fedora does not set CONFIG_MODVERSIONS in its kernel configurations, so I believe this will always fail and as a result /usr/sbin/weak-modules's checks are irrelevant and evidently incorrect.

This failure is sufficiently well known that the upstream DKMS manpage contains a warning that everyone writing a dkms.conf must specifically disable running /usr/sbin/weak-modules on Fedora (the 'NO_WEAK_MODULES' setting and the discussion of it in the manpage). It should come as no surprise that not all dkms.conf files contain this setting.

This issue is especially dangerous because it seems to primarily affects people when they are reverting to a previous kernel, where some of their modules may not load.

Version-Release number of selected component (if applicable):
kmod-27-3.fc33.x86_64

How reproducible:
Completely.

Steps to Reproduce:
1. Install a DKMS module with a dkms.conf that doesn't specify NO_WEAK_MODULES=yes. It will modprobe on your current kernel.
2. Install a kernel upgrade.
3. Reboot into the current kernel (not the new upgraded kernel) and observe that your DKMS module no longer modprobes, failing with a version magic error.
4. see that /lib/modules/$(uname -r)/weak-modules contains a symlink for your DKMS module that points to /lib/modules/<new-kernel>/.../<dkms-module>.ko.xz.

Comment 1 Harish Pillay 2021-05-24 09:38:19 UTC
https://utcc.utoronto.ca/~cks/space/blog/linux/FedoraWeakUpdatesFailure perhaps this has useful context as well.

Comment 2 Justin M. Forbes 2021-05-24 18:35:28 UTC
This is fixed with https://src.fedoraproject.org/rpms/kmod/c/43ae298bc965ee0089b15519075622f94f08d7ac?branch=rawhide.  As I have also requested the latest kmod be shipped to F33 and F34 for zstd compatibility, it should trickle that way.

Comment 3 Fedora Update System 2021-05-25 12:50:50 UTC
FEDORA-2021-fa3657ac97 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2021-fa3657ac97

Comment 4 Fedora Update System 2021-05-25 12:50:51 UTC
FEDORA-2021-437f9ffe2d has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-437f9ffe2d

Comment 5 Fedora Update System 2021-05-26 01:17:41 UTC
FEDORA-2021-437f9ffe2d has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-437f9ffe2d`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-437f9ffe2d

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Fedora Update System 2021-05-26 01:54:59 UTC
FEDORA-2021-fa3657ac97 has been pushed to the Fedora 33 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-fa3657ac97`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-fa3657ac97

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Fedora Update System 2021-05-28 00:59:52 UTC
FEDORA-2021-437f9ffe2d has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 8 Fedora Update System 2021-06-10 01:05:59 UTC
FEDORA-2021-fa3657ac97 has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.