Red Hat Bugzilla – Bug 109352
insmod complains about kernel version mismatch when CONFIG_MODVERSIONS = y
Last modified: 2014-03-16 22:40:09 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030617
Description of problem:
We ship a kernel and modules with our product. Our kernel happens to
be 2.4.19 based with patches and we use a slightly changed version of
the redhat supplied configs/*bigmem config file.
We generate an RPM and a -source rpm for the kernel so that users can
easily build modules against our patched kernel source.
We have CONFIG_MODVERSIONS turned on and all of our modules were built
with these turned on.
If we build a new version of a module against the kernel source which
is installed in /usr/src/linux-2.4, the modules build just fine,
however, insmod acts as if we have CONFIG_MODVERSIONS turned off:
/foo/bar/modules.debug/abcproc.o: kernel-module version mismatch
/foo/bar/modules.debug/abcproc.o was compiled for kernel
while this kernel is version 2.4.19-22.usibigmem.
: insmod abcproc.o failed
True, I gave the kernel in /usr/src/linux-2.4 a different name but
that should not matter when CONFIG_MODVERSIONS is set to y, correct?
I think this is a bug, possibly the result of
modutils-2.4.18-versions.patch which is applied to the virgin modutils
If I download modutils from kernel.org and build it, their version of
insmod works correctly and my module loads.
I even tried using the latest 2.4.25 version of the redhat-ified
modutils from fedora and I get the same behaviour.
[root@n5 etc]# grep printk /proc/ksyms
[root@n5 etc]# nm /foo/bar/modules.debug/abcproc.o|grep printk
These symbols clearly indicate that CONFIG_MODVERSIONS is in effect so
why is insmod even comparing the version strings on my kernels?
If I rebuild the rpm package without applying the
modutils-2.4.18-versions.patch, insmod works just as good.
I can reproduce this with plain old hello.o as well.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
This behavior was intentional; to warn if the module was built for a
different kernel even if the modversions are the same.