Bug 1445045

Summary: modprobe -f doesn't work if version magic differs
Product: [Fedora] Fedora Reporter: Jaroslav Škarvada <jskarvad>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: gansalmon, ichavero, itamar, jforbes, jonathan, kernel-maint, kmod-maint, madhu.chinakonda, mchehab, skozina, ykaliuta
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-04-26 14:53:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jaroslav Škarvada 2017-04-24 19:26:06 UTC
Description of problem:
modprobe -f doesn't ignore version magic

Version-Release number of selected component (if applicable):
kmod-23-1.fc25.x86_64

How reproducible:
Always

Steps to Reproduce:
1. have running kernel with version magic '4.10.10-200.fc25.x86_64 SMP mod_unload '
2. recompile kernel without explicit KERNELRELEASE to have version magic '4.10.12 SMP mod_unload '
3. setenforce 0 # due to bug 1427896
3. modprobe it913x
4. dmesg | tail -1
5. modprobe -f it913x

Actual results:
modprobe: ERROR: could not insert 'it913x': Exec format error
[39896.356652] it913x: version magic '4.10.12 SMP mod_unload ' should be '4.10.10-200.fc25.x86_64 SMP mod_unload '
modprobe: ERROR: could not insert 'it913x': Exec format error

Expected results:
No error for the 5. (i.e. modprobe -f)

Additional info:
It works OK if recompiled with KERNELRELEASE=4.10.10-200.fc25.x86_64

Comment 1 Yauheni Kaliuta 2017-04-26 12:00:59 UTC
# grep CONFIG_MODULE_FORCE_LOAD  /boot/config-4.10.11-200.fc25.x86_64
# CONFIG_MODULE_FORCE_LOAD is not set

It's a kernel config issue.

Comment 2 Josh Boyer 2017-04-26 12:12:18 UTC
Reassigning.

I'll leave it for the kernel team to comment on whether they feel allowing forced modprobe is safe or not.

Comment 3 Justin M. Forbes 2017-04-26 14:53:47 UTC
It is a feature, not an issue.  The kernel team does not support forced modules.