Bug 13119 - Update request: kmod: fix wrong module search order
Summary: Update request: kmod: fix wrong module search order
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 4
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: QA Team
QA Contact:
URL:
Whiteboard: MGA3TOO has_procedure mga4-64-ok mga4...
Keywords: validated_update
Depends on:
Blocks:
 
Reported: 2014-03-30 19:55 CEST by Anssi Hannula
Modified: 2014-05-03 18:30 CEST (History)
3 users (show)

See Also:
Source RPM: kmod
CVE:
Status comment:


Attachments

Description Anssi Hannula 2014-03-30 19:55:51 CEST
This was originally part of bug #12893, but apparently the reporter's issue was actually a different one, so here it is separately.

The fix has been sent and applied at kmod upstream.

Suggested advisory:
============
The depmod tool in Mageia 3 and Mageia 4 contains a bug which causes, under some circumstances, an installed "X-kernel-Y" package (e.g. "nvidia-current-kernel-3.12.13-desktop-2.mga4") of an older version to override a newer installed "dkms-X" package (e.g. "dkms-nvidia-current"), instead of the correct behavior where "dkms-X" should override the binary module packages.

If this happens with the proprietary NVIDIA driver, for example, the system may not boot up properly as the X server startup will encounter errors due to a kernel module version mismatch.

This update fixes that issue.
============

Uploaded to mga3+mga4 core/updates_testing:

Source packages:
kmod-12-2.2.mga3
kmod-15-2.2.mga4

Binary packages:
kmod-12-2.2.mga3
lib(64)kmod2-12-2.2.mga3
lib(64)kmod-devel-12-2.2.mga3
kmod-15-2.2.mga4
lib(64)kmod2-15-2.2.mga4
lib(64)kmod-devel-15-2.2.mga4


Testing information:
===============
1. Install both "dkms-nvidia-current" and a "nvidia-current-kernel-CURRENTKERNELVERSION" packages, and make sure the installation succeeds. You also need the kernel-devel-CURRENTKERNELVERSION package installed beforehand. You can determine CURRENTKERNELVERSION by running "uname -r".
2. Check the first line of output of "modinfo nvidia-current" command.
WRONG output:
filename:       /lib/modules/X/dkms-binary/Y
CORRECT output:
filename:       /lib/modules/X/dkms/Y

Note that even the old kmod package may have CORRECT output, there is a 50% chance of reproducing the issue and running the command repeatedly will not change the result.
===============
Anssi Hannula 2014-03-30 19:56:53 CEST

Whiteboard: (none) => MGA3TOO has_procedure

Comment 1 Arnaud Vacquier 2014-04-13 22:36:28 CEST
Hi,

For Mageia 4 x86_64 :

before testing :
================
# modinfo nvidia-current
filename:       /lib/modules/3.12.13-desktop-2.mga4/dkms-binary/drivers/char/drm/nvidia-current.ko.xz

For testing :
=============
1-install kmod-15-2.2.mga4.x86_64
2-reboot

# modinfo nvidia-current
filename:       /lib/modules/3.12.13-desktop-2.mga4/dkms-binary/drivers/char/drm/nvidia-current.ko.xz

I don't see your correct output.

CC: (none) => inster.css

Comment 2 Anssi Hannula 2014-04-13 23:08:05 CEST
(In reply to Arnaud Vacquier from comment #1)
> I don't see your correct output.

Thanks, please try again with a new version I just submitted. Advisory and testing procedure remains the same.

Uploaded to mga3+mga4 core/updates_testing:

Source packages:
kmod-12-2.3.mga3
kmod-15-2.3.mga4

Binary packages:
kmod-12-2.3.mga3
lib(64)kmod2-12-2.3.mga3
lib(64)kmod-devel-12-2.3.mga3
kmod-15-2.3.mga4
lib(64)kmod2-15-2.3.mga4
lib(64)kmod-devel-15-2.3.mga4
Comment 3 Arnaud Vacquier 2014-04-14 01:00:50 CEST
Hi,

For install :
=============
To satisfy dependencies, the following package(s) also need to be installed:

- lib64kmod2-15-2.3.mga4.x86_64

=======
=(yes)=
=======

Command, after install & reboot :
=========
# modinfo nvidia-current
filename:       /lib/modules/3.12.13-desktop-2.mga4/dkms-binary/drivers/char/drm/nvidia-current.ko.xz
Comment 4 Anssi Hannula 2014-04-14 01:03:34 CEST
Please run the following command:
# dkms status
Comment 5 Arnaud Vacquier 2014-04-14 01:50:35 CEST
many x)

# dkms status
virtualbox, 4.3.6-1.mga4, 3.12.8-desktop-2.mga4, x86_64: installed 
broadcom-wl, 6.30.223.141-2.mga4.nonfree, 3.12.6-desktop-1.mga4, x86_64: installed 
broadcom-wl, 6.30.223.141-2.mga4.nonfree, 3.12.8-desktop-2.mga4, x86_64: installed 
broadcom-wl, 6.30.223.141-2.mga4.nonfree, 3.12.6-desktop-2.mga4, x86_64: installed 
broadcom-wl, 6.30.223.141-2.mga4.nonfree, 3.12.13-desktop-2.mga4, x86_64: installed 
nvidia-current, 331.49-1.mga4.nonfree, 3.12.8-desktop-2.mga4, x86_64: installed 
broadcom-wl, 6.30.223.141-2.mga4.nonfree, 3.12.6-desktop-1.mga4, x86_64: installed-binary from 3.12.6-desktop-1.mga4
virtualbox, 4.3.6-1.mga4, 3.12.8-desktop-2.mga4, x86_64: installed-binary from 3.12.8-desktop-2.mga4
broadcom-wl, 6.30.223.141-2.mga4.nonfree, 3.12.8-desktop-2.mga4, x86_64: installed-binary from 3.12.8-desktop-2.mga4
broadcom-wl, 6.30.223.141-2.mga4.nonfree, 3.12.6-desktop-2.mga4, x86_64: installed-binary from 3.12.6-desktop-2.mga4
virtualbox, 4.3.6-1.mga4, 3.12.13-desktop-2.mga4, x86_64: installed-binary from 3.12.13-desktop-2.mga4
broadcom-wl, 6.30.223.141-2.mga4.nonfree, 3.12.13-desktop-2.mga4, x86_64: installed-binary from 3.12.13-desktop-2.mga4
nvidia-current, 331.49-1.mga4.nonfree, 3.12.13-desktop-2.mga4, x86_64: installed-binary from 3.12.13-desktop-2.mga4
Comment 6 Arnaud Vacquier 2014-04-14 01:51:56 CEST
current kernel : 
# uname -r
3.12.13-desktop-2.mga4
Comment 7 Anssi Hannula 2014-04-14 02:01:23 CEST
Thanks, my procedure was incomplete. Updated below:

Testing information:
===============
1. Install both "dkms-nvidia-current" and a "nvidia-current-kernel-CURRENTKERNELVERSION" packages, and make sure the installation succeeds. You also need the kernel-devel-CURRENTKERNELVERSION package installed beforehand. You can determine CURRENTKERNELVERSION by running "uname -r".

2. Check the output of:
# dkms status -m nvidia-current -k $(uname -r)
If you get two lines, one with "installed" and one with "installed-binary", continue directly to step 4. 

3. Run, replacing MODULEVER with the the module version from the above command, e.g. "331.49-1.mga4.nonfree":
# dkms build -m nvidia-current -v MODULEVER
# dkms install -m nvidia-current -v MODULEVER --force
There should be no errors from these, and the command from step 2 should now report two lines.

4. Check the first line of output of "modinfo nvidia-current" command.
WRONG output:
filename:       /lib/modules/X/dkms-binary/Y
CORRECT output:
filename:       /lib/modules/X/dkms/Y

Note that even the old kmod package may have CORRECT output, there is a 50% chance of reproducing the issue and running the command repeatedly will not change the result.
===============
Comment 8 Arnaud Vacquier 2014-04-14 02:32:34 CEST
1.there is not kernel-devel...
http://mageia.madb.org/package/list/t_search/kernel/application/0/arch/x86_64/page/2

2.dkms status -m nvidia-current -k $(uname -r)
Shows nothing

but :
====
# dkms status -m nvidia-current
nvidia-current, 331.49-1.mga4.nonfree, 3.12.8-desktop-2.mga4, x86_64: installed 
nvidia-current, 331.49-1.mga4.nonfree, 3.12.13-desktop-2.mga4, x86_64: installed-binary from 3.12.13-desktop-2.mga4
==
So i think it is good ?
and :
==
# dkms status -k $(uname -r)
broadcom-wl, 6.30.223.141-2.mga4.nonfree, 3.12.13-desktop-2.mga4, x86_64: installed 

3. i don't do

4. # modinfo nvidia-current
filename:       /lib/modules/3.12.13-desktop-2.mga4/dkms-binary/drivers/char/drm/nvidia-current.ko.xz
Comment 9 Anssi Hannula 2014-04-14 02:37:40 CEST
(In reply to Arnaud Vacquier from comment #8)
> 1.there is not kernel-devel...
> http://mageia.madb.org/package/list/t_search/kernel/application/0/arch/
> x86_64/page/2

Sorry, I mean e.g. kernel-desktop-devel-3.12.13-2.mga4, if you have 3.12.13-desktop-2.mga4.

> 2.dkms status -m nvidia-current -k $(uname -r)
> Shows nothing

Do you have "nvidia-current-kernel-3.12.13-desktop-2.mga4" installed as instructed in step 1?

> but :
> ====
> # dkms status -m nvidia-current
> nvidia-current, 331.49-1.mga4.nonfree, 3.12.8-desktop-2.mga4, x86_64:
> installed 
> nvidia-current, 331.49-1.mga4.nonfree, 3.12.13-desktop-2.mga4, x86_64:
> installed-binary from 3.12.13-desktop-2.mga4
> ==
> So i think it is good ?

It is not.
Comment 10 Anssi Hannula 2014-04-14 02:41:15 CEST
Argh, seems my procedure was again wrong, the DKMS commandline is weird... let me try once again :)

Testing information:
===============
1. Install both "dkms-nvidia-current" and a "nvidia-current-kernel-CURRENTKERNELVERSION" packages, and make sure the installation succeeds. You also need the kernel-desktop-devel-X.Y.Z package installed beforehand according to the installed kernel version. You can determine CURRENTKERNELVERSION by running "uname -r".

2. Check the output of:
# dkms status -m nvidia-current | grep $(uname -r)
If you get two lines, one with "installed" and one with "installed-binary", continue directly to step 4. 

3. Run, replacing MODULEVER with the the module version from the above command, e.g. "331.49-1.mga4.nonfree":
# dkms build -m nvidia-current -v MODULEVER
# dkms install -m nvidia-current -v MODULEVER --force
There should be no errors from these, and the command from step 2 should now report two lines.

4. Check the first line of output of "modinfo nvidia-current" command.
WRONG output:
filename:       /lib/modules/X/dkms-binary/Y
CORRECT output:
filename:       /lib/modules/X/dkms/Y

Note that even the old kmod package may have CORRECT output, there is a 50% chance of reproducing the issue and running the command repeatedly will not change the result.
===============
Comment 11 Arnaud Vacquier 2014-04-14 02:53:18 CEST
1. kernel-desktop-devel-3.12.13-2.mga4  is installed (with kernel-desktop-devel-latest)

=======================================================
2. # dkms status -m nvidia-current | grep $(uname -r)
nvidia-current, 331.49-1.mga4.nonfree, 3.12.13-desktop-2.mga4, x86_64: installed-binary from 3.12.13-desktop-2.mga4

So step 3...

=======================================================
3.1 dkms build -m nvidia-current -v 331.49-1.mga4.nonfree

Preparing kernel 3.12.13-desktop-2.mga4 for module build:
(This is not compiling a kernel, just preparing kernel symbols)
Storing current .config to be restored when complete
Running Generic preparation routine
make mrproper.....
using /proc/config.gz
make oldconfig....
make prepare....

Building module:
cleaning build area....
make KERNELRELEASE=3.12.13-desktop-2.mga4 SYSSRC=/lib/modules/3.12.13-desktop-2.mga4/build module; make SYSSRC=/lib/modules/3.12.13-desktop-2.mga4/build -C uvm module KBUILD_EXTMOD=/var/lib/dkms/nvidia-current/331.49-1.mga4.nonfree/build/uvm..........
cleaning build area....
cleaning kernel tree (make mrproper)....
                                                                                                                            
DKMS: build Completed. 

=======================================================
3.2 #dkms install -m nvidia-current -v 331.49-1.mga4.nonfree --force                                                                                                                     
nvidia-current.ko.xz:                                                                                                            
 - Installation                                                                                               
   - Installing to /lib/modules/3.12.13-desktop-2.mga4/dkms/drivers/char/drm/                                                                                                                       
nvidia-uvm.ko.xz:                                                                                                               
 - Installation                                                                                                              
   - Installing to /lib/modules/3.12.13-desktop-2.mga4/dkms/drivers/char/drm/                                                                                                                     
depmod.....                                                                                                                  
DKMS: install Completed.   

=======================================================
4.# modinfo nvidia-current                                                                          
filename:       /lib/modules/3.12.13-desktop-2.mga4/dkms/drivers/char/drm/nvidia-current.ko.xz 

=======================================================

now it is correct
Comment 12 claire robinson 2014-04-28 17:18:30 CEST
Adding OK from Arnaud's test. Are you able to test i586 also Arnaud?

Whiteboard: MGA3TOO has_procedure => MGA3TOO has_procedure mga3-64-ok

claire robinson 2014-04-28 17:44:33 CEST

Whiteboard: MGA3TOO has_procedure mga3-64-ok => MGA3TOO has_procedure mga4-64-ok

Comment 13 Arnaud Vacquier 2014-05-01 03:00:37 CEST
Hi Claire,
No sorry i haven't 32bits system.
Comment 14 Thomas Backlund 2014-05-03 15:29:11 CEST
I'll test this later today on both mga3 and mga4

CC: (none) => tmb

Comment 15 Thomas Backlund 2014-05-03 17:43:12 CEST
tested on mga3 32bit and 64bit
tested on mga4 32bit and 64bit

advisory uploaded

validating

Keywords: (none) => validated_update
Whiteboard: MGA3TOO has_procedure mga4-64-ok => MGA3TOO has_procedure mga4-64-ok mga4-32-ok mga3-64-ok mga3-32-ok
CC: (none) => sysadmin-bugs

Comment 16 Thomas Backlund 2014-05-03 18:30:16 CEST
Update pushed:
http://advisories.mageia.org/MGAA-2014-0112.html

Status: ASSIGNED => RESOLVED
Resolution: (none) => FIXED


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